View Issue Details

IDProjectCategoryView StatusLast Update
0002604ardourbugspublic2010-04-24 10:33
Reporteroofus Assigned Tocth103  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformDell D830 core2duo T9300 2.5GHzOSMandrivaOS Version2009.0
Product VersionSVN/2.0-ongoing 
Summary0002604: Master record button shows bright red when the transport is in play but no tracks are record armed.
DescriptionMaster record button shows bright red when the transport is in play but no tracks are record armed.

It should only show bright red when something is really being recorded ie there are tracks also in record arm. If no tracks are record armed it should remain pink (salmon!).
TagsNo tags attached.

Activities

2009-04-28 09:09

 

pink.patch (3,254 bytes)   
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 8385884..d9be4ac 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -1957,23 +1957,20 @@ ARDOUR_UI::transport_rec_enable_blink (bool onoff)
 	if (session == 0) {
 		return;
 	}
+
+	Session::RecordState const r = session->record_status ();
+	bool const h = session->have_rec_enabled_diskstream ();
 	
-	switch (session->record_status()) {
-	case Session::Enabled:
+	if (r == Session::Enabled || (r == Session::Recording && !h)) {
 		if (onoff) {
 			rec_button.set_visual_state (2);
 		} else {
 			rec_button.set_visual_state (0);
 		}
-		break;
-
-	case Session::Recording:
+	} else if (r == Session::Recording && h) {
 		rec_button.set_visual_state (1);
-		break;
-
-	default:
+	} else {
 		rec_button.set_visual_state (0);
-		break;
 	}
 }
 
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index c2e7e23..0001b30 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -292,6 +292,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
 	void add_diskstream (boost::shared_ptr<Diskstream>);
 	boost::shared_ptr<Diskstream> diskstream_by_id (const PBD::ID& id);
 	boost::shared_ptr<Diskstream> diskstream_by_name (string name);
+	bool have_rec_enabled_diskstream () const;
 
 	bool have_captured() const { return _have_captured; }
 
@@ -1741,6 +1742,9 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
 	SessionMetadata * _metadata;
 
 	mutable bool have_looped; ///< Used in ::audible_frame(*)
+
+	void update_have_rec_enabled_diskstream ();
+	gint _have_rec_enabled_diskstream;
 };
 
 } // namespace ARDOUR
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index e2e38a1..12959db 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -140,7 +140,8 @@ Session::Session (AudioEngine &eng,
 	  click_data (0),
 	  click_emphasis_data (0),
 	  main_outs (0),
-	  _metadata (new SessionMetadata())
+	  _metadata (new SessionMetadata()),
+	  _have_rec_enabled_diskstream (false)
 
 {
 	bool new_session;
@@ -223,7 +224,8 @@ Session::Session (AudioEngine &eng,
 	  click_data (0),
 	  click_emphasis_data (0),
 	  main_outs (0),
-	  _metadata (new SessionMetadata())
+	  _metadata (new SessionMetadata()),
+	  _have_rec_enabled_diskstream (false)
 {
 	bool new_session;
 
@@ -2141,6 +2143,8 @@ Session::add_diskstream (boost::shared_ptr<Diskstream> dstream)
 	/* this will connect to future changes, and check the current length */
 	diskstream_playlist_changed (dstream);
 
+	dstream->RecordEnableChanged.connect (mem_fun (*this, &Session::update_have_rec_enabled_diskstream));
+
 	dstream->prepare ();
 
 }
@@ -4311,3 +4315,20 @@ Session::sync_order_keys (const char* base)
 }
 
 
+bool
+Session::have_rec_enabled_diskstream () const
+{
+	return g_atomic_int_get (&_have_rec_enabled_diskstream) == 1;
+}
+
+void
+Session::update_have_rec_enabled_diskstream ()
+{
+	boost::shared_ptr<DiskstreamList> dsl = diskstreams.reader ();
+	DiskstreamList::iterator i = dsl->begin ();
+	while (i != dsl->end () && (*i)->record_enabled () == false) {
+		++i;
+	}
+
+	g_atomic_int_set (&_have_rec_enabled_diskstream, i != dsl->end () ? 1 : 0);
+}
pink.patch (3,254 bytes)   

cth103

2009-04-28 09:10

administrator   ~0005925

As discussed on IRC, with the attached patch the master record button should only go solid (non-blinking) if there are record-armed tracks and the transport is rolling.

oofus

2009-04-29 13:28

developer   ~0005941

Patch tested. Appears to work fine. Only issue is 'big clock' colours don't quite follow correctly. 'Big Clock' doesn't need to be pink or flashing, but should only be red when the master record button is red, ie when audio really is being commited to disk.

cth103

2009-04-29 17:30

administrator   ~0005947

Committed to SVN 3.0, with modifications to make the big clock colour follow record status similarly.

oofus

2009-10-29 23:42

developer   ~0006975

fixed in 3.x. Still not right in 2.x

Issue History

Date Modified Username Field Change
2009-03-28 22:56 oofus New Issue
2009-04-28 09:09 cth103 File Added: pink.patch
2009-04-28 09:10 cth103 Note Added: 0005925
2009-04-28 09:10 cth103 Status new => feedback
2009-04-29 13:28 oofus Note Added: 0005941
2009-04-29 17:30 cth103 cost => 0.00
2009-04-29 17:30 cth103 Note Added: 0005947
2009-04-29 17:30 cth103 Status feedback => resolved
2009-04-29 17:30 cth103 Fixed in Version => SVN 3.0
2009-04-29 17:30 cth103 Resolution open => fixed
2009-04-29 17:30 cth103 Assigned To => cth103
2009-10-29 23:41 oofus Status resolved => feedback
2009-10-29 23:41 oofus Resolution fixed => reopened
2009-10-29 23:42 oofus Note Added: 0006975
2009-10-29 23:42 oofus Status feedback => closed
2009-10-29 23:42 oofus Resolution reopened => fixed
2010-04-24 10:28 cth103 Category bugs => bugs2
2010-04-24 10:33 cth103 Category bugs2 => bugs