summaryrefslogtreecommitdiffstats
path: root/DOCS/client_api_examples/qtexample.cpp
Commit message (Collapse)AuthorAgeFilesLines
* DOCS/client_api_examples: move all examples into their own subdirswm42015-01-011-216/+0
| | | | | Also get rid of shared.h; it actually doesn't have much value. Just copy the tiny function it contained into the 2 files which used it.
* DOCS/client_api_examples: don't throw char* in C++ codewm42015-01-011-2/+3
| | | | | | | C++ is the worst language ever, and allows throwing any type, even if it doesn't make sense. In this case, we were throwing char*, which the runtime typically treats as opaque, instead of printing it as message if such an exception was not caught.
* DOCS/client_api_examples: add an explicit licensewm42014-12-301-2/+0
| | | | IANAL, but we don't give a shit what you do with this code.
* DOCS/client_api_examples: qtexample: use queued signalswm42014-12-301-16/+14
| | | | | | | | Use queued signals instead of QEvent for the wakeup notification. This is slightly nicer, and reduces the chance that the event (QEvent::User) could clash with other code using the same event. Also switch to modern connect() syntax.
* DOCS/client_api_examples: qtexample: don't require Qt 5.xwm42014-10-171-0/+7
| | | | Exclude the worthless Qt 5.0-only demo code on Qt 4.x.
* DOCS/client_api_examples: qtexample: set a magic Qt flagwm42014-10-161-0/+1
| | | | | | Otherwise, other magic Qt stuff can be magically broken. (No, I don't know the real reasons for this.)
* DOCS/client_api_examples: qtexample: embedding works on Cocoawm42014-10-161-2/+1
|
* DOCS/client_api_examples: qtexample: remove debugging codewm42014-10-141-2/+1
| | | | Forgotten.
* DOCS/client_api_examples: qtexample: stuffwm42014-10-131-6/+28
| | | | | | Dump chapters and track list to the log for demo purposes. Compile in debug mode.
* client API: rename --input-x11-keyboard to --input-vo-keyboardwm42014-10-091-2/+2
| | | | | Apparently we need this for Cocoa too. (The option was X11 specific in the hope that only X11 would need this hack.)
* DOCS/client_api_examples: qtexample: add a log windowwm42014-10-081-0/+26
| | | | | | | | For the purpose of demonstration. Also make the windows larger. I'm not exactly sure how Qt determines the default window sizes, but here they are a bit tiny, so force them larger.
* DOCS/client_api_examples: qtexample: set the localeJames Ross-Gowan2014-10-071-0/+6
| | | | | | | QApplication sets the locale, so change the LC_NUMERIC category back to "C" for libmpv. See: http://qt-project.org/doc/qt-5/qcoreapplication.html#locale-settings
* DOCS/client_api_examples: qtexample: remove broken resizingwm42014-09-281-8/+6
| | | | | | | | | The intention was to adjust the window size to video size. It never worked well; it prevented the user to make the window smaller. For unknown reason it stopped resizing properly as well. This is just a cheap example, and I don't intend to fight with Qt, so replace the "demonstration" behavior by something slightly lamer.
* client API, X11: change default keyboard input handling againwm42014-09-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64b7811c tried to do the "right thing" with respect to whether keyboard input should be enabled or not. It turns out that X11 does something stupid by design. All modern toolkits work around this native X11 behavior, but embedding breaks these workarounds. The only way to handle this correctly is the XEmbed protocol. It needs to be supported by the toolkit, and probably also some mpv support. But Qt has inconsistent support for it. In Qt 4, a X11 specific embedding widget was needed. Qt 5.0 doesn't support it at all. Qt 5.1 apparently supports it via QWindow, but if it really does, I couldn't get it to work. So add a hack instead. The new --input-x11-keyboard option controls whether mpv should enable keyboard input on the X11 window or not. In the command line player, it's enabled by default, but in libmpv it's disabled. This hack has the same problem as all previous embedding had: move the mouse outside of the window, and you don't get keyboard input anymore. Likewise, mpv will steal all keyboard input from the parent application as long as the mouse is inside of the mpv window. Also see issue #1090.
* DOCS/client_api_examples: qtexample: resize to video sizewm42014-09-151-0/+21
| | | | | | | | | | | | | This is pretty imperfect, but it's just a demo. The main purpose is clarifying how and when to get the video size. In theory, retrieving the properties this way has a race condition: after reading dwidth, the video could resize again. But the worst that can happen are mismatching dwidth/dheight values, and the MPV_EVENT_VIDEO_RECONFIG event would be immediately received again, which would fix the mismatch. You could read the full video-out-params property to absolutely avoid it, but it's not worth the trouble.
* client API: qtexample: don't pass deallocated strings to mpvwm42014-08-071-1/+2
| | | | | The temporary QByteArray is deallocated already at the end of the statement in C++, instead of the end of the scope (like in C).
* DOCS/client_api_examples: add a Qt examplewm42014-07-041-0/+135
This is pretty dumb and extremely basic. The main purpose is demonstrating how to integrate mpv into the Qt GUI thread.