bg[SELECTED] = { 0.93, 0.34, 0.08 }
}
-style "region_list_display" = "small_bold_text"
+style "treeview_parent_node"
{
- fg[NORMAL] = { 0.80, 0.80, 0.80 }
- fg[ACTIVE] = { 0.80, 0.80, 0.80 }
- fg[SELECTED] = { 0.70, 0.70, 0.70 }
- bg[NORMAL] = { 0, 0, 0 }
- bg[ACTIVE] = { 0, 0, 0 }
- bg[SELECTED] = { 0, 0, 0 }
- base[NORMAL] = { 0, 0, 0 }
- base[ACTIVE] = { 0, 1, 0 }
- base[INSENSITIVE] = { 0, 0, 0 }
- base[SELECTED] = { 0.80, 0.80, 0.80 }
+ # specifies *just* the color used for whole file rows when not selected
+ fg[NORMAL] = { 0.0, 0.6, 0.85 }
+}
+
+style "treeview_display" = "small_bold_text"
+
+ # expander arrow border and DnD "icon" text
+ fg[NORMAL] = { 0.8, 0.8, 0.8 }
+
+ # background with no rows or no selection, plus
+ # expander arrow core and DnD "icon" background
+ base[NORMAL] = { 0.20, 0.20, 0.25 }
+
+ # selected row bg when window does not have focus (including during DnD)
+ base[ACTIVE] = { 0.0, 0.60, 0.60 }
+
+ # selected row bg when window has focus
+ base[SELECTED] = { 0, 0.75, 0.75 }
+
+ # row text when in normal state and not a parent
+ text[NORMAL] = { 0.80, 0.80, 0.80 }
+
+ # selected row text with window focus
+ text[SELECTED] = { 0, 1.0, 1.0 }
+
+ # selected row text without window focus (including during DnD)
+ text[ACTIVE] = { 0, 1.0, 1.0 }
}
style "main_canvas_area"
}
-style "region_list_whole_file"
-{
- fg[NORMAL] = { 0.4, 0.4, 0.9 }
-}
-
style "ardour_button" ="default_buttons_menus"
{
xthickness = 1
widget "*EditorTrackNameDisplay*" style "track_name_display"
widget "*EditorActiveTrackNameDisplay" style "active_track_name_display"
widget "*EditorActiveTrackNameDisplay*" style "active_track_name_display"
-widget "*EditorRegionList" style "region_list_display"
widget "*CrossfadeEditAuditionButton" style "red_when_active"
widget "*CrossfadeEditAuditionButton*" style "red_when_active"
widget "*CrossfadeEditCurveButton" style "red_when_active"
widget "*PluginUIClickBox" style "medium_bold_entry"
widget "*PluginUIClickBox*" style "medium_bold_entry"
widget "*PluginSlider" style "plugin_slider"
-widget "*TrackListDisplay" style "track_list_display"
-widget "*TrackListDisplay.*" style "small_bold_text"
-widget "*EditGroupList" style "track_list_display"
-widget "*RegionListDisplay" style "small_bold_entry"
-widget "*RegionListDisplay.*" style "small_bold_text"
widget "*RedirectSelector" style "redirect_list_display"
widget "*RedirectSelector.*" style "redirect_list_display"
+widget "*EditGroupDisplay" style "treeview_display"
+widget "*TrackListDisplay" style "treeview_display"
+widget "*RegionListDisplay" style "treeview_display"
+widget "*NamedSelectionDisplay" style "treeview_display"
+widget "*SnapshotDisplay" style "treeview_display"
widget "*MixerTrackCommentArea" style "option_entry"
widget "*MixerPanZone" style "pan_zone"
-widget "*MixerTrackDisplayList" style "track_list_display"
-widget "*MixerSnapshotDisplayList" style "track_list_display"
-widget "*MixerAuxDisplayList" style "track_list_display"
-widget "*MixerGroupList" style "track_list_display"
+widget "*MixerTrackDisplayList" style "treeview_display"
+widget "*MixerSnapshotDisplayList" style "treeview_display"
+widget "*MixerAuxDisplayList" style "treeview_display"
+widget "*MixerGroupList" style "treeview_display"
widget "*RegionEditorLabel" style "medium_text"
widget "*RegionEditorSmallLabel" style "small_text"
widget "*RegionEditorEntry" style "medium_entry"
widget "*PanningLinkDirectionButton.*" style "very_small_button"
widget "*ChannelCountSelector" style "medium_bold_entry"
widget "*ChannelCountSelector.GtkArrow" style "default_buttons_menus"
-widget "*RegionListWholeFile" style "region_list_whole_file"
+widget "*RegionListWholeFile" style "treeview_parent_node"
class "GtkWidget" style "default_base"
class "GtkScrollbar" style "ardour_adjusters"
active_cell->property_activatable() = true;
active_cell->property_radio() = false;
- edit_group_display.set_name ("EditGroupList");
-
group_model->signal_row_changed().connect (mem_fun (*this, &Editor::edit_group_row_change));
edit_group_display.set_name ("EditGroupList");
edit_group_display.get_selection()->set_mode (SELECTION_SINGLE);
+ edit_group_display.set_headers_visible (false);
edit_group_display.set_reorderable (false);
edit_group_display.set_rules_hint (true);
edit_group_display.set_size_request (75, -1);
named_selection_display.append_column (_("Chunks"), named_selection_columns.text);
named_selection_display.set_headers_visible (false);
named_selection_display.set_size_request (100, -1);
- named_selection_display.set_name ("RegionListDisplay");
+ named_selection_display.set_name ("NamedSelectionDisplay");
named_selection_display.get_selection()->set_mode (SELECTION_SINGLE);
named_selection_display.set_size_request (100, -1);
- named_selection_display.signal_button_release_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
+ named_selection_display.signal_button_release_event().connect (mem_fun(*this, &Editor::named_selection_display_button_release), false);
+ named_selection_display.signal_key_release_event().connect (mem_fun(*this, &Editor::named_selection_display_key_release), false);
named_selection_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::named_selection_display_selection_changed));
/* SNAPSHOTS */
snapshot_display_model = ListStore::create (snapshot_display_columns);
snapshot_display.set_model (snapshot_display_model);
snapshot_display.append_column (X_("snapshot"), snapshot_display_columns.visible_name);
- snapshot_display.set_name ("SnapshotDisplayList");
+ snapshot_display.set_name ("SnapshotDisplay");
snapshot_display.set_size_request (75, -1);
snapshot_display.set_headers_visible (false);
snapshot_display.set_reorderable (false);
items.push_back (MenuElem (_("Crop region to range"), mem_fun(*this, &Editor::crop_region_to_selection)));
items.push_back (MenuElem (_("Fill range with region"), mem_fun(*this, &Editor::region_fill_selection)));
items.push_back (MenuElem (_("Duplicate range"), bind (mem_fun(*this, &Editor::duplicate_dialog), false)));
- items.push_back (MenuElem (_("Create chunk from range"), mem_fun(*this, &Editor::name_selection)));
+ items.push_back (MenuElem (_("Create chunk from range"), mem_fun(*this, &Editor::create_named_selection)));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Bounce range"), mem_fun(*this, &Editor::bounce_range_selection)));
items.push_back (MenuElem (_("Export range"), mem_fun(*this, &Editor::export_selection)));
string statename = *(*i);
TreeModel::Row row = *(snapshot_display_model->append());
- // we don't have a way of changing the rendering in just one TreeView
- // cell so just put an asterisk on each side of the name for now.
+ /* this lingers on in case we ever want to change the visible
+ name of the snapshot.
+ */
+
string display_name;
+ display_name = statename;
+
if (statename == session->snap_name()) {
- display_name = "*"+statename+"*";
snapshot_display.get_selection()->select(row);
- } else {
- display_name = statename;
- }
+ }
row[snapshot_display_columns.visible_name] = display_name;
row[snapshot_display_columns.real_name] = statename;
Gtkmm2ext::DnDTreeView<ARDOUR::NamedSelection*> named_selection_display;
Gtk::ScrolledWindow named_selection_scroller;
- void name_selection();
- void named_selection_name_chosen ();
- void create_named_selection (const string &);
+ void create_named_selection ();
void paste_named_selection (float times);
+ void remove_selected_named_selections ();
void handle_new_named_selection ();
void add_named_selection_to_named_selection_display (ARDOUR::NamedSelection&);
void redisplay_named_selections ();
- gint named_selection_display_button_press (GdkEventButton *ev);
+ bool named_selection_display_button_release (GdkEventButton *ev);
+ bool named_selection_display_key_release (GdkEventKey *ev);
void named_selection_display_selection_changed ();
/* track views */
/* rip everything out of the list displays */
- region_list_clear (); // no clear() method in gtkmm 1.2
+ region_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+ route_list_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+ named_selection_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+ edit_group_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+
+ region_list_model->clear ();
route_display_model->clear ();
named_selection_model->clear ();
group_model->clear ();
+ region_list_display.set_model (region_list_model);
+ route_list_display.set_model (route_display_model);
+ named_selection_display.set_model (named_selection_model);
+ edit_group_display.set_model (group_model);
+
edit_cursor_clock.set_session (0);
zoom_range_clock.set_session (0);
nudge_clock.set_session (0);
void
Editor::handle_audio_region_removed (boost::weak_ptr<AudioRegion> wregion)
{
- ENSURE_GUI_THREAD (bind (mem_fun (*this, &Editor::handle_audio_region_removed), wregion));
+ cerr << "removed region\n";
+ ENSURE_GUI_THREAD (mem_fun (*this, &Editor::redisplay_regions));
redisplay_regions ();
}
}
}
-void
-Editor::region_list_clear ()
-{
- region_list_model->clear();
-}
-
void
Editor::build_region_list_menu ()
{
void
Editor::remove_a_region (boost::shared_ptr<Region> r)
{
+ cerr << "remove " << r->name();
session->remove_region_from_region_list (r);
}
void
Editor::remove_region_from_region_list ()
{
+ cerr << "Mapping remove over region selection\n";
region_list_selection_mapover (mem_fun (*this, &Editor::remove_a_region));
}
session->foreach_named_selection (*this, &Editor::add_named_selection_to_named_selection_display);
}
-gint
-Editor::named_selection_display_button_press (GdkEventButton *ev)
+bool
+Editor::named_selection_display_key_release (GdkEventKey* ev)
{
+ if (session == 0) {
+ return true;
+ }
+
+ switch (ev->keyval) {
+ case GDK_Delete:
+ remove_selected_named_selections ();
+ return true;
+ break;
+ default:
+ return false;
+ break;
+ }
+
+}
+
+void
+Editor::remove_selected_named_selections ()
+{
+ Glib::RefPtr<TreeSelection> selection = named_selection_display.get_selection();
+ TreeView::Selection::ListHandle_Path rows = selection->get_selected_rows ();
+
+ if (selection->count_selected_rows() == 0) {
+ return;
+ }
+
+ for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin(); i != rows.end(); ++i) {
+
+ TreeIter iter;
+ if ((iter = named_selection_model->get_iter (*i))) {
+ session->remove_named_selection ((*iter)[named_selection_columns.selection]);
+ }
+ }
+}
+
+bool
+Editor::named_selection_display_button_release (GdkEventButton *ev)
+{
TreeModel::Children rows = named_selection_model->children();
TreeModel::Children::iterator i;
Glib::RefPtr<TreeSelection> selection = named_selection_display.get_selection();
}
}
}
- return FALSE;
+
+ return false;
}
}
void
-Editor::name_selection ()
+Editor::create_named_selection ()
{
- ArdourPrompter p;
-
- p.set_prompt (_("Name for Chunk:"));
- p.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
- p.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
- p.change_labels (_("Create Chunk"), _("Forget it"));
- p.show_all ();
-
- switch (p.run ()) {
- case Gtk::RESPONSE_ACCEPT:
- string name;
- p.get_result (name);
- if (name.length()) {
- create_named_selection (name);
- }
- break;
- }
+ string name;
-}
-
-void
-Editor::named_selection_name_chosen ()
-{
- Gtk::Main::quit ();
-}
-
-void
-Editor::create_named_selection (const string & name)
-{
if (session == 0) {
return;
}
if (selection->time.empty()) {
return;
}
-
TrackViewList *views = get_valid_views (selection->time.track, selection->time.group);
boost::shared_ptr<Playlist> pl = (*i)->playlist();
- if (pl) {
-
- if ((what_we_found = pl->copy (selection->time, false)) != 0) {
-
- thelist.push_back (what_we_found);
- }
+ if (pl && (what_we_found = pl->copy (selection->time, false)) != 0) {
+ thelist.push_back (what_we_found);
}
}
- NamedSelection* ns;
- TreeModel::Row row = *(named_selection_model->append());
-
- ns = new NamedSelection (name, thelist);
- row[named_selection_columns.selection] = ns;
- row[named_selection_columns.text] = name;
+ if (!thelist.empty()) {
- /* make the one we just added be selected */
+ ArdourPrompter p;
+
+ p.set_prompt (_("Name for Chunk:"));
+ p.add_button (Gtk::Stock::NEW, Gtk::RESPONSE_ACCEPT);
+ p.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
+ p.change_labels (_("Create Chunk"), _("Forget it"));
+ p.show_all ();
+
+ switch (p.run ()) {
+
+ case Gtk::RESPONSE_ACCEPT:
+ p.get_result (name);
+ if (name.empty()) {
+ return;
+ }
+ break;
+ default:
+ return;
+ }
- named_selection_display.get_selection()->select (row);
+ new NamedSelection (name, thelist); // creation will add it to the model
+ /* make the one we just added be selected */
+
+ TreeModel::Children::iterator added = named_selection_model->children().end();
+ --added;
+ named_selection_display.get_selection()->select (*added);
+ } else {
+ error << _("No selectable material found in the currently selected time range") << endmsg;
+ }
}
bool
PlaylistSelector::on_unmap_event (GdkEventAny* ev)
{
- cerr << "PLselector unmapped\n";
clear_map ();
if (model) {
model->clear ();
RadioMenuItem::Group rc_group;
CheckMenuItem* rc_active;
- uint32_t limit = _session.ntracks();
+ uint32_t limit = _session.ntracks() + _session.nbusses();
char buf[32];
MenuList& rc_items = remote_control_menu->items();
xfade_length = min ((nframes_t) 720, top->length());
xfade = boost::shared_ptr<Crossfade> (new Crossfade (top, bottom, xfade_length, top->first_frame(), StartOfIn));
+ cerr << "StartOfIn is " << xfade << endl;
add_crossfade (xfade);
if (top_region_at (top->last_frame() - 1) == top) {
*/
xfade = boost::shared_ptr<Crossfade> (new Crossfade (bottom, top, xfade_length, top->last_frame() - xfade_length, EndOfOut));
+ cerr << "EndofOut is " << xfade << endl;
add_crossfade (xfade);
}
break;
_position = position;
_anchor_point = ap;
- switch (Config->get_xfade_model()) {
- case ShortCrossfade:
- _follow_overlap = false;
- break;
- default:
- _follow_overlap = true;
- }
+ _follow_overlap = false;
+
+ cerr << "A: follow overlap = " << _follow_overlap << endl;
_active = Config->get_xfades_active ();
_fixed = true;
initialize ();
+ cerr << "K: follow overlap = " << _follow_overlap << endl;
}
Crossfade::Crossfade (const Playlist& playlist, XMLNode& node)
if (set_state (node)) {
throw failed_constructor();
}
+
+ cerr << "D: follow overlap = " << _follow_overlap << endl;
+
}
Crossfade::Crossfade (const Crossfade &orig, boost::shared_ptr<AudioRegion> newin, boost::shared_ptr<AudioRegion> newout)
// Let's make sure the fade isn't too long
set_length(_length);
+
+ cerr << "B: follow overlap = " << _follow_overlap << endl;
+
}
Crossfade::~Crossfade ()
{
- cerr << "Crossfade deleted\n";
+ cerr << this << " Crossfade deleted\n";
notify_callbacks ();
}
if (top->first_frame() == bottom->first_frame()) {
- cerr << "same start\n";
-
/* Both regions start at the same point */
if (top->last_frame() < bottom->last_frame()) {
} else if (top->last_frame() == bottom->last_frame()) {
- cerr << "same end\n";
-
/* Both regions end at the same point */
if (top->first_frame() > bottom->first_frame()) {
OverlapType ot = top->coverage (bottom->first_frame(), bottom->last_frame());
- cerr << "ot = " << ot << endl;
-
switch (ot) {
case OverlapNone:
/* should be NOTREACHED as a precondition of creating
a new crossfade, but we need to handle it here.
*/
- cerr << "no sir\n";
throw NoCrossfadeHere();
break;
case OverlapInternal:
case OverlapExternal:
/* should be NOTREACHED because of tests above */
- cerr << "nu-uh\n";
throw NoCrossfadeHere();
break;
return false;
}
- if (_in->layer() < _out->layer()) {
- cerr << "layer change, invalidated\n";
- Invalidated (shared_from_this());
- return false;
- }
+// if (_in->layer() < _out->layer()) {
+// cerr << this << " layer change, invalidated, in on " << _in->layer() << " out on " << _out->layer() << endl;
+// Invalidated (shared_from_this());
+// return false;
+// }
/* overlap type must be Start, End or External */
ot = _in->coverage (_out->first_frame(), _out->last_frame());
- switch (ot) {
- case OverlapNone:
- case OverlapInternal:
- Invalidated (shared_from_this());
- return false;
-
- default:
- break;
- }
-
/* overlap type must not have altered */
if (ot != overlap_type) {
+ cerr << this << " Invalid B\n";
Invalidated (shared_from_this());
return false;
}
{
nframes_t newlen;
+ cerr << this << " update, " << _in->name() << " + " << _out->name() << " length = " << _length << endl;
+
if (_follow_overlap) {
newlen = _out->first_frame() + _out->length() - _in->first_frame();
+ cerr << "\tmodify length\n";
} else {
newlen = _length;
}
if (newlen == 0) {
+ cerr << this << " Invalid C\n";
Invalidated (shared_from_this());
return false;
}
}
+ cerr << "\tFover = " << _follow_overlap << endl;
+
switch (_anchor_point) {
case StartOfIn:
- if (_position != _in->first_frame()) {
- if (_length > _short_xfade_length) {
- /* assume FullCrossfade */
- _position = _in->first_frame();
- } else {
- /* assume short xfade */
- _position = _out->last_frame() - _length;
- }
- }
+ _position = _in->first_frame();
break;
case EndOfIn:
- if (_position != _in->last_frame() - _length) {
- _position = _in->last_frame() - _length;
- }
+ _position = _in->last_frame() - _length;
break;
case EndOfOut:
- if (_position != _out->last_frame() - _length) {
- _position = _out->last_frame() - _length;
- }
+ _position = _out->last_frame() - _length;
}
/* UI's may need to know that the overlap changed even
{
playlists = l;
for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
+ string new_name;
+
+ /* rename playlists to reflect our ownership */
+
+ new_name = name;
+ new_name += '/';
+ new_name += (*i)->name();
+
+ (*i)->set_name (new_name);
(*i)->use();
}
+
NamedSelectionCreated (this);
}
NamedSelection::~NamedSelection ()
{
for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- (*i)->release();
+ (*i)->release ();
+ (*i)->GoingAway ();
}
}
}
}
-
void
Playlist::copy_regions (RegionList& newlist) const
{
}
}
- if (control_out_channels) {
- shared_ptr<Route> r (new Route (*this, _("monitor"), -1, control_out_channels, -1, control_out_channels, Route::ControlOut));
- RouteList rl;
- rl.push_back (r);
- add_routes (rl);
- _control_out = r;
- }
-
- if (master_out_channels) {
- shared_ptr<Route> r (new Route (*this, _("master"), -1, master_out_channels, -1, master_out_channels, Route::MasterOut));
+ {
+ /* set up Master Out and Control Out if necessary */
+
RouteList rl;
- rl.push_back (r);
- add_routes (rl);
- _master_out = r;
- } else {
- /* prohibit auto-connect to master, because there isn't one */
- output_ac = AutoConnectOption (output_ac & ~AutoConnectMaster);
+ int control_id = 1;
+
+ if (control_out_channels) {
+ shared_ptr<Route> r (new Route (*this, _("monitor"), -1, control_out_channels, -1, control_out_channels, Route::ControlOut));
+ r->set_remote_control_id (control_id++);
+
+ rl.push_back (r);
+ }
+
+ if (master_out_channels) {
+ shared_ptr<Route> r (new Route (*this, _("master"), -1, master_out_channels, -1, master_out_channels, Route::MasterOut));
+ r->set_remote_control_id (control_id);
+ cerr << "master bus has remote control ID " << r->remote_control_id() << endl;
+
+ rl.push_back (r);
+ } else {
+ /* prohibit auto-connect to master, because there isn't one */
+ output_ac = AutoConnectOption (output_ac & ~AutoConnectMaster);
+ }
+
+ if (!rl.empty()) {
+ add_routes (rl);
+ }
+
}
Config->set_input_auto_connect (input_ac);
_engine.get_physical_outputs (physoutputs);
_engine.get_physical_inputs (physinputs);
- control_id = 0;
+ control_id = ntracks() + nbusses() + 1;
while (how_many) {
}
track->DiskstreamChanged.connect (mem_fun (this, &Session::resort_routes));
- track->set_remote_control_id (ntracks() + control_id + 1);
+ track->set_remote_control_id (control_id);
++control_id;
new_routes.push_back (track);
uint32_t n = 0;
string port;
RouteList ret;
+ uint32_t control_id;
/* count existing audio busses */
_engine.get_physical_outputs (physoutputs);
_engine.get_physical_inputs (physinputs);
+ control_id = ntracks() + nbusses() + 1;
while (how_many) {
bus->set_control_outs (cports);
}
+ bus->set_remote_control_id (control_id);
+ ++control_id;
+
ret.push_back (bus);
}
named_selections.insert (named_selections.begin(), named_selection);
}
+ for (list<boost::shared_ptr<Playlist> >::iterator i = named_selection->playlists.begin(); i != named_selection->playlists.end(); ++i) {
+ add_playlist (*i);
+ }
+
set_dirty();
- NamedSelectionAdded (); /* EMIT SIGNAL */
+ NamedSelectionAdded (); /* EMIT SIGNAL */
}
void