MltFilter.o \
MltFilteredConsumer.o \
MltFrame.o \
+ MltMiracle.o \
MltMultitrack.o \
MltPlaylist.o \
MltProducer.o \
MltProperties.o \
+ MltResponse.o \
MltService.o \
MltTractor.o \
- MltTransition.o \
- MltMiracle.o
+ MltTransition.o
SRCS = $(OBJS:.o=.cpp)
#include "MltFilter.h"
#include "MltFilteredConsumer.h"
#include "MltFrame.h"
+#include "MltMiracle.h"
#include "MltMultitrack.h"
#include "MltPlaylist.h"
#include "MltProducer.h"
#include "MltProperties.h"
+#include "MltResponse.h"
#include "MltService.h"
#include "MltTractor.h"
#include "MltTransition.h"
-#include "MltMiracle.h"
#endif
#include "MltMiracle.h"
#include "MltService.h"
+#include "MltResponse.h"
using namespace Mlt;
#include <time.h>
Miracle *miracle = ( Miracle * )arg;
if ( miracle != NULL )
{
- return miracle->execute( command );
+ Response *response = miracle->execute( command );
+ valerie_response real = valerie_response_clone( response->get_response( ) );
+ delete response;
+ return real;
}
else
{
if ( miracle != NULL )
{
Service input( service );
- return miracle->push( command, &input );
+ Response *response = miracle->push( command, &input );
+ valerie_response real = valerie_response_clone( response->get_response( ) );
+ delete response;
+ return real;
}
else
{
return server->shutdown == 0;
}
-valerie_response Miracle::execute( char *command )
+Response *Miracle::execute( char *command )
{
- return _execute( _real, command );
+ return new Response( _execute( _real, command ) );
}
-valerie_response Miracle::push( char *command, Service *service )
+Response *Miracle::push( char *command, Service *service )
{
- return _push( _real, command, service->get_service( ) );
+ return new Response( _push( _real, command, service->get_service( ) ) );
}
void Miracle::wait_for_shutdown( )
namespace Mlt
{
class Service;
+ class Response;
class Miracle
{
virtual ~Miracle( );
bool start( );
bool is_running( );
- virtual valerie_response execute( char *command );
- virtual valerie_response push( char *command, Service *service );
+ virtual Response *execute( char *command );
+ virtual Response *push( char *command, Service *service );
void wait_for_shutdown( );
};
}
--- /dev/null
+/**
+ * MltResponse.cpp - MLT Wrapper
+ * Copyright (C) 2004-2005 Charles Yates
+ * 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 Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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.
+ *
+ * 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.
+ */
+
+#include "MltResponse.h"
+using namespace Mlt;
+
+Response::Response( valerie_response response ) :
+ _response( response )
+{
+}
+
+Response::~Response( )
+{
+ valerie_response_close( _response );
+}
+
+valerie_response Response::get_response( )
+{
+ return _response;
+}
+
+int Response::error_code( )
+{
+ return valerie_response_get_error_code( get_response( ) );
+}
+
+char *Response::error_string( )
+{
+ return valerie_response_get_error_string( get_response( ) );
+}
+
+char *Response::get( int index )
+{
+ return valerie_response_get_line( get_response( ), index );
+}
+
+int Response::count( )
+{
+ return valerie_response_count( get_response( ) );
+}
+
+
--- /dev/null
+/**
+ * MltResponse.h - MLT Wrapper
+ * Copyright (C) 2004-2005 Charles Yates
+ * 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 Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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.
+ *
+ * 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.
+ */
+
+#ifndef _MLTPP_RESPONSE_H_
+#define _MLTPP_RESPONSE_H_
+
+#include <valerie/valerie_response.h>
+
+namespace Mlt
+{
+ class Response
+ {
+ private:
+ valerie_response _response;
+ public:
+ Response( valerie_response response );
+ ~Response( );
+ valerie_response get_response( );
+ int error_code( );
+ char *error_string( );
+ char *get( int );
+ int count( );
+ };
+}
+
+#endif
%newobject Tractor::multitrack( );
%newobject Tractor::field( );
%newobject Tractor::track( int );
+%newobject Miracle::execute( char * );
+%newobject Miracle::push( char *, Service & );
}
/** Classes to wrap.
%include <MltTractor.h>
%include <MltFilteredConsumer.h>
%include <MltMiracle.h>
+%include <MltResponse.h>
#if defined(SWIGRUBY)