ardour
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
ARDOUR::ElementImporter Class Referenceabstract

Virtual interface class for element importers. More...

#include <element_importer.h>

Inheritance diagram for ARDOUR::ElementImporter:
ARDOUR::AudioPlaylistImporter ARDOUR::AudioRegionImporter ARDOUR::AudioTrackImporter ARDOUR::LocationImporter ARDOUR::TempoMapImporter

Public Member Functions

 ElementImporter (XMLTree const &source, ARDOUR::Session &session)
 
virtual ~ElementImporter ()
 
virtual std::string get_name () const
 
virtual std::string get_info () const =0
 
virtual ImportStatusget_import_status ()
 
bool prepare_move ()
 
void cancel_move ()
 
void move ()
 Moves the element to the taget session. More...
 
bool broken ()
 Check if element is broken. Cannot be moved if broken. More...
 

Static Public Attributes

static PBD::Signal2< std::pair
< bool, std::string >
, std::string, std::string > 
Rename
 Signal that requests for anew name. More...
 
static PBD::Signal1< bool,
std::string > 
Prompt
 Signal for ok/cancel prompting. More...
 

Protected Member Functions

virtual void _move ()=0
 
virtual bool _prepare_move ()=0
 
virtual void _cancel_move ()=0
 Cancel move. More...
 
bool queued ()
 Ture if the element has been prepared and queued for importing. More...
 
std::string timecode_to_string (Timecode::Time &time) const
 Converts timecode time to a string. More...
 
framecnt_t rate_convert_samples (framecnt_t samples) const
 Converts samples so that times match the sessions sample rate. More...
 
std::string rate_convert_samples (std::string const &samples) const
 Converts samples so that times match the sessions sample rate (for straight use in XML) More...
 
void set_broken ()
 Set element broken. More...
 

Protected Attributes

XMLTree const & source
 Source XML-tree. More...
 
ARDOUR::Sessionsession
 Target session. More...
 
std::string name
 Name of element. More...
 
framecnt_t sample_rate
 The sample rate of the session from which we are importing. More...
 

Private Attributes

bool _queued
 
bool _broken
 

Detailed Description

Virtual interface class for element importers.

Definition at line 38 of file element_importer.h.

Constructor & Destructor Documentation

ElementImporter::ElementImporter ( XMLTree const &  source,
ARDOUR::Session session 
)

Definition at line 38 of file element_importer.cc.

ElementImporter::~ElementImporter ( )
virtual

Definition at line 53 of file element_importer.cc.

Member Function Documentation

virtual void ARDOUR::ElementImporter::_cancel_move ( )
protectedpure virtual
virtual void ARDOUR::ElementImporter::_move ( )
protectedpure virtual

Moves the element to the taget session In addition to actually adding the element to the session changing ids, renaming files etc. should be taken care of.

Implemented in ARDOUR::AudioRegionImporter, ARDOUR::AudioPlaylistImporter, ARDOUR::AudioTrackImporter, ARDOUR::LocationImporter, and ARDOUR::TempoMapImporter.

virtual bool ARDOUR::ElementImporter::_prepare_move ( )
protectedpure virtual

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.

Returns
whether or not the element can be moved

Implemented in ARDOUR::AudioRegionImporter, ARDOUR::AudioPlaylistImporter, ARDOUR::AudioTrackImporter, ARDOUR::LocationImporter, and ARDOUR::TempoMapImporter.

bool ARDOUR::ElementImporter::broken ( )
inline

Check if element is broken. Cannot be moved if broken.

Definition at line 73 of file element_importer.h.

void ElementImporter::cancel_move ( )

Cancels moving of element If the element has been set to be moved, this cancels the move.

Definition at line 75 of file element_importer.cc.

virtual ImportStatus* ARDOUR::ElementImporter::get_import_status ( )
inlinevirtual

Gets import status, if applicable.

Reimplemented in ARDOUR::AudioRegionImporter.

Definition at line 56 of file element_importer.h.

virtual std::string ARDOUR::ElementImporter::get_info ( ) const
pure virtual

Gets a textual representation of the element

Returns
a textual representation on this specific element

Implemented in ARDOUR::AudioRegionImporter, ARDOUR::AudioPlaylistImporter, ARDOUR::AudioTrackImporter, ARDOUR::LocationImporter, and ARDOUR::TempoMapImporter.

virtual std::string ARDOUR::ElementImporter::get_name ( ) const
inlinevirtual

Returns the element name

Returns
the name of the element

Definition at line 48 of file element_importer.h.

void ElementImporter::move ( )

Moves the element to the taget session.

Definition at line 58 of file element_importer.cc.

bool ElementImporter::prepare_move ( )

Prepares to move element

Returns
whther or not the element could be prepared for moving

Definition at line 65 of file element_importer.cc.

bool ARDOUR::ElementImporter::queued ( )
inlineprotected

Ture if the element has been prepared and queued for importing.

Definition at line 107 of file element_importer.h.

framecnt_t ElementImporter::rate_convert_samples ( framecnt_t  samples) const
protected

Converts samples so that times match the sessions sample rate.

Definition at line 99 of file element_importer.cc.

std::string ARDOUR::ElementImporter::rate_convert_samples ( std::string const &  samples) const
protected

Converts samples so that times match the sessions sample rate (for straight use in XML)

void ARDOUR::ElementImporter::set_broken ( )
inlineprotected

Set element broken.

Definition at line 125 of file element_importer.h.

string ElementImporter::timecode_to_string ( Timecode::Time &  time) const
protected

Converts timecode time to a string.

Definition at line 82 of file element_importer.cc.

Member Data Documentation

bool ARDOUR::ElementImporter::_broken
private

Definition at line 129 of file element_importer.h.

bool ARDOUR::ElementImporter::_queued
private

Definition at line 128 of file element_importer.h.

std::string ARDOUR::ElementImporter::name
protected

Name of element.

Definition at line 110 of file element_importer.h.

Signal1< bool, string > ElementImporter::Prompt
static

Signal for ok/cancel prompting.

Definition at line 79 of file element_importer.h.

Signal2< std::pair< bool, string >, string, string > ElementImporter::Rename
static

Signal that requests for anew name.

Definition at line 76 of file element_importer.h.

framecnt_t ARDOUR::ElementImporter::sample_rate
protected

The sample rate of the session from which we are importing.

Definition at line 113 of file element_importer.h.

ARDOUR::Session& ARDOUR::ElementImporter::session
protected

Target session.

Definition at line 104 of file element_importer.h.

XMLTree const& ARDOUR::ElementImporter::source
protected

Source XML-tree.

Definition at line 101 of file element_importer.h.


The documentation for this class was generated from the following files: