Cleanup license declarations and remove dv1394d references.
[melted] / src / framework / mlt_field.c
index 3ba0841..d1409d6 100644 (file)
@@ -3,19 +3,19 @@
  * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
  * Author: Charles Yates <charles.yates@pandora.be>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 #include "mlt_field.h"
@@ -63,7 +63,7 @@ mlt_field mlt_field_init( )
                this->tractor = mlt_tractor_init( );
 
                // The first plant will be connected to the mulitrack
-               this->producer = mlt_multitrack_service( this->multitrack );
+               this->producer = MLT_MULTITRACK_SERVICE( this->multitrack );
 
                // Connect the tractor to the multitrack
                mlt_tractor_connect( this->tractor, this->producer );
@@ -88,7 +88,7 @@ mlt_field mlt_field_new( mlt_multitrack multitrack, mlt_tractor tractor )
                this->tractor = tractor;
 
                // The first plant will be connected to the mulitrack
-               this->producer = mlt_multitrack_service( this->multitrack );
+               this->producer = MLT_MULTITRACK_SERVICE( this->multitrack );
 
                // Connect the tractor to the multitrack
                mlt_tractor_connect( this->tractor, this->producer );
@@ -103,7 +103,7 @@ mlt_field mlt_field_new( mlt_multitrack multitrack, mlt_tractor tractor )
 
 mlt_service mlt_field_service( mlt_field this )
 {
-       return this != NULL ? mlt_tractor_service( this->tractor ) : NULL;
+       return MLT_TRACTOR_SERVICE( this->tractor );
 }
 
 /** Get the multi track.
@@ -127,7 +127,7 @@ mlt_tractor mlt_field_tractor( mlt_field this )
 
 mlt_properties mlt_field_properties( mlt_field this )
 {
-       return mlt_service_properties( mlt_field_service( this ) );
+       return MLT_SERVICE_PROPERTIES( mlt_field_service( this ) );
 }
 
 /** Plant a filter.
@@ -142,10 +142,13 @@ int mlt_field_plant_filter( mlt_field this, mlt_filter that, int track )
        if ( result == 0 )
        {
                // This is now the new producer
-               this->producer = mlt_filter_service( that );
+               this->producer = MLT_FILTER_SERVICE( that );
 
                // Reconnect tractor to new producer
                mlt_tractor_connect( this->tractor, this->producer );
+
+               // Fire an event
+               mlt_events_fire( mlt_field_properties( this ), "service-changed", NULL );
        }
 
        return result;
@@ -163,10 +166,13 @@ int mlt_field_plant_transition( mlt_field this, mlt_transition that, int a_track
        if ( result == 0 )
        {
                // This is now the new producer
-               this->producer = mlt_transition_service( that );
+               this->producer = MLT_TRANSITION_SERVICE( that );
 
                // Reconnect tractor to new producer
                mlt_tractor_connect( this->tractor, this->producer );
+
+               // Fire an event
+               mlt_events_fire( mlt_field_properties( this ), "service-changed", NULL );
        }
 
        return 0;