heyho,
i have crate a small patch to integrate recordmydesktop into hydrogen.
the patch is attached.
you need recordmydesktop with jack support enabled. on debian this needs a
build from sources. the repository package is without jack support.
my patch works together with lib theora >1.0 and recordmydesktop.
how does my patch works.
1. start hydrogen with -r option [ hydrogen -r ]
noe you can see the new rmd menue item.
here you find a simple resize menu item.
also you find a start and stop menu item.
2. disable window borders.
3. start rmd and make your movie.
4. press stop.
now you see rmd processing in lcd message-bar.
now you have the choise. you can wait processing the ogv file. or you can stop
processing.
maybe if you now the scene is to bad.
the ogv file live in work directory.
i know its a simple patch. but it makes sense if you really try to make h2
video lessons.
one thing. if you record scenes longer than 2 minutes you get audio video shift.
Index: gui/src/MainForm.cpp
===================================================================
--- gui/src/MainForm.cpp (Revision 1446)
+++ gui/src/MainForm.cpp (Arbeitskopie)
@@ -75,6 +75,7 @@
: QMainWindow( 0, 0 )
, Object( "MainForm" )
{
+
setMinimumSize( QSize( 1000, 600 ) );
setWindowIcon( QPixmap( Skin::getImagePath() + "/icon16.png" ) );
@@ -139,7 +140,10 @@
connect( &m_autosaveTimer, SIGNAL(timeout()), this, SLOT(onAutoSaveTimer()));
m_autosaveTimer.start( 60 * 1000 );
+ __rmdtimer = new QTimer(this);
+ connect( __rmdtimer, SIGNAL( timeout() ), this, SLOT( checkRmD() ) );
+
#ifdef LASH_SUPPORT
if ( Preferences::get_instance()->useLash() ){
@@ -171,6 +175,12 @@
//beatcouter
Hydrogen::get_instance()->setBcOffsetAdjust();
+///recordmydesktop
+ if ( Preferences::get_instance()->__rmd) {
+ QObject *parent;
+ __rmd = new QProcess(parent);
+ }
+
}
@@ -287,6 +297,15 @@
//~ DEBUG menu
}
+ if ( Preferences::get_instance()->__rmd) {
+ // record my desktop menue
+ m_pRMD = m_pMenubar->addMenu( trUtf8("RecordMyDesktop") );
+ m_pRMD->addAction( trUtf8( "Set Window Size to 1024 x 768" ), this, SLOT( action_resize_mainWindow1024x768( ) ) );
+ m_pRMD->addAction( trUtf8( "Start record" ), this, SLOT( startRmD() ) );
+ m_pRMD->addAction( trUtf8( "STOP record" ), this, SLOT( stopRmD() ) );
+ //~ DEBUG menu
+ }
+
// INFO menu
QMenu *m_pInfoMenu = m_pMenubar->addMenu( trUtf8( "&Info" ) );
m_pInfoMenu->addAction( trUtf8("&User manual"), this, SLOT( showUserManual() ), QKeySequence( "Ctrl+?" ) );
@@ -297,7 +316,6 @@
-
void MainForm::onLashPollTimer()
{
#ifdef LASH_SUPPORT
@@ -1430,7 +1448,12 @@
}
+void MainForm::action_resize_mainWindow1024x768( )
+{
+ resize(1024,768);
+}
+
void MainForm::errorEvent( int nErrorCode )
{
//ERRORLOG( "[errorEvent]" );
@@ -1693,3 +1716,76 @@
}
return rv;
}
+
+
+
+void MainForm::startRmD()
+{
+ if( __rmd->state()>0 ){
+ QMessageBox::warning( this, "Hydrogen", trUtf8("Recording is running. Please Stop recording first.") );
+ return;
+ }
+
+
+ QString program = "/usr/local/bin/recordmydesktop";
+ QStringList arguments;
+
+ arguments << "-x" << QString(" %1").arg( x() )
+ << "-y" << QString(" %1").arg( y() )
+ << "-width" << QString("%1").arg(width())
+ << "-height" << QString("%1").arg(height())
+ << "--fps" << "15"
+ << "--v_quality" << QString("%1").arg(63)
+ << "--v_bitrate" << QString("%1").arg(2000000)
+ << "-use-jack" << "Hydrogen:out_L" << "Hydrogen:out_R"
+ << "--s_quality" << "10"
+ << "-o"<< "h2-video";
+
+
+ __rmd->start(program, arguments);
+
+ if( __rmd->state()>0 ){
+ m_pRMD->clear();
+ m_pRMD->addAction( trUtf8( "STOP record" ), this, SLOT( stopRmD() ) );
+ }
+
+}
+
+
+
+void MainForm::stopRmD()
+{
+ if( __rmd->state()>0 ){
+ __rmd->terminate ();
+ m_pRMD->clear();
+ m_pRMD->addAction( trUtf8( "STOP encoding" ), this, SLOT( stopRmD() ) );
+ __rmdtimer->start(800);
+ ERRORLOG("starte timer");
+ }else
+ {
+ m_pRMD->clear();
+ m_pRMD->addAction( trUtf8( "Set Window Size to 1024 x 768" ), this, SLOT( action_resize_mainWindow1024x768( ) ) );
+ m_pRMD->addAction( trUtf8( "Start record" ), this, SLOT( startRmD() ) );
+ m_pRMD->addAction( trUtf8( "STOP record" ), this, SLOT( stopRmD() ) );
+ __rmdtimer->stop();
+ ERRORLOG("stoppe timer");
+ return;
+ }
+
+
+}
+
+
+
+void MainForm::checkRmD()
+{
+ if( __rmd->state()>0 ){
+ h2app->setStatusBarMessage ( trUtf8 ( "R-M-D ENCODING DATA." ), 400 );
+
+ }else
+ {
+ stopRmD();
+
+ }
+
+}
Index: gui/src/main.cpp
===================================================================
--- gui/src/main.cpp (Revision 1446)
+++ gui/src/main.cpp (Arbeitskopie)
@@ -57,6 +57,7 @@
{"song", required_argument, NULL, 's'},
{"version", 0, NULL, 'v'},
{"nosplash", 0, NULL, 'n'},
+ {"rmd", 0, NULL, 'r'},
{"verbose", optional_argument, NULL, 'V'},
{"help", 0, NULL, 'h'},
{"install", required_argument, NULL, 'i'},
@@ -147,6 +148,7 @@
// Deal with the options
QString songFilename;
bool bNoSplash = false;
+ bool bRmd = false;
QString sSelectedDriver;
bool showVersionOpt = false;
const char* logLevelOpt = "Error";
@@ -187,6 +189,9 @@
case 'n':
bNoSplash = true;
break;
+ case 'r':
+ bRmd = true;
+ break;
case 'h':
case '?':
@@ -296,6 +301,8 @@
else {
pSplash->show();
}
+
+ pPref->__rmd = bRmd;
#ifdef LASH_SUPPORT
if ( H2Core::Preferences::get_instance()->useLash() ){
@@ -404,6 +411,7 @@
<< " from a crash." << std::endl;
#endif
std::cout << " -n, --nosplash - Hide splash screen" << std::endl;
+ std::cout << " -r, --rmd - Enable recordmydesktop control" << std::endl;
std::cout << " -V[Level], --verbose[=Level] - Print a lot of debugging info" << std::endl;
std::cout << " Level, if present, may be None, Error, Warning, Info, Debug or 0xHHHH" << std::endl;
std::cout << " -v, --version - Show version info" << std::endl;
Index: gui/src/MainForm.h
===================================================================
--- gui/src/MainForm.h (Revision 1446)
+++ gui/src/MainForm.h (Arbeitskopie)
@@ -103,8 +103,12 @@
void onLashPollTimer();
private slots:
+ void action_resize_mainWindow1024x768();
+ void startRmD();
+ void stopRmD();
void onAutoSaveTimer();
void onPlaylistDisplayTimer();
+ void checkRmD();
protected:
// Returns true if handled, false if aborted.
@@ -120,6 +124,8 @@
QAction *m_pRecentFileAction3;
QAction *m_pRecentFileAction4;
+ QProcess *__rmd;
+
QHttp m_http;
QTimer m_autosaveTimer;
@@ -140,7 +146,12 @@
#ifdef LASH_SUPPORT
QTimer *lashPollTimer;
#endif
+ QTimer *__rmdtimer;
+ QMenu *m_pRMD;
+
+
+
};
#endif
Index: libs/hydrogen/include/hydrogen/Preferences.h
===================================================================
--- libs/hydrogen/include/hydrogen/Preferences.h (Revision 1446)
+++ libs/hydrogen/include/hydrogen/Preferences.h (Arbeitskopie)
@@ -230,6 +230,8 @@
///Default text editor (used by Playlisteditor)
QString m_sDefaultEditor;
+ /// enable record my desktop menue
+ bool __rmd;
/// Returns an instance of PreferencesMng class
static void create_instance();
static Preferences* get_instance() { assert(__instance); return __instance; }
Index: libs/hydrogen/include/hydrogen/Object.h
===================================================================
--- libs/hydrogen/include/hydrogen/Object.h (Revision 1446)
+++ libs/hydrogen/include/hydrogen/Object.h (Arbeitskopie)
@@ -78,6 +78,10 @@
static void set_log_level(unsigned lev) { __log_level = lev; }
static unsigned get_log_level() { return __log_level; }
+ static void set_record_my_desktop( bool rmd ){ __record_my_desktop = rmd; }
+ static bool get_record_my_desktop() { return __record_my_desktop; }
+
+
void log( unsigned lev, const char* funcname, const QString& class_name, const QString& msg );
friend void* loggerThread_func(void* param); // object.cpp
@@ -107,6 +111,7 @@
queue_t __msg_queue;
static unsigned __log_level; // A bitmask of log_level_t
+ static bool __record_my_desktop;
/** Constructor */
Logger();
Index: libs/hydrogen/src/preferences.cpp
===================================================================
--- libs/hydrogen/src/preferences.cpp (Revision 1446)
+++ libs/hydrogen/src/preferences.cpp (Arbeitskopie)
@@ -189,6 +189,8 @@
m_bJackTrackOuts = false;
m_nJackTrackOutputMode = 0;
m_bJackMasterMode = false ;
+ /// enable record my desktop menue
+ __rmd = false;
// None: m_sDefaultEditor;
// SEE ABOVE: m_sDataDirectory
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel