MLT 7.42.0
Multimedia Framework
Public Member Functions | Static Public Member Functions | Private Attributes
Mlt::Playlist Class Reference

C++ wrapper for mlt_playlist — a sequential list of clips. More...

#include <MltPlaylist.h>

Inheritance diagram for Mlt::Playlist:
Inheritance graph
[legend]
Collaboration diagram for Mlt::Playlist:
Collaboration graph
[legend]

Public Member Functions

int append (Producer &producer, int in=-1, int out=-1)
 Append producer (optionally trimmed to [in, out]) to the end.
 
int blank (const char *length)
 Append a blank of the given timecode length.
 
int blank (int out)
 Append a blank of out + 1 frames.
 
int blanks_from (int clip, int bounded=0)
 
int clear ()
 Remove all entries from the playlist.
 
int clip (mlt_whence whence, int index)
 
ClipInfo * clip_info (int index, ClipInfo *info=NULL)
 Return metadata for the clip at index.
 
int clip_length (int clip)
 
int clip_start (int clip)
 Return the start frame of clip clip in the timeline.
 
void consolidate_blanks (int keep_length=0)
 Merge adjacent blanks; if keep_length is 0, trim trailing blanks.
 
int count ()
 Return the number of entries (clips and blanks).
 
Producer * current ()
 Return the currently playing producer.
 
int current_clip ()
 Return the index of the currently playing clip.
 
Producer * get_clip (int clip)
 Return the producer for clip clip.
 
Producer * get_clip_at (int position)
 Return the producer at absolute timeline frame position.
 
int get_clip_index_at (int position)
 Return the clip index at absolute timeline frame position.
 
virtual mlt_playlist get_playlist ()
 
mlt_producer get_producer () override
 
int insert (Producer &producer, int where, int in=-1, int out=-1)
 Insert producer at position where, shifting later clips.
 
int insert_at (int position, Producer &producer, int mode=0)
 
int insert_at (int position, Producer *producer, int mode=0)
 Insert producer at absolute timeline position.
 
void insert_blank (int clip, int out)
 
bool is_blank (int clip)
 Return true if the clip at clip is a blank.
 
bool is_blank_at (int position)
 Return true if the absolute timeline position is in a blank.
 
bool is_mix (int clip)
 Return true if the clip at clip is a mix.
 
int join (int clip, int count=1, int merge=1)
 Join count clips starting at clip into one.
 
int mix (int clip, int length, Transition *transition=NULL)
 Create a mix (dissolve) of length frames at the clip boundary.
 
int mix_add (int clip, Transition *transition)
 Add a transition to an existing mix at clip.
 
int mix_in (int clip, int length)
 
int mix_out (int clip, int length)
 
int move (int from, int to)
 Move the clip at from to to.
 
void pad_blanks (int position, int length, int find=0)
 
 Playlist ()
 
 Playlist (mlt_playlist playlist)
 Wrap an existing mlt_playlist handle.
 
 Playlist (Playlist &playlist)
 
 Playlist (Profile &profile)
 
 Playlist (Service &playlist)
 
int remove (int where)
 Remove the clip at position where.
 
int remove_region (int position, int length)
 
int reorder (const int *indices)
 Reorder the playlist using an array of old indices.
 
int repeat (int clip, int count)
 Repeat the clip at clip count additional times.
 
Producer * replace_with_blank (int clip)
 Replace the clip at clip with a blank of the same length.
 
int resize_clip (int clip, int in, int out)
 Retrim the clip at clip to [in, out].
 
int split (int clip, int position)
 Split the clip at clip at frame position (relative to clip start).
 
int split_at (int position, bool left=true)
 Split at absolute timeline position.
 
virtual ~Playlist ()
 
- Public Member Functions inherited from Mlt::Producer
int clear ()
 
Producer * cut (int in=0, int out=-1)
 Create a cut (sub-range) producer sharing this producer's resource.
 
int frame ()
 Return the current absolute frame number.
 
char * frame_time (mlt_time_format=mlt_time_smpte_df)
 Return the current timecode string.
 
int64_t get_creation_time ()
 
double get_fps ()
 Return the frames-per-second rate for this producer's profile.
 
int get_in ()
 Return the in-point frame number.
 
int get_length ()
 Return the total length of the underlying resource in frames.
 
char * get_length_time (mlt_time_format=mlt_time_smpte_df)
 
int get_out ()
 Return the out-point frame number.
 
mlt_producer get_parent ()
 
int get_playtime ()
 Return the active play duration (out - in + 1).
 
mlt_service get_service () override
 
double get_speed ()
 Return the current playback speed.
 
bool is_blank ()
 Return true if this is a blank/gap clip.
 
bool is_cut ()
 Return true if this producer is a cut.
 
Producer & operator= (const Producer &producer)
 
void optimise ()
 
Producer & parent ()
 Return the parent producer (for cut producers, the shared root).
 
void pass_frame_properties (Frame &frame)
 Copy this producer's serializable meta.
 
int pause ()
 Pause playback (sets speed to 0).
 
int position ()
 Return the current position relative to in-point.
 
bool probe ()
 
 Producer ()
 
 Producer (const Producer &producer)
 
 Producer (mlt_producer producer)
 Wrap an existing mlt_producer handle.
 
 Producer (mlt_profile profile, const char *id, const char *service=NULL)
 
 Producer (Producer &producer)
 
 Producer (Producer *producer)
 
 Producer (Profile &profile, const char *id, const char *service=NULL)
 Construct and instantiate producer id from the repository.
 
 Producer (Service &producer)
 
bool runs_into (Producer &that)
 
bool same_clip (Producer &that)
 
int seek (const char *time)
 Seek to a timecode string (e.g.
 
int seek (int position)
 Seek to position (relative to in-point).
 
void set_creation_time (int64_t creation_time)
 
int set_in_and_out (int in, int out)
 Set the active in/out range in frame numbers.
 
int set_speed (double speed)
 Set the playback speed (1.0 = normal, 0.0 = paused, -1.0 = reverse).
 
virtual ~Producer ()
 
- Public Member Functions inherited from Mlt::Service
int attach (Filter &filter)
 Attach filter to this service.
 
int connect_producer (Service &producer, int index=0)
 Connect producer as the input at index.
 
Service * consumer ()
 Return the downstream consumer service, or null.
 
int detach (Filter &filter)
 Detach filter from this service.
 
int disconnect_all_producers ()
 Disconnect all producer inputs.
 
int disconnect_producer (int index=0)
 Disconnect the producer at index.
 
Filter * filter (int index)
 Return the attached filter at index.
 
int filter_count ()
 Return the number of attached filters.
 
Frame * get_frame (int index=0)
 Pull and return frame index from this service.
 
mlt_profile get_profile ()
 
virtual mlt_properties get_properties () override
 
int insert_producer (Service &producer, int index=0)
 Insert producer at index, shifting existing connections up.
 
void lock ()
 Acquire the service mutex (use around property reads in render threads).
 
int move_filter (int from, int to)
 Move the attached filter at position from to position to.
 
Service & operator= (const Service &service)
 
Service * producer ()
 Return the first upstream producer, or null.
 
Profile * profile ()
 Return the profile associated with this service.
 
 Service ()
 
 Service (const Service &service)
 
 Service (mlt_service service)
 Wrap an existing mlt_service handle.
 
 Service (Service &service)
 
 Service (Service *service)
 
void set_consumer (Service &service)
 
void set_profile (mlt_profile profile)
 
void set_profile (Profile &profile)
 
mlt_service_type type ()
 Return the service sub-type (producer, filter, consumer, transition, etc.).
 
void unlock ()
 Release the service mutex.
 
virtual ~Service ()
 
- Public Member Functions inherited from Mlt::Properties
char * anim_get (const char *name, int position, int length=0)
 
mlt_color anim_get_color (const char *name, int position, int length=0)
 
double anim_get_double (const char *name, int position, int length=0)
 
int anim_get_int (const char *name, int position, int length=0)
 
mlt_rect anim_get_rect (const char *name, int position, int length=0)
 
int anim_set (const char *name, const char *value, int position, int length=0)
 
int anim_set (const char *name, double value, int position, int length=0, mlt_keyframe_type keyframe_type=mlt_keyframe_linear)
 
int anim_set (const char *name, int value, int position, int length=0, mlt_keyframe_type keyframe_type=mlt_keyframe_linear)
 
int anim_set (const char *name, mlt_color value, int position, int length=0, mlt_keyframe_type keyframe_type=mlt_keyframe_linear)
 
int anim_set (const char *name, mlt_rect value, int position, int length=0, mlt_keyframe_type keyframe_type=mlt_keyframe_linear)
 
void block (void *object=NULL)
 Suppress event delivery to object.
 
void clear (const char *name)
 
int copy (Properties &that, const char *prefix)
 Copy all properties whose names begin with prefix from that.
 
int count ()
 Return the number of name/value pairs stored.
 
void debug (const char *title="Object", FILE *output=stderr)
 
int dec_ref ()
 
void dump (FILE *output=stderr)
 Write all properties to output as "name=value" lines.
 
int fire_event (const char *event)
 Fire a named event manually.
 
char * frames_to_time (int, mlt_time_format=mlt_time_smpte_df)
 
char * get (const char *name)
 Get a string property value by name.
 
char * get (int index)
 Return the property value at positional index as a string.
 
char * get (int index, mlt_time_format)
 Return the property value at positional index in the given time format.
 
Animation * get_anim (const char *name)
 
mlt_animation get_animation (const char *name)
 
mlt_color get_color (const char *name)
 
void * get_data (const char *name)
 
void * get_data (const char *name, int &size)
 Get opaque data stored by name; size receives the byte count.
 
void * get_data (int index, int &size)
 
double get_double (const char *name)
 Get a double property value by name.
 
int get_int (const char *name)
 Get an integer property value by name.
 
int64_t get_int64 (const char *name)
 Get a 64-bit integer property value by name.
 
const char * get_lcnumeric ()
 
char * get_name (int index)
 Return the property name at positional index.
 
Properties * get_props (const char *name)
 
Properties * get_props_at (int index)
 
mlt_rect get_rect (const char *name)
 
char * get_time (const char *name, mlt_time_format=mlt_time_smpte_df)
 
int inc_ref ()
 
int inherit (Properties &that)
 Copy all properties from that into this object.
 
bool is_anim (const char *name)
 
bool is_sequence ()
 Return true if all property names are numeric indices (i.e.
 
bool is_valid ()
 Return true if the underlying mlt_properties handle is non-null.
 
Event * listen (const char *id, void *object, mlt_listener)
 Register a listener callback for the named event.
 
void load (const char *file)
 Merge properties from a file into this object.
 
void lock ()
 Acquire the recursive mutex protecting this object.
 
void mirror (Properties &that)
 Mirror all property changes on this object to that.
 
Properties & operator= (const Properties &properties)
 
int parse (const char *namevalue)
 Parse a "name=value" string and store the result.
 
int pass_list (Properties &that, const char *list)
 Copy the space-delimited list of named properties from that.
 
void pass_property (Properties &that, const char *name)
 Copy a single named property from that.
 
int pass_values (Properties &that, const char *prefix)
 Copy all properties whose names begin with prefix from that.
 
int preset (const char *name)
 Apply a named preset from the presets directory.
 
 Properties ()
 
 Properties (bool dummy)
 
 Properties (const char *file)
 Load properties from a file.
 
 Properties (const Properties &properties)
 
 Properties (mlt_properties properties)
 Wrap an existing mlt_properties without taking ownership.
 
 Properties (Properties &properties)
 
 Properties (void *properties)
 
bool property_exists (const char *name)
 
int ref_count ()
 
int rename (const char *source, const char *dest)
 Rename property source to dest.
 
int save (const char *file)
 Save properties to a file.
 
char * serialise_yaml ()
 
int set (const char *name, const char *value)
 Set a string property.
 
int set (const char *name, double value)
 Set a double property.
 
int set (const char *name, double x, double y, double w, double h, double opacity=1.0)
 
int set (const char *name, int value)
 Set an integer property.
 
int set (const char *name, int64_t value)
 Set a 64-bit integer property.
 
int set (const char *name, mlt_color value)
 
int set (const char *name, mlt_rect value)
 
int set (const char *name, Properties &properties)
 
int set (const char *name, void *value, int size, mlt_destructor destroy=NULL, mlt_serialiser serial=NULL)
 Store opaque data with an optional destructor and serialiser.
 
int set_lcnumeric (const char *locale)
 
int set_string (const char *name, const char *value)
 Set a string property (no environment-variable expansion).
 
Event * setup_wait_for (const char *id)
 Set up a one-shot wait handle for event id.
 
int time_to_frames (const char *time)
 
void unblock (void *object=NULL)
 Resume event delivery to object.
 
void unlock ()
 Release the recursive mutex.
 
void wait_for (const char *id)
 
void wait_for (Event *, bool destroy=true)
 
virtual ~Properties ()
 

Static Public Member Functions

static void delete_clip_info (ClipInfo *info)
 
- Static Public Member Functions inherited from Mlt::Properties
static void delete_event (Event *)
 
static Properties * parse_yaml (const char *file)
 Parse a YAML Tiny file and return a new Properties tree.
 

Private Attributes

mlt_playlist instance
 

Detailed Description

C++ wrapper for mlt_playlist — a sequential list of clips.

A playlist is a producer that plays its clips in order. Clips are producers (or cut-producers) that may be appended, inserted, removed, and trimmed. Blank gaps between clips are also supported.

See also
mlt_playlist_s

Constructor & Destructor Documentation

◆ Playlist() [1/5]

Playlist::Playlist ( )

◆ Playlist() [2/5]

Playlist::Playlist ( Profile &  profile)

◆ Playlist() [3/5]

Playlist::Playlist ( Service &  playlist)

◆ Playlist() [4/5]

Playlist::Playlist ( Playlist &  playlist)

◆ Playlist() [5/5]

Playlist::Playlist ( mlt_playlist  playlist)

Wrap an existing mlt_playlist handle.

◆ ~Playlist()

Playlist::~Playlist ( )
virtual

Member Function Documentation

◆ append()

int Playlist::append ( Producer &  producer,
int  in = -1,
int  out = -1 
)

Append producer (optionally trimmed to [in, out]) to the end.

◆ blank() [1/2]

int Playlist::blank ( const char *  length)

Append a blank of the given timecode length.

◆ blank() [2/2]

int Playlist::blank ( int  out)

Append a blank of out + 1 frames.

◆ blanks_from()

int Playlist::blanks_from ( int  clip,
int  bounded = 0 
)

◆ clear()

int Playlist::clear ( )

Remove all entries from the playlist.

◆ clip()

int Playlist::clip ( mlt_whence  whence,
int  index 
)

◆ clip_info()

ClipInfo * Playlist::clip_info ( int  index,
ClipInfo *  info = NULL 
)

Return metadata for the clip at index.

When info is NULL a new ClipInfo is returned and the caller owns it; otherwise info is updated in-place and returned.

◆ clip_length()

int Playlist::clip_length ( int  clip)

◆ clip_start()

int Playlist::clip_start ( int  clip)

Return the start frame of clip clip in the timeline.

◆ consolidate_blanks()

void Playlist::consolidate_blanks ( int  keep_length = 0)

Merge adjacent blanks; if keep_length is 0, trim trailing blanks.

◆ count()

int Playlist::count ( )

Return the number of entries (clips and blanks).

◆ current()

Producer * Playlist::current ( )

Return the currently playing producer.

Caller owns the result.

◆ current_clip()

int Playlist::current_clip ( )

Return the index of the currently playing clip.

◆ delete_clip_info()

void Playlist::delete_clip_info ( ClipInfo *  info)
static

◆ get_clip()

Producer * Playlist::get_clip ( int  clip)

Return the producer for clip clip.

Caller owns the result.

◆ get_clip_at()

Producer * Playlist::get_clip_at ( int  position)

Return the producer at absolute timeline frame position.

Caller owns the result.

◆ get_clip_index_at()

int Playlist::get_clip_index_at ( int  position)

Return the clip index at absolute timeline frame position.

◆ get_playlist()

mlt_playlist Playlist::get_playlist ( )
virtual

◆ get_producer()

mlt_producer Playlist::get_producer ( )
overridevirtual

Reimplemented from Mlt::Producer.

◆ insert()

int Playlist::insert ( Producer &  producer,
int  where,
int  in = -1,
int  out = -1 
)

Insert producer at position where, shifting later clips.

◆ insert_at() [1/2]

int Playlist::insert_at ( int  position,
Producer &  producer,
int  mode = 0 
)

◆ insert_at() [2/2]

int Playlist::insert_at ( int  position,
Producer *  producer,
int  mode = 0 
)

Insert producer at absolute timeline position.

◆ insert_blank()

void Playlist::insert_blank ( int  clip,
int  out 
)

◆ is_blank()

bool Playlist::is_blank ( int  clip)

Return true if the clip at clip is a blank.

◆ is_blank_at()

bool Playlist::is_blank_at ( int  position)

Return true if the absolute timeline position is in a blank.

◆ is_mix()

bool Playlist::is_mix ( int  clip)

Return true if the clip at clip is a mix.

◆ join()

int Playlist::join ( int  clip,
int  count = 1,
int  merge = 1 
)

Join count clips starting at clip into one.

◆ mix()

int Playlist::mix ( int  clip,
int  length,
Transition *  transition = NULL 
)

Create a mix (dissolve) of length frames at the clip boundary.

◆ mix_add()

int Playlist::mix_add ( int  clip,
Transition *  transition 
)

Add a transition to an existing mix at clip.

◆ mix_in()

int Playlist::mix_in ( int  clip,
int  length 
)

◆ mix_out()

int Playlist::mix_out ( int  clip,
int  length 
)

◆ move()

int Playlist::move ( int  from,
int  to 
)

Move the clip at from to to.

◆ pad_blanks()

void Playlist::pad_blanks ( int  position,
int  length,
int  find = 0 
)

◆ remove()

int Playlist::remove ( int  where)

Remove the clip at position where.

◆ remove_region()

int Playlist::remove_region ( int  position,
int  length 
)

◆ reorder()

int Playlist::reorder ( const int *  indices)

Reorder the playlist using an array of old indices.

◆ repeat()

int Playlist::repeat ( int  clip,
int  count 
)

Repeat the clip at clip count additional times.

◆ replace_with_blank()

Producer * Playlist::replace_with_blank ( int  clip)

Replace the clip at clip with a blank of the same length.

Caller owns the result.

◆ resize_clip()

int Playlist::resize_clip ( int  clip,
int  in,
int  out 
)

Retrim the clip at clip to [in, out].

◆ split()

int Playlist::split ( int  clip,
int  position 
)

Split the clip at clip at frame position (relative to clip start).

◆ split_at()

int Playlist::split_at ( int  position,
bool  left = true 
)

Split at absolute timeline position.

Field Documentation

◆ instance

mlt_playlist Mlt::Playlist::instance
private

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