mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 20:26:30 +01:00
Real fix for Jack MIDI crash. Maybe!
git-svn-id: svn://localhost/ardour2/branches/midi@1782 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
acdfe9857a
commit
b8e9b3f071
5 changed files with 17 additions and 17 deletions
|
|
@ -191,7 +191,7 @@ int main (int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
ARDOUR::AudioEngine *engine;
|
ARDOUR::AudioEngine *engine = NULL;
|
||||||
vector<Glib::ustring> null_file_list;
|
vector<Glib::ustring> null_file_list;
|
||||||
|
|
||||||
Glib::thread_init();
|
Glib::thread_init();
|
||||||
|
|
@ -251,7 +251,7 @@ int main (int argc, char *argv[])
|
||||||
|
|
||||||
PBD::ID::init ();
|
PBD::ID::init ();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
|
ui = new ARDOUR_UI (&argc, &argv, which_ui_rcfile());
|
||||||
} catch (failed_constructor& err) {
|
} catch (failed_constructor& err) {
|
||||||
error << _("could not create ARDOUR GUI") << endmsg;
|
error << _("could not create ARDOUR GUI") << endmsg;
|
||||||
|
|
@ -270,7 +270,7 @@ int main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ARDOUR::init (*engine, use_vst, try_hw_optimization);
|
ARDOUR::init (use_vst, try_hw_optimization);
|
||||||
setup_gtk_ardour_enums ();
|
setup_gtk_ardour_enums ();
|
||||||
Config->set_current_owner (ConfigVariableBase::Interface);
|
Config->set_current_owner (ConfigVariableBase::Interface);
|
||||||
ui->setup_profile ();
|
ui->setup_profile ();
|
||||||
|
|
@ -282,6 +282,8 @@ int main (int argc, char *argv[])
|
||||||
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
|
error << string_compose (_("Could not connect to JACK server as \"%1\""), jack_client_name) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ARDOUR::setup_midi(*engine);
|
||||||
|
|
||||||
ui->set_engine (*engine);
|
ui->set_engine (*engine);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,10 @@ namespace ARDOUR {
|
||||||
|
|
||||||
static const nframes_t max_frames = JACK_MAX_FRAMES;
|
static const nframes_t max_frames = JACK_MAX_FRAMES;
|
||||||
|
|
||||||
int init (AudioEngine& engine, bool with_vst, bool try_optimization);
|
int init (bool with_vst, bool try_optimization);
|
||||||
int cleanup ();
|
int cleanup ();
|
||||||
|
|
||||||
|
int setup_midi(AudioEngine& engine);
|
||||||
|
|
||||||
std::string get_ardour_revision ();
|
std::string get_ardour_revision ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,8 +108,8 @@ setup_osc ()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
int
|
||||||
setup_midi (AudioEngine& engine )
|
ARDOUR::setup_midi (AudioEngine& engine)
|
||||||
{
|
{
|
||||||
std::map<string,Configuration::MidiPortDescriptor*>::iterator i;
|
std::map<string,Configuration::MidiPortDescriptor*>::iterator i;
|
||||||
int nports;
|
int nports;
|
||||||
|
|
@ -286,7 +286,7 @@ setup_hardware_optimization (bool try_optimization)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ARDOUR::init (ARDOUR::AudioEngine& engine, bool use_vst, bool try_optimization)
|
ARDOUR::init (bool use_vst, bool try_optimization)
|
||||||
{
|
{
|
||||||
extern void setup_enum_writer ();
|
extern void setup_enum_writer ();
|
||||||
|
|
||||||
|
|
@ -307,10 +307,6 @@ ARDOUR::init (ARDOUR::AudioEngine& engine, bool use_vst, bool try_optimization)
|
||||||
|
|
||||||
Profile = new RuntimeProfile;
|
Profile = new RuntimeProfile;
|
||||||
|
|
||||||
if (setup_midi (engine)) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBLO
|
#ifdef HAVE_LIBLO
|
||||||
if (setup_osc ()) {
|
if (setup_osc ()) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ JACK_MidiPort::create_ports(PortRequest & req)
|
||||||
assert(!_jack_input_port);
|
assert(!_jack_input_port);
|
||||||
assert(!_jack_output_port);
|
assert(!_jack_output_port);
|
||||||
|
|
||||||
//jack_nframes_t nframes = jack_get_buffer_size(_jack_client);
|
jack_nframes_t nframes = jack_get_buffer_size(_jack_client);
|
||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
|
|
@ -108,8 +108,8 @@ JACK_MidiPort::create_ports(PortRequest & req)
|
||||||
_jack_output_port = jack_port_register(_jack_client,
|
_jack_output_port = jack_port_register(_jack_client,
|
||||||
string(req.tagname).append("_out").c_str(),
|
string(req.tagname).append("_out").c_str(),
|
||||||
JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
|
JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
|
||||||
//jack_midi_clear_buffer(
|
jack_midi_clear_buffer(
|
||||||
// jack_port_get_buffer(_jack_output_port, nframes));
|
jack_port_get_buffer(_jack_output_port, nframes));
|
||||||
ret = ret && (_jack_output_port != NULL);
|
ret = ret && (_jack_output_port != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,8 +117,8 @@ JACK_MidiPort::create_ports(PortRequest & req)
|
||||||
_jack_input_port = jack_port_register(_jack_client,
|
_jack_input_port = jack_port_register(_jack_client,
|
||||||
string(req.tagname).append("_in").c_str(),
|
string(req.tagname).append("_in").c_str(),
|
||||||
JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0);
|
JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0);
|
||||||
//jack_midi_clear_buffer(
|
jack_midi_clear_buffer(
|
||||||
// jack_port_get_buffer(_jack_input_port, nframes));
|
jack_port_get_buffer(_jack_input_port, nframes));
|
||||||
ret = ret && (_jack_input_port != NULL);
|
ret = ret && (_jack_input_port != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
#ifndef JACK_COMPAT_H
|
#ifndef JACK_COMPAT_H
|
||||||
#define JACK_COMPAT_H
|
#define JACK_COMPAT_H
|
||||||
|
|
||||||
#define JACK_MIDI_NEEDS_NFRAMES
|
//#define JACK_MIDI_NEEDS_NFRAMES
|
||||||
|
|
||||||
#if defined(JACK_MIDI_NEEDS_NFRAMES)
|
#if defined(JACK_MIDI_NEEDS_NFRAMES)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue