controls_table.attach (size_button, 2, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
controls_table.attach (automation_button, 3, 4, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
- if (is_audio_track()) {
+ if (is_audio_track() && audio_track()->mode() == ARDOUR::Normal) {
controls_table.attach (playlist_button, 5, 6, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
-
}
/* remove focus from the buttons */
using namespace Menu_Helpers;
MenuList& items = edit_group_menu.items ();
+ RadioMenuItem::Group group;
items.clear ();
- items.push_back (RadioMenuElem (edit_group_menu_radio_group, _("No group"),
- bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
+ items.push_back (RadioMenuElem (group, _("No group"),
+ bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
if (_route.edit_group() == 0) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
-
- _session.foreach_edit_group (this, &AudioTimeAxisView::add_edit_group_menu_item);
+
+ _session.foreach_edit_group (bind (mem_fun (*this, &AudioTimeAxisView::add_edit_group_menu_item), &group));
edit_group_menu.popup (ev->button, ev->time);
return FALSE;
}
void
-AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg)
+AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg, RadioMenuItem::Group* group)
{
using namespace Menu_Helpers;
MenuList &items = edit_group_menu.items();
- items.push_back (RadioMenuElem (edit_group_menu_radio_group,
- eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
+
+ items.push_back (RadioMenuElem (*group, eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
if (_route.edit_group() == eg) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
AudioPlaylist *pl;
DiskStream *ds;
- /* 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)) {
+ if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
return;
}
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)) {
+ if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
return;
}
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)) {
+
+ if (((ds = get_diskstream()) == 0) || ds->destructive() || ((pl = ds->playlist()) == 0)) {
return;
}
virtual void label_view ();
Gtk::Menu edit_group_menu;
- Gtk::RadioMenuItem::Group edit_group_menu_radio_group;
- void add_edit_group_menu_item (ARDOUR::RouteGroup *);
+ void add_edit_group_menu_item (ARDOUR::RouteGroup *, Gtk::RadioMenuItem::Group*);
void set_edit_group_from_menu (ARDOUR::RouteGroup *);
void reset_samples_per_unit ();
session_connections.push_back (session->tempo_map().StateChanged.connect (mem_fun(*this, &Editor::tempo_map_changed)));
- session->foreach_edit_group(this, &Editor::add_edit_group);
+ session->foreach_edit_group (mem_fun (*this, &Editor::add_edit_group));
edit_cursor_clock.set_session (session);
selection_start_clock.set_session (session);
}
void
-MixerStrip::add_mix_group_to_menu (RouteGroup *rg)
+MixerStrip::add_mix_group_to_menu (RouteGroup *rg, RadioMenuItem::Group* group)
{
using namespace Menu_Helpers;
MenuList& items = group_menu->items();
- items.push_back (MenuElem (rg->name(), bind (mem_fun(*this, &MixerStrip::set_mix_group), rg)));
+ items.push_back (RadioMenuElem (*group, rg->name(), bind (mem_fun(*this, &MixerStrip::set_mix_group), rg)));
}
gint
group_menu = new Menu;
group_menu->set_name ("ArdourContextMenu");
MenuList& items = group_menu->items();
+ RadioMenuItem::Group group;
+
+ items.push_back (RadioMenuElem (group, _("no group"), bind (mem_fun(*this, &MixerStrip::set_mix_group), (RouteGroup *) 0)));
- items.push_back (MenuElem (_("no group"), bind (mem_fun(*this, &MixerStrip::set_mix_group), (RouteGroup *) 0)));
- _session.foreach_mix_group (this, &MixerStrip::add_mix_group_to_menu);
+ _session.foreach_mix_group (bind (mem_fun (*this, &MixerStrip::add_mix_group_to_menu), &group));
group_menu->popup (ev->button, 0);
return stop_signal (group_button, "button_press_event");
bool ignore_comment_edit;
void set_mix_group (ARDOUR::RouteGroup *);
- void add_mix_group_to_menu (ARDOUR::RouteGroup *);
+ void add_mix_group_to_menu (ARDOUR::RouteGroup *, Gtk::RadioMenuItem::Group*);
gint select_mix_group (GdkEventButton *);
void mix_group_changed (void *);
session->RouteAdded.connect (mem_fun(*this, &Mixer_UI::add_strip));
session->mix_group_added.connect (mem_fun(*this, &Mixer_UI::add_mix_group));
- session->foreach_mix_group(this, &Mixer_UI::add_mix_group);
+ session->foreach_mix_group (mem_fun (*this, &Mixer_UI::add_mix_group));
_plugin_selector->set_session (session);
ENSURE_GUI_THREAD (bind (mem_fun(*this, &TapeAudioRegionView::update), n));
- cerr << "peaks ready for channel " << n << endl;
-
- cerr << "tmp waves size = " << tmp_waves.size() << " waves size = " << waves.size() << endl;
-
- for (uint32_t x = 0; x < waves.size(); ++x) {
- cerr << "waves[" << x << "] = " << waves[x] << endl;
- }
-
- for (vector<WaveView*>::iterator i = waves.begin(); i != waves.end(); ++i) {
- cerr << "iterator[" << distance (i, waves.begin()) << "] = " << (*i) << endl;
- }
-
/* this triggers a cache invalidation and redraw in the waveview */
waves[n]->property_data_src() = ®ion;
sigc::signal<void,RouteGroup*> edit_group_added;
sigc::signal<void,RouteGroup*> mix_group_added;
- template<class T> void foreach_edit_group (T *obj, void (T::*func)(RouteGroup *)) {
- list<RouteGroup *>::iterator i;
- for (i = edit_groups.begin(); i != edit_groups.end(); i++) {
- (obj->*func)(*i);
+ void foreach_edit_group (sigc::slot<void,RouteGroup*> sl) {
+ for (list<RouteGroup *>::iterator i = edit_groups.begin(); i != edit_groups.end(); i++) {
+ sl (*i);
}
}
- template<class T> void foreach_mix_group (T *obj, void (T::*func)(RouteGroup *)) {
- list<RouteGroup *>::iterator i;
- for (i = mix_groups.begin(); i != mix_groups.end(); i++) {
- (obj->*func)(*i);
+ void foreach_mix_group (sigc::slot<void,RouteGroup*> sl) {
+ for (list<RouteGroup *>::iterator i = mix_groups.begin(); i != mix_groups.end(); i++) {
+ sl (*i);
}
}
if (mode == Destructive) {
dflags = DiskStream::Flag (dflags | DiskStream::Destructive);
- cerr << "Creating a new audio track, destructive mode\n";
- } else {
- cerr << "Creating a new audio track, NOT destructive mode\n";
}
DiskStream* ds = new DiskStream (_session, name, dflags);
string newname;
AudioPlaylist* playlist;
+ if (!in_set_state && destructive()) {
+ return 0;
+ }
+
if (_playlist) {
newname = Playlist::bump_name (_playlist->name(), _session);
} else {
int
DiskStream::use_copy_playlist ()
{
+ if (destructive()) {
+ return 0;
+ }
+
if (_playlist == 0) {
error << string_compose(_("DiskStream %1: there is no existing playlist to make a copy of!"), _name) << endmsg;
return -1;
}
if (_flags & Recordable) {
- cerr << "START RECORD @ " << capture_start_frame << endl;
-
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
RingBufferNPT<CaptureTransition>::rw_vector transvec;
}
else {
// bad!
- cerr << "capture_transition_buf is full on rec start! inconceivable!" << endl;
+ fatal << X_("programming error: capture_transition_buf is full on rec start! inconceivable!")
+ << endmsg;
}
}
}
if (captrans.type == CaptureStart) {
// by definition, the first data we got above represents the given capture pos
- cerr << "DS " << name() << " got CaptureStart at " << captrans.capture_val << endl;
(*chan).write_source->mark_capture_start (captrans.capture_val);
-
(*chan).curr_capture_cnt = 0;
have_start = true;
if (captrans.capture_val <= (*chan).curr_capture_cnt + to_write) {
- cerr << "DS " << name() << " got CaptureEnd with " << captrans.capture_val << endl;
// shorten to make the write a perfect fit
uint32_t nto_write = (captrans.capture_val - (*chan).curr_capture_cnt);
- if (have_start) {
- // starts and ends within same chunk we're processing
- cerr << "Starts and ends within same chunk: adjusting to_write from: "
- << to_write << " to: " << nto_write << endl;
- }
- else {
- cerr << "Ends within chunk: adjusting to_write to: "
- << to_write << " to: " << nto_write << endl;
- }
if (nto_write < to_write) {
ret = 1; // should we?
}
else {
// actually ends just beyond this chunk, so force more work
- cerr << "DS " << name() << " got CaptureEnd beyond our chunk, cnt of: "
- << captrans.capture_val << " leaving on queue" << endl;
ret = 1;
break;
}
return;
}
- if ((_flags & Recordable) && destructive()) {
- cerr << "RECORD END @ " << capture_start_frame + capture_captured << endl;
+ if (recordable() && destructive()) {
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
RingBufferNPT<CaptureTransition>::rw_vector transvec;
char buf[64];
LocaleGuard lg (X_("POSIX"));
- if (destructive()) {
- node->add_property ("destructive", "true");
- }
-
snprintf (buf, sizeof(buf), "%zd", channels.size());
node->add_property ("channels", buf);
_name = prop->value();
}
- if ((prop = node.property ("destructive")) != 0) {
- if (prop->value() == "true") {
- _flags |= Destructive;
- }
- }
-
if (deprecated_io_node) {
if ((prop = deprecated_io_node->property ("id")) != 0) {
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
in_set_state = false;
- /* now that we're all done with playlist+channel set up,
- go ahead and create write sources.
- */
-
+ /* make sure this is clear before we do anything else */
capturing_sources.clear ();
- if (recordable() && !destructive()) {
- /* destructive diskstreams get their sources set up elsewhere */
- reset_write_sources (false);
- }
+ /* write sources are handled elsewhere;
+ for destructive tracks: in {setup,use}_destructive_playlist()
+ for non-destructive: when we handle the input set up of the IO that owns this DS
+ */
in_set_state = false;
return -1;
}
- cerr << _name << " using a new source " << chan.write_source << " for channel " << n << endl;
-
chan.write_source->use ();
return 0;