]> git.sesse.net Git - mlt/blobdiff - mlt++/src/MltService.cpp
Remove files that no longer belong.
[mlt] / mlt++ / src / MltService.cpp
index 6e06ed20b9e91d129dfa3a3ea4a822cb5858760c..88751ab54f325dfc9e0c8247463ab3a18d809d31 100644 (file)
@@ -21,6 +21,7 @@
 #include <string.h>
 #include "MltService.h"
 #include "MltFilter.h"
+#include "MltProfile.h"
 using namespace Mlt;
 
 Service::Service( ) :
@@ -58,6 +59,16 @@ mlt_properties Service::get_properties( )
        return mlt_service_properties( get_service( ) );
 }
 
+void Service::lock( )
+{
+       mlt_service_lock( get_service( ) );
+}
+
+void Service::unlock( )
+{
+       mlt_service_unlock( get_service( ) );
+}
+
 int Service::connect_producer( Service &producer, int index )
 {
        return mlt_service_connect_producer( get_service( ), producer.get_service( ), index );
@@ -73,45 +84,23 @@ Service *Service::consumer( )
        return new Service( mlt_service_consumer( get_service( ) ) );
 }
 
+Profile *Service::profile( )
+{
+       return new Profile( mlt_service_profile( get_service() ) );
+}
+
 Frame *Service::get_frame( int index )
 {
        mlt_frame frame = NULL;
        mlt_service_get_frame( get_service( ), &frame, index );
-       return new Frame( frame );
-}
-
-service_type Service::type( )
-{
-       service_type type = invalid_type;
-       if ( is_valid( ) )
-       {
-               char *mlt_type = get( "mlt_type" );
-               char *resource = get( "resource" );
-               if ( mlt_type == NULL )
-                       type = unknown_type;
-               else if ( !strcmp( mlt_type, "producer" ) )
-                       type = producer_type;
-               else if ( !strcmp( mlt_type, "mlt_producer" ) )
-               {
-                       if ( resource == NULL )
-                               type = producer_type;
-                       else if ( !strcmp( resource, "<playlist>" ) )
-                               type = playlist_type;
-                       else if ( !strcmp( resource, "<tractor>" ) )
-                               type = tractor_type;
-                       else if ( !strcmp( resource, "<multitrack>" ) )
-                               type = multitrack_type;
-               }
-               else if ( !strcmp( mlt_type, "filter" ) )
-                       type = filter_type;
-               else if ( !strcmp( mlt_type, "transition" ) )
-                       type = transition_type;
-               else if ( !strcmp( mlt_type, "consumer" ) )
-                       type = consumer_type;
-               else
-                       type = unknown_type;
-       }
-       return type;
+       Frame *result = new Frame( frame );
+       mlt_frame_close( frame );
+       return result;
+}
+
+mlt_service_type Service::type( )
+{
+       return mlt_service_identify( get_service( ) );
 }
 
 int Service::attach( Filter &filter )
@@ -126,6 +115,7 @@ int Service::detach( Filter &filter )
 
 Filter *Service::filter( int index )
 {
-       return new Filter( mlt_service_filter( get_service( ), index ) );
+       mlt_filter result = mlt_service_filter( get_service( ), index );
+       return result == NULL ? NULL : new Filter( result );
 }