X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Felement_importer.h;h=8ffa3b90ba4f3e088b5528434c34066a6057248c;hb=f25d9b122046d9ccf81108afc2fb466a32f9cbcc;hp=4a69565838ffabd88b26c04b5f85c796df1b5e36;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/libs/ardour/ardour/element_importer.h b/libs/ardour/ardour/element_importer.h index 4a69565838..8ffa3b90ba 100644 --- a/libs/ardour/ardour/element_importer.h +++ b/libs/ardour/ardour/element_importer.h @@ -24,14 +24,15 @@ #include #include -#include - +#include "pbd/signals.h" #include "ardour/types.h" -#include "ardour/session.h" class XMLTree; namespace ARDOUR { +class Session; +class ImportStatus; + /// Virtual interface class for element importers class ElementImporter { @@ -39,43 +40,43 @@ class ElementImporter ElementImporter (XMLTree const & source, ARDOUR::Session & session); virtual ~ElementImporter (); - + /** Returns the element name * @return the name of the element */ virtual std::string get_name () const { return name; }; - + /** Gets a textual representation of the element * @return a textual representation on this specific element */ virtual std::string get_info () const = 0; - + /** Gets import status, if applicable. */ - virtual Session::ImportStatus * get_import_status () { return 0; } - + virtual ImportStatus * get_import_status () { return 0; } + /** Prepares to move element * * @return whther or not the element could be prepared for moving */ bool prepare_move (); - + /** Cancels moving of element * If the element has been set to be moved, this cancels the move. */ void cancel_move (); - + /// Moves the element to the taget session void move (); - + /// Check if element is broken. Cannot be moved if broken. bool broken () { return _broken; } - + /// Signal that requests for anew name - static sigc::signal , std::string, std::string> Rename; - + static PBD::Signal2,std::string, std::string> Rename; + /// Signal for ok/cancel prompting - static sigc::signal Prompt; - + static PBD::Signal1 Prompt; + protected: /** Moves the element to the taget session @@ -84,44 +85,44 @@ class ElementImporter */ virtual void _move () = 0; - /** Should take care of all tasks that need to be done + /** Should take care of all tasks that need to be done * before moving the element. This includes prompting * the user for more information if necessary. * * @return whether or not the element can be moved */ virtual bool _prepare_move () = 0; - - /// Cancel move + + /// Cancel move virtual void _cancel_move () = 0; /// Source XML-tree XMLTree const & source; - + /// Target session ARDOUR::Session & session; - + /// Ture if the element has been prepared and queued for importing bool queued () { return _queued; } - + /// Name of element std::string name; - + /// The sample rate of the session from which we are importing nframes_t sample_rate; - - /// Converts smpte time to a string - std::string smpte_to_string (SMPTE::Time & time) const; - + + /// Converts timecode time to a string + std::string timecode_to_string (Timecode::Time & time) const; + /// Converts samples so that times match the sessions sample rate nframes_t rate_convert_samples (nframes_t samples) const; - + /// Converts samples so that times match the sessions sample rate (for straight use in XML) std::string rate_convert_samples (std::string const & samples) const; - + /// Set element broken void set_broken () { _broken = true; } - + private: bool _queued; bool _broken;