replace_all (msg, "\n", "");
- if (err->file && err->line) {
- error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
+ if (!msg.empty()) {
+ if (err->file && err->line) {
+ error << X_("XML error: ") << msg << " in " << err->file << " at line " << err->line;
- if (err->int2) {
- error << ':' << err->int2;
+ if (err->int2) {
+ error << ':' << err->int2;
+ }
+
+ error << endmsg;
+ } else {
+ error << X_("XML error: ") << msg << endmsg;
}
}
- error << endmsg;
}
, video_timeline(0)
, global_actions (X_("global"))
, ignore_dual_punch (false)
+ , main_window_visibility (0)
, editor (0)
, mixer (0)
, nsm (0)
theArdourUI = this;
}
+ /* track main window visibility */
+
+ main_window_visibility = new VisibilityTracker (_main_window);
+
/* stop libxml from spewing to stdout/stderr */
xmlSetGenericErrorFunc (this, libxml_generic_error_func);
ARDOUR::Session::AskAboutSampleRateMismatch.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::sr_mismatch_dialog, this, _1, _2));
+ /* handle sr mismatch with a dialog - cross-thread from engine */
+ ARDOUR::Session::NotifyAboutSampleRateMismatch.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::sr_mismatch_message, this, _1, _2), gui_context ());
+
/* handle requests to quit (coming from JACK session) */
ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::finish, this), gui_context ());
delete mixer; mixer = 0;
delete nsm; nsm = 0;
delete gui_object_state; gui_object_state = 0;
+ delete main_window_visibility;
FastMeter::flush_pattern_cache ();
PixFader::flush_pattern_cache ();
}
void
ARDOUR_UI::set_transport_controllable_state (const XMLNode& node)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("roll")) != 0) {
roll_controllable->set_id (prop->value());
can_return = false;
}
+ if (splash && splash->is_visible()) {
+ // in 1 second, hide the splash screen
+ Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
+ }
}
bool
uint32_t how_many,
const string& name_template,
bool strict_io,
- PluginInfoPtr instrument)
+ PluginInfoPtr instrument,
+ Plugin::PresetRecord* pset)
{
list<boost::shared_ptr<MidiTrack> > tracks;
}
try {
- tracks = _session->new_midi_track (input, output, instrument, ARDOUR::Normal, route_group, how_many, name_template);
+ tracks = _session->new_midi_track (input, output, instrument, ARDOUR::Normal, route_group, how_many, name_template, pset);
if (tracks.size() != how_many) {
error << string_compose(P_("could not create %1 new mixed track", "could not create %1 new mixed tracks", how_many), how_many) << endmsg;
uint32_t how_many,
const string& name_template,
bool strict_io,
- PluginInfoPtr instrument)
+ PluginInfoPtr instrument,
+ Plugin::PresetRecord* pset)
{
RouteList routes;
}
try {
- routes = _session->new_midi_route (route_group, how_many, name_template, instrument);
+ routes = _session->new_midi_route (route_group, how_many, name_template, instrument, pset);
if (routes.size() != how_many) {
error << string_compose(P_("could not create %1 new Midi Bus", "could not create %1 new Midi Busses", how_many), how_many) << endmsg;
}
uint32_t how_many,
const string& name_template,
bool strict_io,
- PluginInfoPtr instrument)
+ PluginInfoPtr instrument,
+ Plugin::PresetRecord* pset)
{
ChanCount one_midi_channel;
one_midi_channel.set (DataType::MIDI, 1);
if (disk) {
- session_add_mixed_track (one_midi_channel, one_midi_channel, route_group, how_many, name_template, strict_io, instrument);
+ session_add_mixed_track (one_midi_channel, one_midi_channel, route_group, how_many, name_template, strict_io, instrument, pset);
} else {
- session_add_midi_bus (route_group, how_many, name_template, strict_io, instrument);
+ session_add_midi_bus (route_group, how_many, name_template, strict_io, instrument, pset);
}
}
prompter.set_name ("Prompter");
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
if (switch_to_it) {
- prompter.set_title (_("Save as..."));
+ prompter.set_title (_("Snapshot and switch"));
prompter.set_prompt (_("New session name"));
} else {
prompter.set_title (_("Take Snapshot"));
if (get_session_parameters (true, false)) {
exit (1);
}
+ if (splash && splash->is_visible()) {
+ // in 1 second, hide the splash screen
+ Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
+ }
}
/** @param snap_name Snapshot name (without .ardour suffix).
}
void
-ARDOUR_UI::add_route (Gtk::Window* /* ignored */)
+ARDOUR_UI::add_route ()
{
int count;
session_add_midi_track (route_group, count, name_template, strict_io, instrument);
break;
case AddRouteDialog::MixedTrack:
- session_add_mixed_track (input_chan, output_chan, route_group, count, name_template, strict_io, instrument);
+ session_add_mixed_track (input_chan, output_chan, route_group, count, name_template, strict_io, instrument, 0);
break;
case AddRouteDialog::AudioBus:
session_add_audio_bus (input_chan.n_audio(), output_chan.n_audio(), route_group, count, name_template, strict_io);
break;
case AddRouteDialog::MidiBus:
- session_add_midi_bus (route_group, count, name_template, strict_io, instrument);
+ session_add_midi_bus (route_group, count, name_template, strict_io, instrument, 0);
break;
}
}
return 1;
}
+void
+ARDOUR_UI::sr_mismatch_message (framecnt_t desired, framecnt_t actual)
+{
+ MessageDialog msg (string_compose (_("\
+This session was created with a sample rate of %1 Hz, but\n\
+%2 is currently running at %3 Hz.\n\
+Audio will be recorded and played at the wrong sample rate.\n\
+Re-Configure the Audio Engine in\n\
+Menu > Window > Audio/Midi Setup"),
+ desired, PROGRAM_NAME, actual),
+ true,
+ Gtk::MESSAGE_WARNING);
+ msg.run ();
+}
+
void
ARDOUR_UI::use_config ()
{
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
audio_midi_setup->set_position (WIN_POS_CENTER);
- // TODO make this a preference.
- // (engine state is parsed by the GUI, but currently saved
- // in preferences: ARDOUR::Config->extra_xml
- // soooo where should this option go?)
- if (getenv("TRY_AUTOSTART_ENGINE")) {
+ if (Config->get_try_autostart_engine () || getenv ("TRY_AUTOSTART_ENGINE")) {
audio_midi_setup->try_autostart ();
if (ARDOUR::AudioEngine::instance()->running()) {
return 0;
if (window_icons.empty()) {
Glib::RefPtr<Gdk::Pixbuf> icon;
- if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
+ if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) {
window_icons.push_back (icon);
}
- if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
+ if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) {
window_icons.push_back (icon);
}
- if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
+ if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) {
window_icons.push_back (icon);
}
- if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
+ if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) {
window_icons.push_back (icon);
}
}
static Gtkmm2ext::Bindings*
get_bindings_from_widget_heirarchy (GtkWidget* w)
{
- void* p;
+ void* p = NULL;
while (w) {
if ((p = g_object_get_data (G_OBJECT(w), "ardour-bindings")) != 0) {