added more emotionxx API

SVN revision: 50487
This commit is contained in:
Andreas Volz 2010-07-25 18:29:31 +00:00
parent e8cdd98f64
commit 3edcb64f4b
11 changed files with 500 additions and 233 deletions

View File

@ -0,0 +1,40 @@
#ifndef EMOTIONXX_AUDIO_OBJECT_H
#define EMOTIONXX_AUDIO_OBJECT_H
/* Project */
#include "Object.h"
/* EFL++ */
#include <eflxx/Common.h>
#include <evasxx/Canvas.h>
#include <evasxx/Object.h>
/* STD */
#include <iostream>
using namespace std;
namespace Emotionxx {
class AudioObject : public Emotionxx::Object
{
public:
AudioObject (Evasxx::Canvas &canvas, const std::string &moduleFilename);
AudioObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename);
AudioObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename);
AudioObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename);
~AudioObject ();
void setAudioVolume (double vol);
double getAudioVolume ();
void setAudioMute (bool mute);
bool getAudioMute ();
int countAudioChannel ();
string getAudioChannelName (int channel);
void setAudioChannel (int channel);
int getAudioChannel ();
};
} // end namespace Emotionxx
#endif // EMOTIONXX_AUDIO_OBJECT_H

View File

@ -8,6 +8,9 @@
*/
#include "Object.h"
#include "AudioObject.h"
#include "VideoObject.h"
#include "SPUObject.h"
#endif // EMOTIONXX_H

View File

@ -1,7 +1,10 @@
libemotionxx_HEADERS = \
Object.h \
Emotionxx.h
Emotionxx.h \
SPUObject.h \
VideoObject.h \
AudioObject.h
libemotionxxdir = \
$(pkgincludedir)

View File

@ -16,7 +16,7 @@ using namespace std;
/**
* C++ Wrapper for the Enlightenment Emotion Library (EMOTION)
*
* @author Michael 'Mickey' Lauer <mickey@Vanille.de>
* @author Andreas Volz <andreas.volz@tux-style.com>
*/
namespace Emotionxx {
@ -24,81 +24,55 @@ namespace Emotionxx {
class Object : public Evasxx::Object
{
public:
Object( Evasxx::Canvas &canvas, const std::string &module_filename );
Object( Evasxx::Canvas &canvas, const std::string &filename, const std::string &module_filename );
Object( Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &module_filename );
Object( Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &module_filename );
~Object();
/**
* Initialize video engine to either use xine or gstreamer
*
* @param module_filename name of viedo engine to be used
*/
bool engineInit (const std::string &module_filename);
void setFile (const std::string &filename);
std::string getFile ();
void setPlay (bool play);
bool getPlay ();
void setPosition (double sec);
double getPosition ();
bool getVideoHandled ();
bool getAudioHandled ();
bool getSeekable ();
double getPlayLengh ();
Eflxx::Size getSize ();
void setSmoothScale (bool smooth);
bool getSmoothScale ();
double getRatio ();
void sendSimpleEvent (Emotion_Event ev);
void setAudioVolume (double vol);
double getAudioVolume ();
void setAudioMute (bool mute);
bool getAudioMute ();
int countAudioChannel ();
string getChannelName (int channel);
void setAudioChannel (int channel);
int getAudioChannel ();
void setVideoMute (bool mute);
bool getVideoMute ();
int countVideoChannel ();
string getVideoChannelName (int channel);
void setVideoChannel (int channel);
int getVideoChannel ();
void setSPUMute (bool mute);
bool getSPUMute ();
int countSPUChannel ();
std::string getSPUChannelName (int channel);
void setSPUChannel (int channel);
int getSPUChannel ();
int countChapter ();
void setChapter (int chapter);
int getChapter ();
std::string getChapterName (int chapter);
void setPlaySpeed (double speed);
double getPlaySpeed ();
void eject ();
std::string getTitle ();
string getProgressInfo ();
double getProgressStatus ();
string getRefFile ();
int getRefNum ();
int getSPUButtonCount ();
int getSPUButton ();
string getMetaInfo (Emotion_Meta_Info meta);
void setVIS (Emotion_Vis visualization);
Emotion_Vis getVIS ();
bool isVISSupported (Emotion_Vis visualization);
/*
protected:
Object (Evasxx::Canvas &canvas, const std::string &moduleFilename);
Object (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename);
Object (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename);
Object (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename);
virtual ~Object ();
*/
private:
/**
* Initialize video engine to either use xine or gstreamer
*
* @param moduleFilename name of viedo engine to be used
*/
bool engineInit (const std::string &moduleFilename);
};
} // end namespace Emotionxx

View File

@ -0,0 +1,43 @@
#ifndef EMOTIONXX_SPU_OBJECT_H
#define EMOTIONXX_SPU_OBJECT_H
/* Project */
#include "VideoObject.h"
/* EFL++ */
#include <eflxx/Common.h>
#include <evasxx/Canvas.h>
#include <evasxx/Object.h>
/* STD */
#include <iostream>
using namespace std;
namespace Emotionxx {
/*!
* SPU == Subtitle Processing Unit
*/
class SPUObject : public Emotionxx::VideoObject
{
public:
SPUObject (Evasxx::Canvas &canvas, const std::string &moduleFilename);
SPUObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename);
SPUObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename);
SPUObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename);
~SPUObject ();
void setSPUMute (bool mute);
bool getSPUMute ();
int countSPUChannel ();
std::string getSPUChannelName (int channel);
void setSPUChannel (int channel);
int getSPUChannel ();
int getSPUButtonCount ();
int getSPUButton ();
};
} // end namespace Emotionxx
#endif // EMOTIONXX_SPU_OBJECT_H

View File

@ -0,0 +1,71 @@
#ifndef EMOTIONXX_VIDEO_OBJECT_H
#define EMOTIONXX_VIDEO_OBJECT_H
/* Project */
#include "AudioObject.h"
/* EFL++ */
#include <eflxx/Common.h>
#include <evasxx/Canvas.h>
#include <evasxx/Object.h>
/* STD */
#include <iostream>
using namespace std;
namespace Emotionxx {
class VideoObject : public Emotionxx::AudioObject
{
public:
VideoObject (Evasxx::Canvas &canvas, const std::string &moduleFilename);
VideoObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename);
VideoObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename);
VideoObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename);
~VideoObject ();
void setVideoMute (bool mute);
bool getVideoMute ();
int countVideoChannel ();
string getVideoChannelName (int channel);
void setVideoChannel (int channel);
int getVideoChannel ();
/*!
* Sets whether to use of high-quality image scaling algorithm
* of the given video object.
*
* When enabled, a higher quality video scaling algorithm is used when
* scaling videos to sizes other than the source video. This gives
* better results but is more computationally expensive.
*
* @param smooth Whether to use smooth scale or not.
*/
void setSmoothScale (bool smooth);
/*!
* Gets whether the high-quality image scaling algorithm
* of the given video object is used.
*
* @return Whether the smooth scale is used or not.
*/
bool getSmoothScale ();
double getRatio ();
Eflxx::Size getSize ();
int countChapter ();
void setChapter (int chapter);
int getChapter ();
std::string getChapterName (int chapter);
/*!
* Send a control event to the DVD.
*/
void sendSimpleEvent (Emotion_Event ev);
};
} // end namespace Emotionxx
#endif // EMOTIONXX_VIDEO_OBJECT_H

View File

@ -0,0 +1,83 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/emotionxx/AudioObject.h"
extern "C" {
#include <Emotion.h>
}
#include <iostream>
#include <assert.h>
using namespace std;
namespace Emotionxx {
AudioObject::AudioObject (Evasxx::Canvas &canvas, const std::string &moduleFilename) :
Object (canvas, moduleFilename)
{
}
AudioObject::AudioObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename) :
Object (canvas, filename, moduleFilename)
{
}
AudioObject::AudioObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename) :
Object (canvas, pos, filename, moduleFilename)
{
}
AudioObject::AudioObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename) :
Object (canvas, rect, filename, moduleFilename)
{
}
AudioObject::~AudioObject ()
{
}
void AudioObject::setAudioVolume (double vol)
{
emotion_object_audio_volume_set (o, vol);
}
double AudioObject::getAudioVolume ()
{
return emotion_object_audio_volume_get (o);
}
void AudioObject::setAudioMute (bool mute)
{
emotion_object_audio_mute_set (o, mute);
}
bool AudioObject::getAudioMute ()
{
return emotion_object_audio_mute_get (o);
}
int AudioObject::countAudioChannel ()
{
return emotion_object_audio_channel_count (o);
}
string AudioObject::getAudioChannelName (int channel)
{
return emotion_object_audio_channel_name_get (o, channel);
}
void AudioObject::setAudioChannel (int channel)
{
emotion_object_audio_channel_set (o, channel);
}
int AudioObject::getAudioChannel ()
{
return emotion_object_audio_channel_get (o);
}
} // end namespace Emotionxx

View File

@ -16,7 +16,10 @@ lib_LTLIBRARIES = \
libemotionxx.la
libemotionxx_la_SOURCES = \
Object.cpp
Object.cpp \
SPUObject.cpp \
VideoObject.cpp \
AudioObject.cpp
libemotionxx_la_LIBADD = \
$(EFL_LIBS)

View File

@ -16,37 +16,37 @@ using namespace std;
namespace Emotionxx {
Object::Object( Evasxx::Canvas &canvas, const std::string &module_filename )
Object::Object( Evasxx::Canvas &canvas, const std::string &moduleFilename )
{
o = emotion_object_add( canvas.obj() );
o = emotion_object_add (canvas.obj ());
init();
engineInit(module_filename);
engineInit (moduleFilename);
}
Object::Object( Evasxx::Canvas &canvas, const std::string &filename, const std::string &module_filename )
Object::Object (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename)
{
o = emotion_object_add( canvas.obj() );
init();
engineInit(module_filename);
setFile( filename );
o = emotion_object_add (canvas.obj ());
init ();
engineInit (moduleFilename);
setFile (filename);
}
Object::Object( Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &module_filename )
Object::Object (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename)
{
o = emotion_object_add( canvas.obj() );
init( );
engineInit(module_filename);
setFile( filename );
move( pos );
o = emotion_object_add( canvas.obj ());
init ();
engineInit (moduleFilename);
setFile (filename);
move (pos);
}
Object::Object( Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &module_filename )
Object::Object (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename )
{
o = emotion_object_add( canvas.obj() );
o = emotion_object_add (canvas.obj ());
init( );
engineInit(module_filename);
setFile( filename );
init ();
engineInit (moduleFilename);
setFile (filename);
setGeometry (rect);
}
@ -54,9 +54,9 @@ Object::~Object()
{
}
bool Object::engineInit(const std::string &module_filename)
bool Object::engineInit (const std::string &moduleFilename)
{
return emotion_object_init(o, module_filename.c_str ());
return emotion_object_init (o, moduleFilename.c_str ());
}
void Object::setFile (const std::string &filename)
@ -109,155 +109,6 @@ double Object::getPlayLengh ()
return emotion_object_play_length_get (o);
}
Eflxx::Size Object::getSize ()
{
int iw = 0;
int ih = 0;
emotion_object_size_get (o, &iw, &ih);
return Eflxx::Size (iw, ih);
}
void Object::setSmoothScale (bool smooth)
{
emotion_object_smooth_scale_set (o, smooth);
}
bool Object::getSmoothScale ()
{
return emotion_object_smooth_scale_get (o);
}
double Object::getRatio ()
{
return emotion_object_ratio_get (o);
}
void Object::sendSimpleEvent (Emotion_Event ev)
{
emotion_object_event_simple_send (o, ev);
}
void Object::setAudioVolume (double vol)
{
emotion_object_audio_volume_set (o, vol);
}
double Object::getAudioVolume ()
{
return emotion_object_audio_volume_get (o);
}
void Object::setAudioMute (bool mute)
{
emotion_object_audio_mute_set (o, mute);
}
bool Object::getAudioMute ()
{
return emotion_object_audio_mute_get (o);
}
int Object::countAudioChannel ()
{
return emotion_object_audio_channel_count (o);
}
string Object::getChannelName (int channel)
{
return emotion_object_audio_channel_name_get (o, channel);
}
void Object::setAudioChannel (int channel)
{
emotion_object_audio_channel_set (o, channel);
}
int Object::getAudioChannel ()
{
return emotion_object_audio_channel_get (o);
}
void Object::setVideoMute (bool mute)
{
emotion_object_video_mute_set (o, mute);
}
bool Object::getVideoMute ()
{
return emotion_object_video_mute_get (o);
}
int Object::countVideoChannel ()
{
return emotion_object_video_channel_count (o);
}
string Object::getVideoChannelName (int channel)
{
return emotion_object_video_channel_name_get (o, channel);
}
void Object::setVideoChannel (int channel)
{
emotion_object_video_channel_set (o, channel);
}
int Object::getVideoChannel ()
{
return emotion_object_video_channel_get (o);
}
void Object::setSPUMute (bool mute)
{
emotion_object_spu_mute_set (o, mute);
}
bool Object::getSPUMute ()
{
return emotion_object_spu_mute_get (o);
}
int Object::countSPUChannel ()
{
return emotion_object_spu_channel_count (o);
}
std::string Object::getSPUChannelName (int channel)
{
return emotion_object_spu_channel_name_get (o, channel);
}
void Object::setSPUChannel (int channel)
{
emotion_object_spu_channel_set (o, channel);
}
int Object::getSPUChannel ()
{
return emotion_object_spu_channel_get (o);
}
int Object::countChapter ()
{
return emotion_object_chapter_count (o);
}
void Object::setChapter (int chapter)
{
emotion_object_chapter_set (o, chapter);
}
int Object::getChapter ()
{
return emotion_object_chapter_get (o);
}
string Object::getChapterName (int chapter)
{
return emotion_object_chapter_name_get (o, chapter);
}
void Object::setPlaySpeed (double speed)
{
emotion_object_play_speed_set (o, speed);
@ -298,16 +149,6 @@ int Object::getRefNum ()
return emotion_object_ref_num_get (o);
}
int Object::getSPUButtonCount ()
{
return emotion_object_spu_button_count_get (o);
}
int Object::getSPUButton ()
{
return emotion_object_spu_button_get (o);
}
string Object::getMetaInfo (Emotion_Meta_Info meta)
{
return emotion_object_meta_info_get (o, meta);

View File

@ -0,0 +1,84 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/emotionxx/SPUObject.h"
extern "C" {
#include <Emotion.h>
}
#include <iostream>
#include <assert.h>
using namespace std;
namespace Emotionxx {
SPUObject::SPUObject (Evasxx::Canvas &canvas, const std::string &moduleFilename) :
VideoObject (canvas, moduleFilename)
{
}
SPUObject::SPUObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename) :
VideoObject (canvas, filename, moduleFilename)
{
}
SPUObject::SPUObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename) :
VideoObject (canvas, pos, filename, moduleFilename)
{
}
SPUObject::SPUObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename) :
VideoObject (canvas, rect, filename, moduleFilename)
{
}
SPUObject::~SPUObject ()
{
}
void SPUObject::setSPUMute (bool mute)
{
emotion_object_spu_mute_set (o, mute);
}
bool SPUObject::getSPUMute ()
{
return emotion_object_spu_mute_get (o);
}
int SPUObject::countSPUChannel ()
{
return emotion_object_spu_channel_count (o);
}
std::string SPUObject::getSPUChannelName (int channel)
{
return emotion_object_spu_channel_name_get (o, channel);
}
void SPUObject::setSPUChannel (int channel)
{
emotion_object_spu_channel_set (o, channel);
}
int SPUObject::getSPUChannel ()
{
return emotion_object_spu_channel_get (o);
}
int SPUObject::getSPUButtonCount ()
{
return emotion_object_spu_button_count_get (o);
}
int SPUObject::getSPUButton ()
{
return emotion_object_spu_button_get (o);
}
} // end namespace Emotionxx

View File

@ -0,0 +1,122 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "../include/emotionxx/VideoObject.h"
extern "C" {
#include <Emotion.h>
}
#include <iostream>
#include <assert.h>
using namespace std;
namespace Emotionxx {
VideoObject::VideoObject (Evasxx::Canvas &canvas, const std::string &moduleFilename) :
AudioObject (canvas, moduleFilename)
{
}
VideoObject::VideoObject (Evasxx::Canvas &canvas, const std::string &filename, const std::string &moduleFilename) :
AudioObject (canvas, filename, moduleFilename)
{
}
VideoObject::VideoObject (Evasxx::Canvas &canvas, const Eflxx::Point &pos, const std::string &filename, const std::string &moduleFilename) :
AudioObject (canvas, pos, filename, moduleFilename)
{
}
VideoObject::VideoObject (Evasxx::Canvas &canvas, const Eflxx::Rect &rect, const std::string &filename, const std::string &moduleFilename) :
AudioObject (canvas, rect, filename, moduleFilename)
{
}
VideoObject::~VideoObject ()
{
}
void VideoObject::setVideoMute (bool mute)
{
emotion_object_video_mute_set (o, mute);
}
bool VideoObject::getVideoMute ()
{
return emotion_object_video_mute_get (o);
}
int VideoObject::countVideoChannel ()
{
return emotion_object_video_channel_count (o);
}
string VideoObject::getVideoChannelName (int channel)
{
return emotion_object_video_channel_name_get (o, channel);
}
void VideoObject::setVideoChannel (int channel)
{
emotion_object_video_channel_set (o, channel);
}
int VideoObject::getVideoChannel ()
{
return emotion_object_video_channel_get (o);
}
void VideoObject::setSmoothScale (bool smooth)
{
emotion_object_smooth_scale_set (o, smooth);
}
bool VideoObject::getSmoothScale ()
{
return emotion_object_smooth_scale_get (o);
}
double VideoObject::getRatio ()
{
return emotion_object_ratio_get (o);
}
Eflxx::Size VideoObject::getSize ()
{
int iw = 0;
int ih = 0;
emotion_object_size_get (o, &iw, &ih);
return Eflxx::Size (iw, ih);
}
int VideoObject::countChapter ()
{
return emotion_object_chapter_count (o);
}
void VideoObject::setChapter (int chapter)
{
emotion_object_chapter_set (o, chapter);
}
int VideoObject::getChapter ()
{
return emotion_object_chapter_get (o);
}
string VideoObject::getChapterName (int chapter)
{
return emotion_object_chapter_name_get (o, chapter);
}
void VideoObject::sendSimpleEvent (Emotion_Event ev)
{
emotion_object_event_simple_send (o, ev);
}
} // end namespace Emotionxx