Qt로 MPlayer를 제어하던 중 문제가 발생했습니다.

iyn18의 이미지

안녕하세요.
저는 요즘 한창 Qt로 MPlayer를 제어하는 중입니다.
4주동안 온갖 삽질과 뻘짓을 해가면서
마침내 QT/X11 콘솔로 컴파일을 했을 때는 아무 문제없이 실행이 잘 됩니다.
그런데, 이걸 가상 프레임 버퍼로 실행했을 때는 제가 생각한 방향과는 정반대로 실행되네요......
어떤 분은 winId() 값의 문제라고 말씀하시던데,
저는 어디가 문제인지 잘 모르겠습니다.

//여기서부터는 소스입니다.
#include "moviemainwindow.h"

#include
#include
#include
#include
#include
#include
#include
#include
#include

/*
* Constructs a MovieMainWindow as a child of 'parent', with the
* name 'name' and widget flags set to 'f'.
*
*/
MovieMainWindow::MovieMainWindow( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
// (void)statusBar();
if ( !name )
setName( "MovieMainWindow" );

//위젯 내부의 위젯 screen을 생성합니다.
this->screen = new ScreenMainWindow(this, "", WStyle_Customize|WStyle_NormalBorder);
this->screen->move( QPoint(0, 0) );
this->screen->show();

this->playBtn = new QPushButton("play", this);
this->playBtn->setGeometry( 60, 180, 40, 30 );

this->pauseBtn = new QPushButton("pause", this);
this->pauseBtn->setGeometry( 100, 180, 40, 30 );

this->stopBtn = new QPushButton("stop", this);
this->stopBtn->setGeometry( 140, 180, 40, 30);

QObject::connect(playBtn, SIGNAL(clicked()), this, SLOT(play()));
QObject::connect(pauseBtn, SIGNAL(clicked()), this, SLOT(pause()));
QObject::connect(stopBtn, SIGNAL(clicked()), this, SLOT(stop()));

languageChange();
resize( QSize(240, 210).expandedTo(minimumSizeHint()) );
clearWState( WState_Polished );

}

/*
* Destroys the object and frees any allocated resources
*/
MovieMainWindow::~MovieMainWindow()
{
// no need to delete child widgets, Qt does it all for us
}

/*
* Sets the strings of the subwidgets using the current
* language.
*/
void MovieMainWindow::languageChange()
{
setCaption( tr( "Movie" ) );
}

//재생 부분입니다.
void MovieMainWindow::play()
{
this->proc1 = new QProcess(this);
this->proc1->addArgument( "mplayer" );
this->proc1->addArgument( "-slave" );
this->proc1->addArgument( "-identify" );
this->proc1->addArgument( "-quiet" );
this->proc1->addArgument( "-wid" );
this->proc1->addArgument( this->WID.setNum((int)(this->screen->winId())) );
this->proc1->addArgument( "/MPlayer/MPlayer-1.0pre8/[P]test.avi" );
this->proc1->start();
}

//일시정지구요.
void MovieMainWindow::pause()
{
this->proc1->writeToStdin( "pause\n" );
}

//정지할 때 완전히 엠플레이어를 종료하도록 설정했습니다.
void MovieMainWindow::stop()
{
this->proc1->writeToStdin( "quit\n" );
}

X11에서는 제가 의도한 대로 위젯의 내부에 MPlayer가 재생됩니다.
하지만, 가상 프레임 버퍼에서 실행했을 때는 모니터의 한가운데에서 MPlayer가 단독으로 실행됩니다.
누군가 해결책을 좀 제시해 주시면 정말 감사하겠습니다.
오늘내일 안에 결과물을 내야 하는 거라서요....다시금 부탁드립니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.