diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-08 02:50:53 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-08 02:50:53 +0000 |
commit | 0d2c8771a7b0f70fe4cf21cfdcfca709470787c2 (patch) | |
tree | d39ee0545b79178894d5216b2c87956e8bedc14c /gtk2_ardour/audio_time_axis.cc | |
parent | be60137cfb31ef1266f5132a9fd465c01ce074a9 (diff) |
fix for deferred saves by StateManager-derivatives; changes to new/copy/clear playlist ops (not finished), TRUE/FALSE -> true/false in editor_mouse.cc
git-svn-id: svn://localhost/trunk/ardour2@358 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/audio_time_axis.cc')
-rw-r--r-- | gtk2_ardour/audio_time_axis.cc | 93 |
1 files changed, 52 insertions, 41 deletions
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 88a0f5eb57..4ec1e3da2a 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -858,7 +858,7 @@ AudioTimeAxisView::rename_current_playlist () } void -AudioTimeAxisView::use_copy_playlist () +AudioTimeAxisView::use_copy_playlist (bool prompt) { AudioPlaylist *pl; DiskStream *ds; @@ -873,64 +873,74 @@ AudioTimeAxisView::use_copy_playlist () return; } - ArdourPrompter prompter (true); - string new_name = Playlist::bump_name (pl->name(), _session); - - prompter.set_prompt (_("Name for playlist")); - prompter.set_initial_text (new_name); - prompter.show_all (); + name = Playlist::bump_name (pl->name(), _session); - switch (prompter.run ()) { - case Gtk::RESPONSE_ACCEPT: - prompter.get_result (name); - if (name.length()) { - ds->use_copy_playlist (); - pl = ds->playlist(); - pl->set_name (name); + if (prompt) { + + ArdourPrompter prompter (true); + + prompter.set_prompt (_("Name for playlist")); + prompter.set_initial_text (name); + prompter.show_all (); + + switch (prompter.run ()) { + case Gtk::RESPONSE_ACCEPT: + prompter.get_result (name); + break; + + default: + return; } - break; + } - default: - break; + if (name.length()) { + ds->use_copy_playlist (); + pl = ds->playlist(); + pl->set_name (name); } } void -AudioTimeAxisView::use_new_playlist () +AudioTimeAxisView::use_new_playlist (bool prompt) { AudioPlaylist *pl; DiskStream *ds; string name; - + /* neither conditions are supposed to be true at this time, but to leave the design flexible, allow them to be in the future without causing crashes */ - + if (((ds = get_diskstream()) == 0) || ((pl = ds->playlist()) == 0)) { return; } - - ArdourPrompter prompter (true); - string new_name = Playlist::bump_name (pl->name(), _session); - - prompter.set_prompt (_("Name for playlist")); - prompter.set_initial_text (new_name); - switch (prompter.run ()) { - case Gtk::RESPONSE_ACCEPT: - prompter.get_result (name); - if (name.length()) { - ds->use_new_playlist (); - pl = ds->playlist(); - pl->set_name (name); + name = Playlist::bump_name (pl->name(), _session); + + if (prompt) { + + ArdourPrompter prompter (true); + + prompter.set_prompt (_("Name for playlist")); + prompter.set_initial_text (name); + + switch (prompter.run ()) { + case Gtk::RESPONSE_ACCEPT: + prompter.get_result (name); + break; + + default: + return; } - break; + } - default: - break; + if (name.length()) { + ds->use_new_playlist (); + pl = ds->playlist(); + pl->set_name (name); } -} +} void AudioTimeAxisView::clear_playlist () @@ -1010,7 +1020,8 @@ AudioTimeAxisView::selection_click (GdkEventButton* ev) switch (Keyboard::selection_type (ev->state)) { case Selection::Toggle: - editor.get_selection().toggle (*tracks); + /* XXX this is not right */ + editor.get_selection().add (*tracks); break; case Selection::Set: @@ -1855,10 +1866,10 @@ AudioTimeAxisView::build_playlist_menu (Gtk::Menu * menu) playlist_items.push_back (MenuElem (_("Rename"), mem_fun(*this, &AudioTimeAxisView::rename_current_playlist))); playlist_items.push_back (SeparatorElem()); - playlist_items.push_back (MenuElem (_("New"), mem_fun(*this, &AudioTimeAxisView::use_new_playlist))); - playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(*this, &AudioTimeAxisView::use_copy_playlist))); + playlist_items.push_back (MenuElem (_("New"), mem_fun(editor, &PublicEditor::new_playlists))); + playlist_items.push_back (MenuElem (_("New Copy"), mem_fun(editor, &PublicEditor::copy_playlists))); playlist_items.push_back (SeparatorElem()); - playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(*this, &AudioTimeAxisView::clear_playlist))); + playlist_items.push_back (MenuElem (_("Clear Current"), mem_fun(editor, &PublicEditor::clear_playlists))); playlist_items.push_back (SeparatorElem()); playlist_items.push_back (MenuElem(_("Select"), mem_fun(*this, &AudioTimeAxisView::show_playlist_selector))); |