along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
-#include <pbd/pthread_utils.h>
+#include "pbd/pthread_utils.h"
-#include <ardour/session.h>
-#include <ardour/location.h>
+#include "ardour/session.h"
+#include "ardour/location.h"
-#include <control_protocol/basic_ui.h>
+#include "control_protocol/basic_ui.h"
#include "i18n.h"
using namespace ARDOUR;
+using ARDOUR::nframes_t;
+
+sigc::signal<void,std::string,std::string> BasicUI::AccessAction;
BasicUI::BasicUI (Session& s)
: session (&s)
void
BasicUI::register_thread (std::string name)
{
- PBD::ThreadCreated (pthread_self(), name);
+ std::string pool_name = name;
+ pool_name += " events";
+
+ SessionEvent::create_per_thread_pool (pool_name, 64);
+}
+
+void
+BasicUI::access_action ( std::string action_path )
+{
+ int split_at = action_path.find( "/" );
+ std::string group = action_path.substr( 0, split_at );
+ std::string item = action_path.substr( split_at + 1 );
+
+ AccessAction( group, item );
}
void
BasicUI::loop_toggle ()
{
- if (Config->get_auto_loop()) {
+ if (session->get_play_loop()) {
session->request_play_loop (false);
} else {
session->request_play_loop (true);
{
bool rolling = session->transport_rolling ();
- if (Config->get_auto_loop()) {
+ if (session->get_play_loop()) {
session->request_play_loop (false);
}
}
void
-BasicUI::set_transport_speed (float speed)
+BasicUI::set_transport_speed (double speed)
{
session->request_transport_speed (speed);
}
-float
+double
BasicUI::get_transport_speed ()
{
return session->transport_speed ();
BasicUI::toggle_all_rec_enables ()
{
if (session->get_record_enabled()) {
- session->record_disenable_all ();
+ // session->record_disenable_all ();
} else {
- session->record_enable_all ();
+ // session->record_enable_all ();
}
}
void
BasicUI::toggle_punch_in ()
{
- Config->set_punch_in (!Config->get_punch_in());
+ session->config.set_punch_in (!session->config.get_punch_in());
}
void
BasicUI::toggle_punch_out ()
{
- Config->set_punch_out (!Config->get_punch_out());
+ session->config.set_punch_out (!session->config.get_punch_out());
}
bool
}
nframes_t
-BasicUI::smpte_frames_per_hour ()
+BasicUI::timecode_frames_per_hour ()
{
- return session->smpte_frames_per_hour ();
+ return session->timecode_frames_per_hour ();
}
void
-BasicUI::smpte_time (nframes_t where, SMPTE::Time& smpte)
+BasicUI::timecode_time (nframes_t where, Timecode::Time& timecode)
{
- session->smpte_time (where, *((SMPTE::Time *) &smpte));
+ session->timecode_time (where, *((Timecode::Time *) &timecode));
}
void
-BasicUI::smpte_to_sample (SMPTE::Time& smpte, nframes_t& sample, bool use_offset, bool use_subframes) const
+BasicUI::timecode_to_sample (Timecode::Time& timecode, nframes_t& sample, bool use_offset, bool use_subframes) const
{
- session->smpte_to_sample (*((SMPTE::Time*)&smpte), sample, use_offset, use_subframes);
+ session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes);
}
void
-BasicUI::sample_to_smpte (nframes_t sample, SMPTE::Time& smpte, bool use_offset, bool use_subframes) const
+BasicUI::sample_to_timecode (nframes_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const
{
- session->sample_to_smpte (sample, *((SMPTE::Time*)&smpte), use_offset, use_subframes);
+ session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes);
}