torbenh's buffer manager fixes from 3.0P
[ardour.git] / libs / ardour / mute_master.cc
index db4b6ca178a4264972241555b091e38de36ed03b..45499696a96b7dbacc611f63d06faf43cbd886bd 100644 (file)
@@ -1,6 +1,6 @@
 /*
 
-    Copyright (C) 2009 Paul Davis 
+    Copyright (C) 2009 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -19,7 +19,9 @@
 */
 
 #include "pbd/enumwriter.h"
+#include "pbd/xml++.h"
 
+#include "ardour/types.h"
 #include "ardour/mute_master.h"
 #include "ardour/rc_configuration.h"
 
 
 using namespace ARDOUR;
 
-MuteMaster::MuteMaster (Session& s, const std::string& name)
-       : AutomationControl (s, Evoral::Parameter (MuteAutomation), boost::shared_ptr<AutomationList>(), name)
-       , _mute_point (MutePoint (0))
-{
-       // default range for parameter is fine
+const MuteMaster::MutePoint MuteMaster::AllPoints = MutePoint (MuteMaster::PreFader|
+                                                              MuteMaster::PostFader|
+                                                              MuteMaster::Listen|
+                                                              MuteMaster::Main);
 
-       _automation = new AutomationList (MuteAutomation);
-       set_list (boost::shared_ptr<AutomationList>(_automation));
+MuteMaster::MuteMaster (Session&, const std::string&)
+       : _mute_point (MutePoint (0))
+{
 }
 
 void
@@ -64,18 +66,6 @@ MuteMaster::unmute_at (MutePoint mp)
        }
 }
 
-void
-MuteMaster::mute (bool yn)
-{
-       /* convenience wrapper around AutomationControl method */
-
-       if (yn) {
-               set_value ((float) 0xffff);
-       } else {
-               set_value (0.0f);
-       }
-}
-
 gain_t
 MuteMaster::mute_gain_at (MutePoint mp) const
 {
@@ -86,24 +76,16 @@ MuteMaster::mute_gain_at (MutePoint mp) const
        }
 }
 
-void
-MuteMaster::set_value (float f)
+int
+MuteMaster::set_state (std::string mute_point)
 {
-       MutePoint old = _mute_point;
-       _mute_point = (MutePoint) (rint (f));
-       if (old != _mute_point) {
-               MutePointChanged (); // EMIT SIGNAL
-       }
-}
+       _mute_point = (MutePoint) string_2_enum (mute_point, _mute_point);
 
-float
-MuteMaster::get_value () const
-{
-       return (float) _mute_point;
+       return 0;
 }
 
 int
-MuteMaster::set_state (const XMLNode& node)
+MuteMaster::set_state (const XMLNode& node, int /*version*/)
 {
        const XMLProperty* prop;