pax_global_header00006660000000000000000000000064151322550230014510gustar00rootroot0000000000000052 comment=ebbe714f87109cb56cc1b13e6fdb81ca9b580595 bplaum-gmerlin-ebbe714/000077500000000000000000000000001513225502300151165ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/ABOUT-NLS000066400000000000000000002671331513225502300163610ustar00rootroot000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. bplaum-gmerlin-ebbe714/AUTHORS000066400000000000000000000006001513225502300161620ustar00rootroot00000000000000Main concept and programming: Burkhard Plaum (plaum@ipf.uni-stuttgart.de) Beta tester and programmer: Michael Grünert (one78@web.de) Additional beta testers and feature suggesters: Uwe Niethammer Andreas Gräble Icons: From various sources, most notably the Gnome project (http://www.gnome.org) and noteedit (http://rnvs.informatik.tu-chemnitz.de/~jan/noteedit/noteedit.html). bplaum-gmerlin-ebbe714/COPYING000066400000000000000000000431101513225502300161500ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. bplaum-gmerlin-ebbe714/ChangeLog000066400000000000000000000040071513225502300166710ustar00rootroot000000000000002014-06-15 gettextize * m4/gettext.m4: Upgrade to gettext-0.18.3. * m4/iconv.m4: Upgrade to gettext-0.18.3. * m4/lib-ld.m4: Upgrade to gettext-0.18.3. * m4/lib-link.m4: Upgrade to gettext-0.18.3. * m4/lib-prefix.m4: Upgrade to gettext-0.18.3. * m4/nls.m4: Upgrade to gettext-0.18.3. * m4/po.m4: Upgrade to gettext-0.18.3. * m4/progtest.m4: Upgrade to gettext-0.18.3. 2007-02-12 gettextize * m4/codeset.m4: New file, from gettext-0.15. * m4/gettext.m4: New file, from gettext-0.15. * m4/glibc2.m4: New file, from gettext-0.15. * m4/glibc21.m4: New file, from gettext-0.15. * m4/iconv.m4: New file, from gettext-0.15. * m4/intdiv0.m4: New file, from gettext-0.15. * m4/intmax.m4: New file, from gettext-0.15. * m4/inttypes_h.m4: New file, from gettext-0.15. * m4/inttypes-h.m4: New file, from gettext-0.15. * m4/inttypes-pri.m4: New file, from gettext-0.15. * m4/lcmessage.m4: New file, from gettext-0.15. * m4/lib-ld.m4: New file, from gettext-0.15. * m4/lib-link.m4: New file, from gettext-0.15. * m4/lib-prefix.m4: New file, from gettext-0.15. * m4/lock.m4: New file, from gettext-0.15. * m4/longdouble.m4: New file, from gettext-0.15. * m4/longlong.m4: New file, from gettext-0.15. * m4/nls.m4: New file, from gettext-0.15. * m4/po.m4: New file, from gettext-0.15. * m4/printf-posix.m4: New file, from gettext-0.15. * m4/progtest.m4: New file, from gettext-0.15. * m4/signed.m4: New file, from gettext-0.15. * m4/size_max.m4: New file, from gettext-0.15. * m4/stdint_h.m4: New file, from gettext-0.15. * m4/uintmax_t.m4: New file, from gettext-0.15. * m4/ulonglong.m4: New file, from gettext-0.15. * m4/visibility.m4: New file, from gettext-0.15. * m4/wchar_t.m4: New file, from gettext-0.15. * m4/wint_t.m4: New file, from gettext-0.15. * m4/xsize.m4: New file, from gettext-0.15. * m4/Makefile.am (EXTRA_DIST): Add the new files. * Makefile.am (SUBDIRS): Add po. (EXTRA_DIST): Add config.rpath. * configure.ac (AC_CONFIG_FILES): Add po/Makefile.in. bplaum-gmerlin-ebbe714/INSTALL000066400000000000000000000366141513225502300161610ustar00rootroot00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. bplaum-gmerlin-ebbe714/Makefile.am000066400000000000000000000006401513225502300171520ustar00rootroot00000000000000# aclocal Path ACLOCAL_AMFLAGS = -I m4 if HAVE_GTK gtk_pc = gmerlin-gtk.pc else gtk_pc = endif SUBDIRS = iconfont web lib plugins tests apps icons include m4 utils . po doc pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gmerlin.pc $(gtk_pc) pkgdatadir = $(datadir)/gmerlin/ pkgdata_DATA = plugin.sym dist_pkgdata_DATA = plugin.sym EXTRA_DIST= \ config.rpath \ gmerlin.pc.in \ autogen.sh \ make_potfiles bplaum-gmerlin-ebbe714/NEWS000066400000000000000000000000001513225502300156030ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/README000066400000000000000000000026141513225502300160010ustar00rootroot00000000000000This is gmerlin, a set of multimedia libraries bundled with an application suite. Gmerlin depends on gavl, the lower level support library. Decoding Audio/video files is handled by gmerlin-avdecoder. Most encoding plugins are in the gmerlin-encoders package. This package contains the core libraries, some plugins and most applications. For installation instructions and troubleshooting tips, read the file INSTALL. The following applications are included in this package: - GUI Media Player: Just type gmerlin to start this. It's a media player, which lets you access media directories, web streams, podcasts and more through a tree like structure. - Media renderer: This is the player engine as a background service. It can be accessed via upnp or via the gmerlin native protocol. - Media server: This is the media database part as a background service. It can be accessed by DLNA devices via Upnp or via the gmerlin native protocol. Also included is a web based GUI - Transcoder: Type gmerlin-transcoder to start this. It works very simple: First, add tracks to the tasklist. Then, edit options (Metadata, encoder settings...) for each track. The task list can then be saved for later use. After all tracks are configured, start transcoding. Gmerlin is known to run on Intel Desktop systems and on the Raspberry PI 4. The media renderer also plays audio on a headless Raspberry PI Zero W. bplaum-gmerlin-ebbe714/TODO000066400000000000000000000000011513225502300155750ustar00rootroot00000000000000 bplaum-gmerlin-ebbe714/acinclude.m4000066400000000000000000000464521513225502300173220ustar00rootroot00000000000000dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS]) dnl check if $CC supports a given set of cflags AC_DEFUN([AC_TRY_CFLAGS], [AC_MSG_CHECKING([if $CC supports $1 flags]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$1" AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_RESULT([$ac_cv_try_cflags_ok]) if test x"$ac_cv_try_cflags_ok" = x"yes"; then ifelse([$2],[],[:],[$2]) else ifelse([$3],[],[:],[$3]) fi]) dnl Configure Paths for Alsa dnl Some modifications by Richard Boulton dnl Christopher Lansdown dnl Jaroslav Kysela dnl Last modification: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. dnl enables arguments --with-alsa-prefix= dnl --with-alsa-enc-prefix= dnl --disable-alsatest dnl dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. dnl AC_DEFUN([AM_PATH_ALSA], [dnl Save the original CFLAGS, LDFLAGS, and LIBS alsa_save_CFLAGS="$CFLAGS" alsa_save_LDFLAGS="$LDFLAGS" alsa_save_LIBS="$LIBS" alsa_found=yes dnl dnl Get the cflags and libraries for alsa dnl AC_ARG_WITH(alsa-prefix, [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], [alsa_prefix="$withval"], [alsa_prefix=""]) AC_ARG_WITH(alsa-inc-prefix, [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) dnl FIXME: this is not yet implemented AC_ARG_ENABLE(alsatest, [ --disable-alsatest Do not try to compile and run a test Alsa program], [enable_alsatest="$enableval"], [enable_alsatest=yes]) dnl Add any special include directories AC_MSG_CHECKING(for ALSA CFLAGS) if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi AC_MSG_RESULT($ALSA_CFLAGS) CFLAGS="$alsa_save_CFLAGS" dnl add any special lib dirs AC_MSG_CHECKING(for ALSA LDFLAGS) if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" fi dnl add the alsa library ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" LIBS="$ALSA_LIBS $LIBS" AC_MSG_RESULT($ALSA_LIBS) dnl Check for a working version of libasound that is of the right version. min_alsa_version=ifelse([$1], ,0.1.1,$1) AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` alsa_min_minor_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` alsa_min_micro_version=`echo $min_alsa_version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` AC_LANG_SAVE AC_LANG_C AC_TRY_COMPILE([ #include ], [ /* ensure backward compatibility */ #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR #endif #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR #endif #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR #endif # if(SND_LIB_MAJOR > $alsa_min_major_version) exit(0); # else # if(SND_LIB_MAJOR < $alsa_min_major_version) # error not present # endif # if(SND_LIB_MINOR > $alsa_min_minor_version) exit(0); # else # if(SND_LIB_MINOR < $alsa_min_minor_version) # error not present # endif # if(SND_LIB_SUBMINOR < $alsa_min_micro_version) # error not present # endif # endif # endif exit(0); ], [AC_MSG_RESULT(found.)], [AC_MSG_RESULT(not present.) ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) alsa_found=no] ) AC_LANG_RESTORE dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. if test "x$enable_alsatest" = "xyes"; then AC_CHECK_LIB([asound], [snd_ctl_open],, [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) alsa_found=no] ) fi LDFLAGS="$alsa_save_LDFLAGS" LIBS="$alsa_save_LIBS" if test "x$alsa_found" = "xyes" ; then ifelse([$2], , :, [$2]) else ALSA_CFLAGS="" ALSA_LIBS="" ifelse([$3], , :, [$3]) fi dnl That should be it. Now just export out symbols: AC_SUBST(ALSA_CFLAGS) AC_SUBST(ALSA_LIBS) ]) # Configure paths for ESD # Manish Singh 98-9-30 # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS dnl AC_DEFUN([AM_PATH_ESD], [dnl dnl Get the cflags and libraries from the esd-config script dnl AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], esd_prefix="$withval", esd_prefix="") AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], esd_exec_prefix="$withval", esd_exec_prefix="") AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], , enable_esdtest=yes) if test x$esd_exec_prefix != x ; then esd_args="$esd_args --exec-prefix=$esd_exec_prefix" if test x${ESD_CONFIG+set} != xset ; then ESD_CONFIG=$esd_exec_prefix/bin/esd-config fi fi if test x$esd_prefix != x ; then esd_args="$esd_args --prefix=$esd_prefix" if test x${ESD_CONFIG+set} != xset ; then ESD_CONFIG=$esd_prefix/bin/esd-config fi fi AC_PATH_PROG(ESD_CONFIG, esd-config, no) min_esd_version=ifelse([$1], ,0.2.7,$1) AC_MSG_CHECKING(for ESD - version >= $min_esd_version) no_esd="" if test "$ESD_CONFIG" = "no" ; then no_esd=yes else AC_LANG_SAVE AC_LANG_C ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` esd_major_version=`$ESD_CONFIG $esd_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` esd_minor_version=`$ESD_CONFIG $esd_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_esdtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $ESD_CFLAGS" LIBS="$LIBS $ESD_LIBS" dnl dnl Now check if the installed ESD is sufficiently new. (Also sanity dnl checks the results of esd-config to some extent dnl rm -f conf.esdtest AC_TRY_RUN([ #include #include #include #include char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.esdtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_esd_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_esd_version"); exit(1); } if (($esd_major_version > major) || (($esd_major_version == major) && ($esd_minor_version > minor)) || (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) { return 0; } else { printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); printf("*** to point to the correct copy of esd-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi if test "x$no_esd" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$ESD_CONFIG" = "no" ; then echo "*** The esd-config script installed by ESD could not be found" echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the ESD_CONFIG environment variable to the" echo "*** full path to esd-config." else if test -f conf.esdtest ; then : else echo "*** Could not run ESD test program, checking why..." CFLAGS="$CFLAGS $ESD_CFLAGS" LIBS="$LIBS $ESD_LIBS" AC_LANG_SAVE AC_LANG_C AC_TRY_LINK([ #include #include ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding ESD or finding the wrong" echo "*** version of ESD. If it is not finding ESD, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means ESD was incorrectly installed" echo "*** or that you have moved ESD since it was installed. In the latter case, you" echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" AC_LANG_RESTORE fi fi ESD_CFLAGS="" ESD_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(ESD_CFLAGS) AC_SUBST(ESD_LIBS) rm -f conf.esdtest ]) dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]]) dnl Test, whether esd supports multiple recording clients (version >=0.2.21) dnl AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD], [dnl AC_MSG_NOTICE([whether installed esd version supports multiple recording clients]) ac_save_ESD_CFLAGS="$ESD_CFLAGS" ac_save_ESD_LIBS="$ESD_LIBS" AM_PATH_ESD(0.2.21, ifelse([$1], , [ AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true) AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1, [Define if you have esound with support of multiple recording clients.])], [$1]), ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2]) if test "x$ac_save_ESD_CFLAGS" != x ; then ESD_CFLAGS="$ac_save_ESD_CFLAGS" fi if test "x$ac_save_ESD_LIBS" != x ; then ESD_LIBS="$ac_save_ESD_LIBS" fi ) ]) # Configure paths for GTK+ # Owen Taylor 1997-2001 dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl AC_DEFUN([AM_PATH_GTK_3_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) pkg_config_args=gtk+-3.0 for module in . $4 do case "$module" in gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done no_gtk="" AC_PATH_PROG(PKG_CONFIG, pkg-config, no) if test x$PKG_CONFIG != xno ; then if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then : else echo "*** pkg-config too old; version 0.7 or better required." no_gtk=yes PKG_CONFIG=no fi else no_gtk=yes fi min_gtk_version=ifelse([$1], ,3.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH" enable_gtktest=no fi if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then : else no_gtk=yes fi fi if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl dnl Now check if the installed GTK+ is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; fclose (fopen ("conf.gtktest", "w")); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://pkgconfig.sourceforge.net" else if test -f conf.gtktest ; then : else echo "*** Could not run GTK+ test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK+ or finding the wrong" echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Tests for BACKEND-NAME in the GTK targets list dnl AC_DEFUN([GTK_CHECK_BACKEND], [ pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0) min_gtk_version=ifelse([$2],,3.0.0,$2) AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])]) if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args ; then target_found=yes else target_found=no fi if test "x$target_found" = "xno"; then ifelse([$4],,[AC_MSG_ERROR([Backend $backend not found.])],[$4]) else ifelse([$3],,[:],[$3]) fi ]) bplaum-gmerlin-ebbe714/apps/000077500000000000000000000000001513225502300160615ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/Makefile.am000066400000000000000000000006021513225502300201130ustar00rootroot00000000000000 if HAVE_PLAYER player_subdirs = player else player_subdirs = endif if HAVE_TRANSCODER transcoder_subdirs = transcoder else transcoder_subdirs = endif if HAVE_THUMBNAILER thumbnailer_subdirs = thumbnailer else thumbnailer_subdirs = endif SUBDIRS = $(player_subdirs) \ cmdlineplayer \ mdb-tool \ mediainfo \ remote \ renderer \ server \ $(transcoder_subdirs) \ $(thumbnailer_subdirs) bplaum-gmerlin-ebbe714/apps/cmdlineplayer/000077500000000000000000000000001513225502300207115ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/cmdlineplayer/Makefile.am000066400000000000000000000005121513225502300227430ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = gmerlin-play gmerlin_play_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl bplaum-gmerlin-ebbe714/apps/cmdlineplayer/gmerlin-play.c000066400000000000000000000225461513225502300234660ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "gmerlin-play" /* In commandline apps, global variables are allowed :) */ int num_tracks; int current_track = -1; bg_player_t * player; bg_controllable_t * player_ctrl; bg_cfg_ctx_t * cfg; int display_time = 1; char ** uris = NULL; int uri_index = 0; const bg_plugin_info_t * ov_info = NULL; char * window_id = NULL; int subtitle_stream = -1; int audio_stream = 0; char * track_spec = NULL; char * track_spec_ptr; static bg_frontend_t ** frontends = NULL; int num_frontends = 0; gavl_array_t fe_arr; /* * Commandline options stuff */ static void opt_fullscreen(void * data, int * argc, char *** _argv, int arg) { bg_player_set_fullscreen(player_ctrl->cmd_sink, 1); } static void opt_vis(void * data, int * argc, char *** _argv, int arg) { char * plugin_name; gavl_dictionary_t vars; gavl_dictionary_init(&vars); if(arg >= *argc) { fprintf(stderr, "Option -vis requires an argument\n"); exit(-1); } plugin_name = gavl_strdup((*_argv)[arg]); gavl_url_get_vars(plugin_name, &vars); bg_cfg_section_apply(&vars, cfg[BG_PLAYER_CFG_VISUALIZATION].parameters, bg_cfg_section_set_parameter_func, cfg[BG_PLAYER_CFG_VISUALIZATION].s); bg_player_set_visualization(player_ctrl->cmd_sink, plugin_name); bg_cmdline_remove_arg(argc, _argv, arg); gavl_dictionary_free(&vars); free(plugin_name); } static void opt_nt(void * data, int * argc, char *** _argv, int arg) { display_time = 0; } static void opt_fe(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_vol(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -vol requires an argument\n"); exit(-1); } bg_player_set_volume(player_ctrl->cmd_sink, strtod((*_argv)[arg], NULL)); bg_cmdline_remove_arg(argc, _argv, arg); } static void opt_tracks(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -tracks requires an argument\n"); exit(-1); } track_spec = gavl_strrep(track_spec, (*_argv)[arg]); track_spec_ptr = track_spec; bg_cmdline_remove_arg(argc, _argv, arg); } static void opt_as(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -as requires an argument\n"); exit(-1); } audio_stream = atoi((*_argv)[arg]) - 1; bg_cmdline_remove_arg(argc, _argv, arg); } static void opt_ss(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -ss requires an argument\n"); exit(-1); } subtitle_stream = atoi((*_argv)[arg]) - 1; bg_cmdline_remove_arg(argc, _argv, arg); } // static void opt_help(void * data, int * argc, char *** argv, int arg); static bg_cmdline_arg_t global_options[] = { BG_PLUGIN_OPT_INPUT, { .arg = "-vis", .help_arg = "plugin_name[?option1=value1[&...]]", .help_string = "Set visualization plugin", .callback = opt_vis, }, { .arg = "-fullscreen", .help_string = "Switch to fullscreen mode", .callback = opt_fullscreen, }, BG_PLUGIN_OPT_OA, BG_PLUGIN_OPT_OV, BG_PLUGIN_OPT_FA, BG_PLUGIN_OPT_FV, { .arg = "-nt", .help_string = "Disable time display", .callback = opt_nt, }, { .arg = "-vol", .help_arg = "", .help_string = "Set volume (0.0 - 1.0)", .callback = opt_vol, }, { .arg = "-tracks", .help_arg = "", .help_string = " can be a ranges mixed with comma separated tracks", .callback = opt_tracks, }, { .arg = "-as", .help_arg = "", .help_string = "Selects audio stream index (starting with 1)", .callback = opt_as, }, { .arg = "-ss", .help_arg = "", .help_string = "Selects subtitle stream index (starting with 1)", .callback = opt_ss, }, BG_OPT_LIST_RECORDERS, BG_PLUGIN_OPT_LIST_INPUT, BG_OPT_LIST_OA, BG_OPT_LIST_OV, BG_PLUGIN_OPT_LIST_FA, BG_PLUGIN_OPT_LIST_FV, BG_PLUGIN_OPT_LIST_VIS, BG_PLUGIN_OPT_LIST_OPTIONS, { .arg = "-fe", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of frontends. Use -list-fe to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe, }, { .arg = "-list-fe", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_renderer, }, { /* End of options */ } }; /* Input plugin stuff */ static int play_track(bg_player_t * player, const char * uri) { bg_player_load_uri(player_ctrl->cmd_sink, uri, 1); return 1; } const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options] uri...\n"), .help_before = TRS("Commandline mediaplayer\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), global_options }, { } }, .files = (bg_cmdline_ext_doc_t[]) { { "~/.gmerlin/plugins.xml", TRS("Cache of the plugin registry (shared by all applications)") }, { "~/.gmerlin/generic/cfg.xml", TRS("Default plugin parameters are read from there. Use gmerlin_plugincfg to change them.") }, { /* End */ } }, }; int main(int argc, char ** argv) { gavl_dictionary_t * cfg_section; gavl_array_init(&fe_arr); bg_frontend_set_option(&fe_arr, "console"); bg_app_init("gmerlin-play", TRS("Gmerlin commandline player"), "renderer"); bg_iconfont_init(); /* Create plugin regsitry */ bg_plugins_init(); player = bg_player_create(); /* Quit when playqueue is empty */ bg_player_set_empty_mode(player, 1); cfg = bg_cfg_ctx_copy_array(bg_player_get_cfg(player)); player_ctrl = bg_player_get_controllable(player); bg_player_set_volume(player_ctrl->cmd_sink, 0.5); /* Apply default options */ cfg_section = bg_cfg_registry_find_section(bg_cfg_registry, "player"); /* Change our local copy of the configuration */ bg_cfg_ctx_set_cb_array(cfg, NULL, NULL); /* Create config sections */ bg_cfg_ctx_array_create_sections(cfg, cfg_section); bg_cfg_ctx_set_sink_array(cfg, player_ctrl->cmd_sink); /* Get commandline options */ bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); bg_player_apply_cmdline(cfg); bg_cfg_ctx_apply_array(cfg); /* Create frontend */ frontends = bg_frontends_create(player_ctrl, BG_PLUGIN_FRONTEND_RENDERER, &fe_arr, &num_frontends); uris = bg_cmdline_get_locations_from_args(&argc, &argv); if(!uris) { fprintf(stderr, "No input files given\n"); return 0; } /* Start the player thread */ bg_player_run(player); fprintf(stderr, "Setting audio stream %d\n", audio_stream); bg_player_set_audio_stream(player_ctrl->cmd_sink, audio_stream); fprintf(stderr, "Setting subtitle stream %d\n", subtitle_stream); bg_player_set_subtitle_stream(player_ctrl->cmd_sink, subtitle_stream); /* Play first track */ play_track(player, uris[uri_index]); /* Main loop */ while(1) { int result; gavl_time_t delay_time = GAVL_TIME_SCALE / 100; if(bg_player_get_status(player) == BG_PLAYER_STATUS_QUIT) break; result = bg_frontends_ping(frontends, num_frontends); if(!result) gavl_time_delay(&delay_time); } bg_player_quit(player); bg_player_destroy(player); // bg_cfg_registry_save(); fprintf(stderr, "gmerlin_play finished\n"); bg_global_cleanup(); return 0; } bplaum-gmerlin-ebbe714/apps/mdb-tool/000077500000000000000000000000001513225502300175765ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/mdb-tool/Makefile.am000066400000000000000000000005051513225502300216320ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = mdb-tool mdb_tool_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl bplaum-gmerlin-ebbe714/apps/mdb-tool/mdb-tool.c000066400000000000000000000170031513225502300214600ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #define LOG_DOMAIN "mdb-tool" #include #include #include #include #include #include #include #include #include // static int do_create = 0; // static int do_monitor = 0; char * path = NULL; bg_mdb_t * mdb = NULL; bg_controllable_t * mdb_ctrl = NULL; bg_websocket_connection_t * conn = NULL; static int ensure_mdb(int do_create) { if(do_create) { if(gavl_string_starts_with(path, "gmerlin-mdb://")) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "create option does not work with remote DBs"); return 0; } else { if(!(mdb = bg_mdb_create(path, 1, NULL))) return 0; mdb_ctrl = bg_mdb_get_controllable(mdb); } } else { if(gavl_string_starts_with(path, "gmerlin-mdb://")) { if(!(conn = bg_websocket_connection_create(path, 3000, NULL))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Couldn't connect to %s", path); return 0; } mdb_ctrl = bg_websocket_connection_get_controllable(conn); } else { if(!(mdb = bg_mdb_create(path, 0, NULL))) return 0; mdb_ctrl = bg_mdb_get_controllable(mdb); } } return 1; } static void opt_create(void * data, int * argc, char *** _argv, int arg) { ensure_mdb(1); } #if 0 static void opt_monitor(void * data, int * argc, char *** _argv, int arg) { do_monitor = 1; } #endif static void opt_db(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -db requires an argument\n"); exit(-1); } path = gavl_strdup((*_argv)[arg]); bg_cmdline_remove_arg(argc, _argv, arg); } static bg_cmdline_arg_t global_options[] = { { .arg = "-db", .help_arg = "", .help_string = "DB path or websocket address (starting with gmerlin-mdb://)", .callback = opt_db, }, { /* End */ } }; static void opt_rescan(void * data, int * argc, char *** _argv, int arg) { if(!ensure_mdb(0)) return; bg_mdb_rescan_sync(mdb_ctrl); } static void browse_obj(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg; if(arg >= *argc) { fprintf(stderr, "Option -browse-obj requires an argument\n"); exit(-1); } if(!ensure_mdb(0)) return; msg = bg_msg_sink_get(mdb_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_FUNC_DB_BROWSE_OBJECT, BG_MSG_NS_DB); gavl_dictionary_set_string(&msg->header, GAVL_MSG_CONTEXT_ID, (*_argv)[arg]); bg_msg_sink_put(mdb_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); } static void browse_children(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg; if(arg >= *argc) { fprintf(stderr, "Option -browse-children requires an argument\n"); exit(-1); } if(!ensure_mdb(0)) return; msg = bg_msg_sink_get(mdb_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_FUNC_DB_BROWSE_CHILDREN, BG_MSG_NS_DB); gavl_dictionary_set_string(&msg->header, GAVL_MSG_CONTEXT_ID, (*_argv)[arg]); bg_msg_sink_put(mdb_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); } static void add_sql_dir(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -add-sql-dir requires an argument\n"); exit(-1); } if(!ensure_mdb(0)) return; bg_mdb_add_sql_directory_sync(mdb_ctrl, (*_argv)[arg]); bg_cmdline_remove_arg(argc, _argv, arg); } static void del_sql_dir(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -del-sql-dir requires an argument\n"); exit(-1); } if(!ensure_mdb(0)) return; bg_mdb_del_sql_directory_sync(mdb_ctrl, (*_argv)[arg]); bg_cmdline_remove_arg(argc, _argv, arg); } static bg_cmdline_arg_t commands[] = { { .arg = "-create", .help_string = "Create DB", .callback = opt_create, }, { .arg = "-rescan", .help_string = "Rescan directories.", .callback = opt_rescan, }, { .arg = "-browse-obj", .help_arg = "", .help_string = "Browse object", .callback = browse_obj, }, { .arg = "-browse-children", .help_arg = "", .help_string = "Browse children", .callback = browse_children, }, { .arg = "-add-sql-dir", .help_arg = "", .help_string = "Add SQL directory", .callback = add_sql_dir, }, { .arg = "-del-sql-dir", .help_arg = "", .help_string = "Delete SQL directory", .callback = del_sql_dir, }, /* TODO: add more */ { /* End */ } }; const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options] command ...\n"), .help_before = TRS("gmerlin media DB tool\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), global_options }, { TRS("Commands"), commands }, { } }, }; int main(int argc, char ** argv) { // gavl_time_t t = GAVL_TIME_SCALE / 20; bg_app_init("mdb-tool", TRS("Manipulate Media DB"), NULL); bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); /* Create registries */ bg_plugins_init(); #if 0 if(gavl_string_starts_with(path, "gmerlin-mdb://")) { if(!(conn = bg_websocket_connection_create(path, 3000, NULL))) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Couldn't connect to %s", path); return EXIT_FAILURE; } mdb_ctrl = bg_websocket_connection_get_controllable(conn); } else { if(!(mdb = bg_mdb_create(path, do_create, NULL))) return EXIT_FAILURE; mdb_ctrl = bg_mdb_get_controllable(mdb); } bg_controllable_connect(mdb_ctrl, &ctrl); #endif bg_cmdline_parse(commands, &argc, &argv, NULL); #if 0 if(do_monitor) { bg_handle_sigint(); while(1) { if(bg_got_sigint() || !bg_msg_sink_iteration(ctrl.evt_sink)) break; if(!bg_msg_sink_get_num(ctrl.evt_sink)) gavl_time_delay(&t); } } #endif if(mdb) { bg_mdb_stop(mdb); bg_mdb_destroy(mdb); } if(conn) bg_websocket_connection_destroy(conn); return EXIT_SUCCESS; } bplaum-gmerlin-ebbe714/apps/mediainfo/000077500000000000000000000000001513225502300200145ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/mediainfo/Makefile.am000066400000000000000000000005271513225502300220540ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = gmerlin-mediainfo gmerlin_mediainfo_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl bplaum-gmerlin-ebbe714/apps/mediainfo/gmerlin-mediainfo.c000066400000000000000000000056021513225502300235510ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include static int input_flags = 0; static void opt_edl(void * data, int * argc, char *** _argv, int arg) { input_flags |= BG_INPUT_FLAG_PREFER_EDL; } static void opt_fmt(void * data, int * argc, char *** _argv, int arg) { input_flags |= BG_INPUT_FLAG_GET_FORMAT; } static void opt_track(void * data, int * argc, char *** _argv, int arg) { input_flags |= BG_INPUT_FLAG_SELECT_TRACK; } static bg_cmdline_arg_t global_options[] = { { .arg = "-edl", .help_string = "Prefer edl", .callback = opt_edl, }, { .arg = "-fmt", .help_string = "Start codecs to get complete formats", .callback = opt_fmt, }, { .arg = "-track", .help_string = "Select and return single track (passed in the URL)", .callback = opt_track, }, { /* End */ } }; const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options] \n"), .help_before = TRS("gmerlin mediainfo\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), global_options }, { } }, }; int main(int argc, char ** argv) { gavl_dictionary_t * mi; /* Handle commandline options */ bg_app_init("gmerlin-mediainfo", TRS("Print media information"), NULL); bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); /* Create registries */ bg_plugins_init(); /* Load url */ if((mi = bg_plugin_registry_load_media_info(bg_plugin_reg, argv[1], input_flags))) { gavl_dictionary_dump(mi, 0); gavl_dictionary_destroy(mi); } bg_plugins_cleanup(); bg_cfg_registry_cleanup(); } bplaum-gmerlin-ebbe714/apps/player/000077500000000000000000000000001513225502300173555ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/player/Makefile.am000066400000000000000000000015171513225502300214150ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = \ @XML2_CFLAGS@ \ @GTK_CFLAGS@ \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ Desktopdir = $(datadir)/applications Desktop_DATA = gmerlin-player.desktop bin_PROGRAMS = gmerlin # bin_SCRIPTS = gmerlin_launcher gmerlin_SOURCES = \ cfgdialog.c \ gmerlin.c \ main.c \ mainmenu.c \ mainwindow.c \ remote.c noinst_HEADERS = \ display.h \ gmerlin.h \ player_remote.h pkgdatadir = $(datadir)/@PACKAGE@/player skin_data = \ gmerlin-player.css pkgdata_DATA = $(skin_data) gmerlin_LDADD = $(top_builddir)/lib/libgmerlin.la $(top_builddir)/lib/gtk/libgmerlin_gtk.la @XML2_LIBS@ @GTK_LIBS@ EXTRA_DIST = gmerlin_launcher gmerlin-player.desktop $(skin_data) bplaum-gmerlin-ebbe714/apps/player/cfgdialog.c000066400000000000000000000132601513225502300214420ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include "gmerlin.h" #define CONFIG_GENERAL "general" #define CONFIG_LOGWINDOW "logwindow" #define CONFIG_SERVER "server" #define CONFIG_EXPORT "export" static int handle_cfg_message(void * priv, gavl_msg_t * msg) { gmerlin_t * g = priv; switch(msg->NS) { case BG_MSG_NS_PARAMETER: switch(msg->ID) { case BG_CMD_SET_PARAMETER: { const char * name; const char * ctx; gavl_value_t val; gavl_value_init(&val); bg_msg_get_parameter(msg, &name, &val); ctx = gavl_dictionary_get_string(&msg->header, GAVL_MSG_CONTEXT_ID); if(!ctx) return 1; if(!strcmp(ctx, CONFIG_GENERAL)) { gmerlin_set_parameter(g, name, &val); if(name) gavl_dictionary_set(g->general_section, name, &val); } else if(!strcmp(ctx, CONFIG_LOGWINDOW)) { bg_gtk_log_window_set_parameter(g->log_window, name, &val); if(name) gavl_dictionary_set(g->logwindow_section, name, &val); } else if(!strcmp(ctx, CONFIG_SERVER) || !strcmp(ctx, CONFIG_EXPORT)) { bg_http_server_set_parameter(g->srv, name, &val); if(name) gavl_dictionary_set(g->remote_section, name, &val); } gavl_value_free(&val); } break; } break; } return 1; } void gmerlin_configure(gmerlin_t * g) { int i; GtkTreeIter it; bg_cfg_ctx_t ctx; GtkWidget * w; if(!g->cfg_sink) g->cfg_sink = bg_msg_sink_create(handle_cfg_message, g, 1); w = bg_gtk_config_dialog_create_multi(BG_GTK_CONFIG_DIALOG_DESTROY, TR("Gmerlin confiuration"), g->mainwin.win); /* TODO: General */ bg_cfg_ctx_init(&ctx, NULL, CONFIG_GENERAL, TR("General"), NULL, NULL); ctx.parameters = gmerlin_get_parameters(g); ctx.sink = g->cfg_sink; ctx.s = g->general_section; bg_gtk_config_dialog_add_section(w, &ctx, NULL); bg_cfg_ctx_free(&ctx); bg_gtk_config_dialog_add_section(w, &g->cfg_player[BG_PLAYER_CFG_INPUT], NULL); bg_gtk_config_dialog_add_section(w, bg_plugin_config_get_ctx(BG_PLUGIN_INPUT), NULL); bg_gtk_config_dialog_add_section(w, bg_plugin_config_get_ctx(BG_PLUGIN_IMAGE_READER), NULL); bg_gtk_config_dialog_add_container(w, TR("Audio"), NULL, &it); bg_gtk_config_dialog_add_section(w, &g->cfg_player[BG_PLAYER_CFG_AUDIO], &it); bg_gtk_config_dialog_add_section(w, bg_plugin_config_get_ctx(BG_PLUGIN_FILTER_AUDIO), &it); bg_gtk_config_dialog_add_container(w, TR("Video"), NULL, &it); bg_gtk_config_dialog_add_section(w, &g->cfg_player[BG_PLAYER_CFG_VIDEO], &it); bg_gtk_config_dialog_add_section(w, bg_plugin_config_get_ctx(BG_PLUGIN_FILTER_VIDEO), &it); bg_gtk_config_dialog_add_container(w, TR("Media Database"), NULL, &it); i = 0; while(g->cfg_mdb[i].name) { bg_gtk_config_dialog_add_section(w, &g->cfg_mdb[i], &it); i++; } bg_gtk_config_dialog_add_container(w, TR("Visuzalization"), NULL, &it); bg_gtk_config_dialog_add_section(w, &g->cfg_player[BG_PLAYER_CFG_VISUALIZATION], &it); bg_gtk_config_dialog_add_section(w, bg_plugin_config_get_ctx(BG_PLUGIN_VISUALIZATION), &it); bg_gtk_config_dialog_add_section(w, &g->cfg_player[BG_PLAYER_CFG_OSD], NULL); /* */ bg_gtk_config_dialog_add_container(w, TR("Remote access"), NULL, &it); bg_cfg_ctx_init(&ctx, NULL, CONFIG_SERVER, TR("HTTP server"), NULL, NULL); ctx.parameters = bg_http_server_get_parameters(g->srv); ctx.sink = g->cfg_sink; ctx.s = g->remote_section; bg_gtk_config_dialog_add_section(w, &ctx, &it); bg_cfg_ctx_free(&ctx); bg_cfg_ctx_init(&ctx, NULL, CONFIG_EXPORT, TR("Media export"), NULL, NULL); ctx.parameters = bg_media_dirs_get_parameters(); ctx.sink = g->cfg_sink; ctx.s = g->remote_section; bg_gtk_config_dialog_add_section(w, &ctx, &it); bg_cfg_ctx_free(&ctx); /* */ bg_cfg_ctx_init(&ctx, NULL, CONFIG_LOGWINDOW, TR("Logwindow"), NULL, NULL); ctx.parameters = bg_gtk_log_window_get_parameters(g->log_window); ctx.sink = g->cfg_sink; ctx.s = g->logwindow_section; bg_gtk_config_dialog_add_section(w, &ctx, NULL); bg_cfg_ctx_free(&ctx); /* */ gtk_window_present(GTK_WINDOW(w)); } bplaum-gmerlin-ebbe714/apps/player/display.h000066400000000000000000000041541513225502300211770ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #define DISPLAY_WIDTH 232 #define DISPLAY_HEIGHT 59 typedef struct display_s display_t; typedef struct display_skin_s { int x, y; float background[3]; float foreground_normal[3]; float foreground_error[3]; } display_skin_t; display_t * display_create(gmerlin_t * gmerlin); const bg_parameter_info_t * display_get_parameters(display_t * display); void display_set_parameter(void * data, const char * name, const gavl_value_t * v); int display_get_parameter(void * data, const char * name, gavl_value_t * v); void display_connect(display_t * d); void display_disconnect(display_t * d); void display_destroy(display_t *); void display_set_buffering(display_t *, float perc); void display_set_mute(display_t *, int mute); GtkWidget * display_get_widget(display_t *); void display_get_coords(display_t *, int * x, int * y); /* Set track name to be displayed */ void display_set_error_msg(display_t * d, char * msg); void display_set_skin(display_t * d, display_skin_t * s); void display_skin_load(display_skin_t * s, xmlDocPtr doc, xmlNodePtr node); bplaum-gmerlin-ebbe714/apps/player/gmerlin-player.css000066400000000000000000000025401513225502300230170ustar00rootroot00000000000000.player-button { font-size: 200%; } .header-button { font-size: 80%; } /* Seems not to work yet */ .windowheader { /* background-color: inherit; */ } .playerwindow { /* background-color: #a0a0a0; */ } .time-label { font-size: 200%; font-family: monospace; margin-left: 3px; margin-right: 3px; } .status-label, .mode-label { font-size: 150%; margin-left: 3px; margin-right: 3px; } .all-label, .rem-label { font-size: 80%; } /* The all-label and rem-label are switched on and off by changing their opacity. This way they keep ther allocated size */ .invisible { color: transparent; } .volume-label { font-size: 170%; margin-left: 3px; margin-right: 3px; } .volume-slider { margin: 3px; } .seek-slider { margin: 3px; } .track-display { /* min-width: 200px; min-height: 80px; */ } .track-image, .track-icon { margin-right: 3px; } .track-info, .status-label, .mode-label, .time-label { color: #000000; } .error-info { color: #ff0000; } .display { background-color: #ffffff; border-color: #a0a0a0; border-width: 4px; border-style: inset; padding: 5px; min-width: 500px; /* min-height: 150px; */ } bplaum-gmerlin-ebbe714/apps/player/gmerlin-player.desktop000066400000000000000000000003201513225502300236720ustar00rootroot00000000000000[Desktop Entry] Name=Gmerlin player Name[de]=Gmerlin player Comment=Multiformat mediaplayer Comment[de]=Multiformat mediaplayer Exec=gmerlin Icon=gmerlin-player Type=Application Categories=AudioVideo;Player; bplaum-gmerlin-ebbe714/apps/player/gmerlin.c000066400000000000000000000513771513225502300211730ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #define LOG_DOMAIN "gmerlin" #include "gmerlin.h" #include "player_remote.h" #include #include #include const char * client_config_vars[] = { "cfg", NULL, }; static bg_accelerator_t accels[] = { { GAVL_KEY_q, GAVL_KEY_CONTROL_MASK, ACCEL_QUIT }, { GAVL_KEY_o, GAVL_KEY_CONTROL_MASK, ACCEL_OPTIONS }, { GAVL_KEY_g, GAVL_KEY_CONTROL_MASK, ACCEL_GOTO_CURRENT }, { GAVL_KEY_F9, 0, ACCEL_CURRENT_TO_FAVOURITES }, { GAVL_KEY_NONE, 0, 0 }, }; static void info_hide_callback(GtkWidget * w, gpointer data) { gmerlin_t * g = (gmerlin_t*)data; main_menu_set_info_window_item(g->main_menu, FALSE); } static gboolean delete_callback(GtkWidget * w, GdkEventAny * event, gpointer data) { gmerlin_t * g = (gmerlin_t*)data; if(w == bg_gtk_log_window_get_widget(g->log_window)) { gtk_widget_hide(w); main_menu_set_log_window_item(g->main_menu, FALSE); return TRUE; } else if(w == g->mdb_window) { gtk_widget_hide(w); main_menu_set_mdb_window_item(g->main_menu, FALSE); return TRUE; } return FALSE; } static void gmerlin_apply_config(gmerlin_t * g) { const bg_parameter_info_t * parameters; bg_cfg_ctx_apply_array(g->cfg_player); parameters = bg_http_server_get_parameters(g->srv); bg_cfg_section_apply(g->remote_section, parameters, bg_http_server_set_parameter, g->srv); parameters = bg_media_dirs_get_parameters(); bg_cfg_section_apply(g->remote_section, parameters, bg_http_server_set_parameter, g->srv); parameters = gmerlin_get_parameters(g); bg_cfg_section_apply(g->general_section, parameters, gmerlin_set_parameter, (void*)(g)); parameters = bg_gtk_log_window_get_parameters(g->log_window); bg_cfg_section_apply(g->logwindow_section, parameters, bg_gtk_log_window_set_parameter, (void*)(g->log_window)); } static void gmerlin_apply_state(gmerlin_t * g) { bg_state_apply(&g->state, g->player_ctrl->cmd_sink, BG_CMD_SET_STATE); } void gmerlin_connect_player(gmerlin_t * gmerlin) { bg_gtk_mdb_tree_set_player_ctrl(gmerlin->mdb_tree, gmerlin->player_ctrl); main_window_connect(&gmerlin->mainwin); } void gmerlin_disconnect_player(gmerlin_t * gmerlin) { bg_gtk_mdb_tree_unset_player_ctrl(gmerlin->mdb_tree); main_window_disconnect(&gmerlin->mainwin); } void gmerlin_connect_mdb(gmerlin_t * gmerlin) { gmerlin->mdb_tree = bg_gtk_mdb_tree_create(gmerlin->mdb_ctrl); gtk_container_add(GTK_CONTAINER(gmerlin->mdb_window), bg_gtk_mdb_tree_get_widget(gmerlin->mdb_tree)); bg_gtk_mdb_tree_set_player_ctrl(gmerlin->mdb_tree, gmerlin->player_ctrl); } void gmerlin_disconnect_mdb(gmerlin_t * gmerlin) { GtkWidget * w = bg_gtk_mdb_tree_get_widget(gmerlin->mdb_tree); bg_gtk_mdb_tree_destroy(gmerlin->mdb_tree); gtk_container_remove(GTK_CONTAINER(gmerlin->mdb_window), w); gmerlin->mdb_tree = NULL; } static int handle_http_client_config(bg_http_connection_t * conn, void * priv) { gmerlin_t * g = priv; /* Check if we need to send the default renderer */ if(!strcmp(conn->method, "GET") && gavl_string_starts_with(conn->path, "cfg?")) { const char * client_id; client_id = gavl_dictionary_get_string(&conn->url_vars, BG_URL_VAR_CLIENT_ID); if(!client_id) return 0; // fprintf(stderr, "Blupp handle_http_client_config %s\n", client_id); if(!bg_server_storage_get(g->client_config, client_id, "cfg", NULL)) { const char * root_uri; char * host = NULL; int port = 80; /* Create a default value */ char * cfg; root_uri = bg_http_server_get_root_url(g->srv); gavl_url_split(root_uri, NULL, NULL, NULL, &host, &port, NULL); cfg = gavl_sprintf("{\"renderer\":\"gmerlin-renderer://%s:%d/ws/renderer\",\"style\":\"dark\"}", host, port); bg_server_storage_put(g->client_config, client_id, "cfg", cfg, strlen(cfg)); free(cfg); } } return bg_server_storage_handle_http(conn, g->client_config); // return 0; } static const char * manifest_file = "{\n" "\"short_name\": \"%s\",\n" "\"name\": \"%s\",\n" "\"display\": \"standalone\",\n" "\"icons\": [ \n" "{\n" "\"src\": \"static/icons/player_16.png\",\n" "\"sizes\": \"16x16\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "},\n" "{\n" "\"src\": \"static/icons/player_48.png\",\n" "\"sizes\": \"48x48\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "},\n" "{\n" "\"src\": \"static/icons/player_96.png\",\n" "\"sizes\": \"96x96\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "} ],\n" "\"start_url\": \"%s\"\n" "}\n"; static int server_handle_manifest(bg_http_connection_t * conn, void * data) { const char * var; int result = 0; if(!strcmp(conn->path, "/manifest.json")) { char * start_url = NULL; if((var = gavl_dictionary_get_string(&conn->req, "Referer"))) { gavl_dictionary_t url_vars; char * protocol = NULL; char * host = NULL; int port = 0; const char * cid; char * m = NULL; int len = 0; bg_http_connection_check_keepalive(conn); gavl_dictionary_init(&url_vars); // fprintf(stderr, "Referer: %s\n", var); gavl_url_split(var, &protocol, NULL, NULL, &host, &port, NULL); gavl_url_get_vars_c(var, &url_vars); if((cid = gavl_dictionary_get_string(&url_vars, BG_URL_VAR_CLIENT_ID))) { start_url = gavl_sprintf("%s://%s:%d/?%s=%s", protocol, host, port, BG_URL_VAR_CLIENT_ID, cid); m = gavl_sprintf(manifest_file, bg_app_get_label(), bg_app_get_label(), start_url); len = strlen(m); bg_http_connection_init_res(conn, conn->protocol, 200, "OK"); gavl_dictionary_set_string(&conn->res, "Content-Type", "application/manifest+json"); gavl_dictionary_set_long(&conn->res, "Content-Length", len); if(!bg_http_connection_write_res(conn)) { bg_http_connection_clear_keepalive(conn); goto cleanup; } result = 1; } if(!result) { bg_http_connection_init_res(conn, conn->protocol, 400, "Bad Request"); if(!bg_http_connection_write_res(conn)) { bg_http_connection_clear_keepalive(conn); goto cleanup; } } if(result && !gavl_socket_write_data(conn->fd, (const uint8_t*)m, len)) bg_http_connection_clear_keepalive(conn); cleanup: if(protocol) free(protocol); if(host) free(host); gavl_dictionary_free(&url_vars); // fprintf(stderr, "Got manifest:\n%s\n", m); if(m) free(m); } return result; } return 0; } gmerlin_t * gmerlin_create(const gavl_dictionary_t * saved_state, const char * db_path) { gmerlin_t * ret; gavl_dictionary_t * cfg_section; char * tmp_string; int locked = 0; // gavl_dictionary_t root_metadata; ret = calloc(1, sizeof(*ret)); pthread_mutex_init(&ret->stop_mutex, NULL); pthread_mutex_init(&ret->backend_mutex, NULL); /* From here we can direct log messages to the GUI */ ret->log_window = bg_gtk_log_window_create(TR("Gmerlin player")); tmp_string = bg_search_var_dir("player/client_config"); ret->client_config = bg_server_storage_create(tmp_string, 16, client_config_vars); free(tmp_string); ret->general_section = bg_cfg_registry_find_section(bg_cfg_registry, "General"); ret->remote_section = bg_cfg_registry_find_section(bg_cfg_registry, "Remote"); ret->logwindow_section = bg_cfg_registry_find_section(bg_cfg_registry, "Logwindow"); /* Create player instance */ ret->player = bg_player_create(); ret->player_ctrl = bg_player_get_controllable(ret->player); ret->cfg_player = bg_cfg_ctx_copy_array(bg_player_get_cfg(ret->player)); bg_cfg_ctx_set_cb_array(ret->cfg_player, NULL, NULL); bg_cfg_ctx_set_sink_array(ret->cfg_player, ret->player_ctrl->cmd_sink); bg_player_add_accelerators(ret->player, accels); cfg_section = bg_cfg_registry_find_section(bg_cfg_registry, "player"); bg_cfg_ctx_array_create_sections(ret->cfg_player, cfg_section); bg_player_apply_cmdline(ret->cfg_player); /* TODO: Maybe add PID and hostname */ /* TODO: Add icons */ ret->srv = bg_http_server_create(); bg_http_server_get_media_dirs(ret->srv); /* Media DB */ if(!(ret->mdb = bg_mdb_create(db_path, 0, &locked))) { if(locked) { GtkWidget * dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Database is locked by another process. Use the -db option for choosing another database."); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); goto fail; } else { #if 0 char * msg = gavl_sprintf("Creating new database in %s", db_path); GtkWidget * dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, msg); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); free(msg); #endif ret->mdb = bg_mdb_create(db_path, 1, &locked); } } bg_cfg_section_apply(ret->logwindow_section, bg_gtk_log_window_get_parameters(ret->log_window), bg_gtk_log_window_set_parameter, (void*)ret->log_window); g_signal_connect(G_OBJECT(bg_gtk_log_window_get_widget(ret->log_window)), DELETE_EVENT, G_CALLBACK(delete_callback), ret); bg_mdb_set_root_name(ret->mdb, bg_app_get_label()); ret->cfg_mdb = bg_mdb_get_cfg(ret->mdb); // gavl_dictionary_free(&root_metadata); ret->mdb_ctrl = bg_mdb_get_controllable(ret->mdb); /* Start creating the GUI */ ret->accel_group = gtk_accel_group_new(); ret->mdb_tree = bg_gtk_mdb_tree_create(ret->mdb_ctrl); ret->mdb_window = bg_gtk_window_new(GTK_WINDOW_TOPLEVEL); g_signal_connect(ret->mdb_window, DELETE_EVENT, G_CALLBACK(delete_callback), ret); gtk_window_set_title(GTK_WINDOW(ret->mdb_window), TR("Gmerlin Media DB")); gtk_container_add(GTK_CONTAINER(ret->mdb_window), bg_gtk_mdb_tree_get_widget(ret->mdb_tree)); gtk_window_set_default_size(GTK_WINDOW(ret->mdb_window), 600, 400); /* Needs to come early */ // bg_control_init(&ret->ctrl, bg_msg_sink_create(gmerlin_handle_message, ret, 0)); /* Create player window */ main_window_init(&ret->mainwin, ret); gtk_window_add_accel_group(GTK_WINDOW(ret->mdb_window), ret->accel_group); // gmerlin_skin_load(&ret->skin, "Default"); // gmerlin_skin_set(ret); /* Create subwindows */ ret->info_window = bg_gtk_trackinfo_create(); g_signal_connect(G_OBJECT(bg_gtk_trackinfo_get_widget(ret->info_window)), "hide", G_CALLBACK(info_hide_callback), ret); bg_http_server_set_generate_client_ids(ret->srv); bg_http_server_set_root_file(ret->srv, "/static/app.html"); bg_http_server_add_handler(ret->srv, server_handle_manifest, BG_HTTP_PROTO_HTTP, NULL, NULL); #if 0 bg_http_server_add_handler(ret->srv, handle_http_backends, BG_HTTP_PROTO_HTTP, NULL, // E.g. /static/ can be NULL ret); #endif bg_http_server_set_static_path(ret->srv, "/static"); bg_http_server_set_mdb(ret->srv, ret->mdb); bg_http_server_add_handler(ret->srv, handle_http_client_config, BG_HTTP_PROTO_HTTP, "/storage/", // E.g. /static/ can be NULL ret); gmerlin_connect_player(ret); bg_http_server_set_default_port(ret->srv, PLAYER_REMOTE_PORT); // gmerlin_create_dialog(ret); bg_player_state_init(&ret->state); /* Apply the state before the frontends are created */ if(saved_state) { bg_state_merge(&ret->state, saved_state); bg_player_state_reset(&ret->state); } ret->main_menu = main_menu_create(ret); gtk_widget_show(ret->mdb_window); main_menu_set_mdb_window_item(ret->main_menu, 1); return ret; fail: gmerlin_destroy(ret); return NULL; } void gmerlin_destroy(gmerlin_t * g) { /* Join frontend thread */ pthread_mutex_lock(&g->stop_mutex); if(g->frontend_thread_running) { g->stop = 1; pthread_mutex_unlock(&g->stop_mutex); pthread_join(g->frontend_thread, NULL); } else pthread_mutex_unlock(&g->stop_mutex); /* Shut down mdb threads */ if(g->mdb) bg_mdb_stop(g->mdb); /* Must destroy the dialogs early, because the destructors might reference parameter infos, which belong to other modules */ bg_frontends_destroy(g->mdb_frontends, g->num_mdb_frontends); bg_frontends_destroy(g->renderer_frontends, g->num_renderer_frontends); if(g->player) { bg_player_quit(g->player); bg_player_destroy(g->player); } /* Process last messages (state is stored here) */ if(g->mainwin.player_ctrl.evt_sink) bg_msg_sink_iteration(g->mainwin.player_ctrl.evt_sink); if(g->mdb) bg_mdb_destroy(g->mdb); // bg_lcdproc_destroy(g->lcdproc); if(g->srv) bg_http_server_destroy(g->srv); if(g->info_window) bg_gtk_trackinfo_destroy(g->info_window); if(g->log_window) bg_gtk_log_window_destroy(g->log_window); if(g->cfg_player) { bg_cfg_ctx_array_clear_sections(g->cfg_player); bg_cfg_ctx_destroy_array(g->cfg_player); } gavl_dictionary_free(&g->state); if(g->client_config) bg_server_storage_destroy(g->client_config); pthread_mutex_destroy(&g->stop_mutex); pthread_mutex_destroy(&g->backend_mutex); if(g->main_menu) main_menu_destroy(g->main_menu); free(g); } static void * frontend_thread(void * data) { int i; gmerlin_t * g = data; gavl_time_t delay_time = GAVL_TIME_SCALE / 100; /* 10 ms */ while(1) { pthread_mutex_lock(&g->stop_mutex); if(g->stop) { pthread_mutex_unlock(&g->stop_mutex); break; } else pthread_mutex_unlock(&g->stop_mutex); i = 0; /* Handle remote control */ i += bg_http_server_iteration(g->srv); i += bg_frontends_ping(g->renderer_frontends, g->num_renderer_frontends); i += bg_frontends_ping(g->mdb_frontends, g->num_mdb_frontends); pthread_mutex_lock(&g->backend_mutex); if(g->player_backend) i += bg_backend_handle_ping(g->player_backend); if(g->mdb_backend) i += bg_backend_handle_ping(g->mdb_backend); pthread_mutex_unlock(&g->backend_mutex); if(!i) gavl_time_delay(&delay_time); } return NULL; } void gmerlin_run(gmerlin_t * g, const char ** locations, gavl_array_t * fe_arr_mdb, gavl_array_t * fe_arr_renderer) { gavl_value_t icons_val; gavl_array_t * icons_arr; char * tmp_string; gavl_dictionary_t root_metadata; gmerlin_apply_config(g); gmerlin_apply_state(g); bg_http_server_start(g->srv); #if 1 g->renderer_frontends = bg_frontends_create(g->player_ctrl, BG_PLUGIN_FRONTEND_RENDERER, fe_arr_renderer, &g->num_renderer_frontends); g->mdb_frontends = bg_frontends_create(g->mdb_ctrl, BG_PLUGIN_FRONTEND_MDB, fe_arr_mdb, &g->num_mdb_frontends); #endif gavl_dictionary_init(&root_metadata); /* Add icons with absolute URLs and the network node name */ gavl_value_init(&icons_val); icons_arr = gavl_value_set_array(&icons_val); tmp_string = gavl_sprintf("%s/static/icons/", bg_http_server_get_root_url(g->srv)); gavl_dictionary_set(&root_metadata, GAVL_META_ICON_URL, NULL); bg_array_add_application_icons(icons_arr, tmp_string, "player"); free(tmp_string); gavl_dictionary_set(&root_metadata, GAVL_META_ICON_URL, &icons_val); bg_mdb_merge_root_metadata(g->mdb, &root_metadata); gavl_dictionary_free(&root_metadata); /* */ bg_player_run(g->player); if(locations) gmerlin_play_locations(g, locations); /* Start frontend thread */ pthread_create(&g->frontend_thread, NULL, frontend_thread, g); g->frontend_thread_running = 1; main_window_show(&g->mainwin); gtk_main(); } static const bg_parameter_info_t parameters[] = { #if 0 { .name = "general_options", .long_name = TRS("General Options"), .type = BG_PARAMETER_SECTION, }, #endif { .name = "skip_error_tracks", .long_name = TRS("Skip error tracks"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), .help_string = TRS("If a track cannot be opened, switch to the next one") }, { .name = "show_tooltips", .long_name = TRS("Show tooltips"), .type = BG_PARAMETER_CHECKBUTTON, .val_default = GAVL_VALUE_INIT_INT(1), }, { /* End of Parameters */ } }; const bg_parameter_info_t * gmerlin_get_parameters(gmerlin_t * g) { return parameters; } void gmerlin_set_parameter(void * data, const char * name, const gavl_value_t * val) { gmerlin_t * g = (gmerlin_t*)data; if(!name) return; // fprintf(stderr, "gmerlin_set_parameter %s\n", name); // gavl_value_dump(val, 2); if(!strcmp(name, "skip_error_tracks")) { if(val->v.i) g->playback_flags |= PLAYBACK_SKIP_ERROR; else g->playback_flags &= ~PLAYBACK_SKIP_ERROR; } else if(!strcmp(name, "show_tooltips")) { bg_gtk_set_tooltips(val->v.i); } } void gmerlin_add_locations(gmerlin_t * g, const char ** locations) { fprintf(stderr, "BUG: gmerlin_add_locations not implemented yet\n"); } void gmerlin_play_locations(gmerlin_t * g, const char ** locations) { fprintf(stderr, "BUG: gmerlin_play_locations not implemented yet\n"); } #if 0 static bg_album_t * open_device(gmerlin_t * g, char * device) { bg_album_t * album; album = bg_media_tree_get_device_album(g->tree, device); if(!album) return album; if(!bg_album_is_open(album)) { bg_album_open(album); bg_gtk_tree_window_open_album_window(g->tree_window, album); bg_gtk_tree_window_update(g->tree_window); } return album; } #endif void gmerlin_open_device(gmerlin_t * g, const char * device) { #if 0 open_device(g, device); #else fprintf(stderr, "gmerlin_open_device not implemented yet\n"); #endif } void gmerlin_play_device(gmerlin_t * g, const char * device) { #if 0 bg_album_t * album; bg_album_entry_t * entry; album = open_device(g, device); if(!album) return; entry = bg_album_get_entry(album, 0); if(!entry) return; bg_album_set_current(album, entry); bg_album_play(album); #else fprintf(stderr, "gmerlin_play_device not implemented yet\n"); #endif } bplaum-gmerlin-ebbe714/apps/player/gmerlin.h000066400000000000000000000163501513225502300211700ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include // #include #include #include #include #include #ifdef HAVE_DBUS #include #endif // #include typedef struct gmerlin_s gmerlin_t; /* Main menu */ typedef struct main_menu_s main_menu_t; main_menu_t * main_menu_create(gmerlin_t * gmerlin); void main_menu_destroy(main_menu_t *); GtkWidget * main_menu_get_widget(main_menu_t *); void main_menu_set_chapters(main_menu_t * m, const gavl_dictionary_t * list); void main_menu_set_num_streams(main_menu_t *, int audio_streams, int video_streams, int subtitle_streams); void main_menu_chapter_changed(main_menu_t * m, int chapter); void main_menu_set_audio_info(main_menu_t *, int stream, const gavl_dictionary_t * m); void main_menu_set_video_info(main_menu_t *, int stream, const gavl_dictionary_t * m); void main_menu_set_subtitle_info(main_menu_t *, int stream, const gavl_dictionary_t * m); void main_menu_update_streams(main_menu_t *, int num_audio_streams, int num_video_streams, int num_subpicture_streams, int num_programs); void main_menu_set_audio_index(main_menu_t *, int); void main_menu_set_video_index(main_menu_t *, int); void main_menu_set_subtitle_index(main_menu_t *, int); void main_menu_set_info_window_item(main_menu_t * m, int state); void main_menu_set_mdb_window_item(main_menu_t * m, int state); void main_menu_set_log_window_item(main_menu_t * m, int state); void main_menu_set_oa_uri(main_menu_t *, const char *); void main_menu_set_ov_uri(main_menu_t *, const char *); void main_menu_ping(main_menu_t * m); /* New player window */ typedef struct { GtkWidget * win; GtkWidget * play_button; GtkWidget * stop_button; GtkWidget * next_button; GtkWidget * prev_button; GtkWidget * pause_button; GtkWidget * menu_button; GtkWidget * close_button; GtkWidget * status_label; GtkWidget * mode_label; GtkWidget * mode_box; GtkWidget * time_label; GtkWidget * time_box; GtkWidget * all_label; GtkWidget * rem_label; GtkWidget * track_image; GtkWidget * track_icon; GtkWidget * track_info; GtkWidget * seek_slider; GtkWidget * volume_slider; GtkWidget * volume_label; GtkCssProvider * skin_provider; GtkCssProvider * icon_provider; gmerlin_t * g; int volume_active; gulong seek_change_id; gulong volume_change_id; bg_control_t player_ctrl; int display_mode; int seek_flags; } main_window_t; void main_window_init(main_window_t * ret, gmerlin_t * g); void main_window_show(main_window_t * w); void main_window_connect(main_window_t * w); void main_window_disconnect(main_window_t * w); /* Accelerators */ #define ACCEL_QUIT (BG_PLAYER_ACCEL_PRIV+1) #define ACCEL_OPTIONS (BG_PLAYER_ACCEL_PRIV+2) #define ACCEL_GOTO_CURRENT (BG_PLAYER_ACCEL_PRIV+3) #define ACCEL_CURRENT_TO_FAVOURITES (BG_PLAYER_ACCEL_PRIV+4) #define PLAYBACK_SKIP_ERROR (1<<0) struct gmerlin_s { main_window_t mainwin; int playback_flags; /* Core stuff */ bg_player_t * player; bg_controllable_t * player_ctrl; bg_controllable_t * mdb_ctrl; bg_mdb_t * mdb; /* GUI */ bg_gtk_mdb_tree_t * mdb_tree; GtkWidget * mdb_window; bg_gtk_trackinfo_t * info_window; bg_gtk_log_window_t * log_window; bg_cfg_ctx_t * cfg_player; bg_cfg_ctx_t * cfg_mdb; int tree_error; /* Configuration stuff */ gavl_dictionary_t * display_section; gavl_dictionary_t * tree_section; gavl_dictionary_t * general_section; gavl_dictionary_t * lcdproc_section; gavl_dictionary_t * remote_section; gavl_dictionary_t * logwindow_section; gavl_dictionary_t * infowindow_section; GtkWidget * about_window; // bg_lcdproc_t * lcdproc; /* Remote control */ bg_http_server_t * srv; bg_server_storage_t * client_config; int player_state; /* For all windows */ GtkAccelGroup *accel_group; gavl_dictionary_t state; bg_plugin_handle_t * player_backend; bg_plugin_handle_t * mdb_backend; bg_frontend_t ** renderer_frontends; int num_renderer_frontends; bg_frontend_t ** mdb_frontends; int num_mdb_frontends; pthread_mutex_t backend_mutex; int stop; int frontend_thread_running; pthread_mutex_t stop_mutex; pthread_t frontend_thread; main_menu_t * main_menu; bg_msg_sink_t * cfg_sink; }; gmerlin_t * gmerlin_create(const gavl_dictionary_t * saved_state, const char * db_path); /* Right after creating, urls can be added */ void gmerlin_add_locations(gmerlin_t * g, const char ** locations); void gmerlin_play_locations(gmerlin_t * g, const char ** locations); void gmerlin_open_device(gmerlin_t * g, const char * device); void gmerlin_play_device(gmerlin_t * g, const char * device); void gmerlin_destroy(gmerlin_t*); void gmerlin_run(gmerlin_t*, const char ** locations, gavl_array_t * fe_arr_mdb, gavl_array_t * fe_arr_renderer); // void gmerlin_set_next_track(gmerlin_t * g); void gmerlin_connect_player(gmerlin_t * gmerlin); void gmerlin_disconnect_player(gmerlin_t * gmerlin); void gmerlin_connect_mdb(gmerlin_t * gmerlin); void gmerlin_disconnect_mdb(gmerlin_t * gmerlin); /* Skin stuff */ /* Load a skin from directory. Return the default dierectory if the skin could not be found */ /* Run the main config dialog */ void gmerlin_create_dialog(gmerlin_t * g); void gmerlin_configure(gmerlin_t * g); int gmerlin_handle_message(void * data, gavl_msg_t * msg); /* This is called when the player signals that it wants a new track */ // void gmerlin_next_track(gmerlin_t * g); const bg_parameter_info_t * gmerlin_get_parameters(gmerlin_t * g); void gmerlin_set_parameter(void * data, const char * name, const gavl_value_t * val); /* Handle remote command */ void gmerlin_handle_remote(gmerlin_t * g, gavl_msg_t * msg); bplaum-gmerlin-ebbe714/apps/player/gmerlin_launcher000077500000000000000000000000571513225502300226230ustar00rootroot00000000000000#!/bin/sh gmerlin_remote -launch -addplay "$1" bplaum-gmerlin-ebbe714/apps/player/main.c000066400000000000000000000153201513225502300204460ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ /* System includes */ #include #include #include /* Gmerlin includes */ #include #include #include "gmerlin.h" #include "player_remote.h" #include #include #include #include #include #include #include #include #include #define STATE_XML_NODE "PLAYERSTATE" #define LOG_DOMAIN "main" // #define MTRACE #ifdef MTRACE #include #endif static char * db_path = NULL; static gavl_array_t fe_arr_mdb; static gavl_array_t fe_arr_renderer; static void opt_fe_renderer(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe-renderer requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr_renderer, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_fe_mdb(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe-mdb requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr_mdb, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_db(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { fprintf(stderr, "Option -db requires an argument\n"); exit(-1); } db_path = (*_argv)[arg]; bg_cmdline_remove_arg(argc, _argv, arg); fprintf(stderr, "Using db path from commandline: %s\n", db_path); } static bg_cmdline_arg_t cmdline_args[] = { { .arg = "-db", .help_string = "Use other database path", .callback = opt_db, }, { .arg = "-fe-mdb", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of database frontends. Use -list-fe-mdb to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe_mdb, }, { .arg = "-list-fe-mdb", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_mdb, }, { .arg = "-fe-renderer", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of renderer frontends. Use -list-fe-mdb to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe_renderer, }, { .arg = "-list-fe-renderer", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_renderer, }, BG_PLUGIN_OPT_OA, BG_PLUGIN_OPT_OV, BG_PLUGIN_OPT_FA, BG_PLUGIN_OPT_FV, { /* */ }, }; const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options] [gmls ...]\n"), .help_before = TRS("Gmerlin GUI Player"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), cmdline_args }, { } }, #if 0 .env = (bg_cmdline_ext_doc_t[]) { { PLAYER_REMOTE_ENV, TRS("Default port for the remote control") }, { /* End */ } }, #endif .files = (bg_cmdline_ext_doc_t[]) { { "~/.gmerlin/plugins.xml", TRS("Cache of the plugin registry (shared by all applications)") }, { "~/.gmerlin/player/cfg.xml", TRS("Used for configuration data. Delete this file if you think you goofed something up.") }, { "~/.gmerlin/player/tree/tree.xml", TRS("Media tree is saved here. The albums are saved as separate files in the same directory.") }, { /* End */ } }, }; static char * get_state_file(void) { char * ret; char * dir = gavl_search_state_dir(PACKAGE, bg_app_get_name(), NULL); if(!dir) return NULL; ret = gavl_sprintf("%s/state.xml", dir); free(dir); return ret; } int main(int argc, char ** argv) { gmerlin_t * gmerlin; char * tmp_path; char ** locations; int have_state = 0; gavl_dictionary_t state; gavl_array_init(&fe_arr_mdb); bg_frontend_set_option(&fe_arr_mdb, "mdb_gmerlin,mdb_upnp"); gavl_array_init(&fe_arr_renderer); bg_frontend_set_option(&fe_arr_renderer, "renderer_gmerlin,renderer_upnp,mpris"); bg_app_init("gmerlin", TRS("Gmerlin Player"), "player"); srand(time(NULL)); gavl_dictionary_init(&state); bg_http_cache_init(); #ifdef MTRACE mtrace(); #endif bg_cmdline_init(&app_data); bg_cmdline_parse(cmdline_args, &argc, &argv, NULL); bg_iconfont_init(); /* Initialize random generator (for shuffle) */ srand(time(NULL)); bg_translation_init(); bg_gtk_init(&argc, &argv); bg_cfg_registry_init(); bg_plugins_init(); /* Load state if available */ if((tmp_path = get_state_file())) { if(!access(tmp_path, R_OK) && bg_dictionary_load_xml(&state, tmp_path, STATE_XML_NODE)) have_state = 1; free(tmp_path); } /* Restore plugin states */ /* Fire up the actual player */ if(!(gmerlin = gmerlin_create((have_state ? (&state) : NULL), db_path))) return EXIT_FAILURE; gavl_dictionary_free(&state); /* */ /* Get locations from the commandline */ locations = bg_cmdline_get_locations_from_args(&argc, &argv); gmerlin_run(gmerlin, (const char**)locations, &fe_arr_mdb, &fe_arr_renderer); /* Save plugin state */ tmp_path = get_state_file(); if(tmp_path) { bg_player_state_reset(&gmerlin->state); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Saving state to %s", tmp_path); // fprintf(stderr, "Saving state to %s\n", tmp_path); bg_dictionary_save_xml(&gmerlin->state, tmp_path, STATE_XML_NODE); free(tmp_path); } gmerlin_destroy(gmerlin); bg_cfg_registry_save(); bg_global_cleanup(); return EXIT_SUCCESS; } bplaum-gmerlin-ebbe714/apps/player/mainmenu.c000066400000000000000000001066151513225502300213430ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include "gmerlin.h" #include #include #include #include #include #include #include typedef struct stream_menu_s { GSList * group; GtkWidget ** stream_items; guint * ids; GtkWidget * off_item; guint off_id; int num_streams; int streams_alloc; GtkWidget * menu; int idx; } stream_menu_t; typedef struct chapter_menu_s { int timescale; int num_chapters; int chapters_alloc; guint * ids; GSList * group; GtkWidget ** chapter_items; GtkWidget * menu; } chapter_menu_t; struct windows_menu_s { GtkWidget * infowindow; guint infowindow_id; GtkWidget * logwindow; guint logwindow_id; GtkWidget * mdbwindow; guint mdbwindow_id; GtkWidget * menu; }; struct help_menu_s { GtkWidget * about; // GtkWidget * help; GtkWidget * menu; }; struct seek_menu_s { GtkWidget * seek_forward; GtkWidget * seek_backward; GtkWidget * seek_forward_fast; GtkWidget * seek_backward_fast; GtkWidget * seek_00; GtkWidget * seek_10; GtkWidget * seek_20; GtkWidget * seek_30; GtkWidget * seek_40; GtkWidget * seek_50; GtkWidget * seek_60; GtkWidget * seek_70; GtkWidget * seek_80; GtkWidget * seek_90; GtkWidget * menu; }; struct command_menu_s { GtkWidget * inc_volume; GtkWidget * dec_volume; GtkWidget * mute; GtkWidget * next; GtkWidget * previous; GtkWidget * next_chapter; GtkWidget * previous_chapter; GtkWidget * current_to_favourites; GtkWidget * goto_current; GtkWidget * next_visualization; GtkWidget * seek_item; GtkWidget * play; GtkWidget * pause; GtkWidget * stop; GtkWidget * quit; struct seek_menu_s seek_menu; GtkWidget * menu; }; struct main_menu_s { struct windows_menu_s windows_menu; struct help_menu_s help_menu; struct command_menu_s command_menu; struct stream_menu_s audio_stream_menu; struct stream_menu_s video_stream_menu; struct stream_menu_s subtitle_stream_menu; struct chapter_menu_s chapter_menu; GtkWidget * windows_item; GtkWidget * help_item; GtkWidget * preferences_item; GtkWidget * command_item; // GtkWidget * audio_stream_item; // GtkWidget * video_stream_item; GtkWidget * audio_item; GtkWidget * video_item; GtkWidget * subtitle_stream_item; GtkWidget * chapter_item; GtkWidget * visualization_item; GtkWidget * player_backend_item; GtkWidget * mdb_backend_item; GtkWidget * menu; gmerlin_t * g; bg_gtk_backend_menu_t * player_backend_menu; bg_gtk_backend_menu_t * mdb_backend_menu; bg_gtk_backend_menu_t * oa_menu; bg_gtk_backend_menu_t * ov_menu; }; static void stream_menu_set_index(stream_menu_t * s, int index); static GtkWidget * create_menu() { GtkWidget * ret; // GtkWidget * tearoff_item; ret = gtk_menu_new(); gtk_widget_set_size_request(ret, 10, 10); return ret; } static int stream_menu_has_widget(stream_menu_t * s, GtkWidget * w, int * index) { int i; if((w == s->off_item) && gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->off_item))) { *index = -1; return 1; } for(i = 0; i < s->num_streams; i++) { if((w == s->stream_items[i]) && gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->stream_items[i]))) { *index = i; return 1; } } return 0; } static int chapter_menu_has_widget(chapter_menu_t * s, GtkWidget * w, int * index) { int i; for(i = 0; i < s->num_chapters; i++) { if((w == s->chapter_items[i]) && gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(s->chapter_items[i]))) { *index = i; return 1; } } return 0; } static void menu_callback(GtkWidget * w, gpointer data) { int i; gmerlin_t * g; main_menu_t * the_menu; g = (gmerlin_t*)data; the_menu = g->main_menu; if(w == the_menu->preferences_item) gmerlin_configure(g); else if(w == the_menu->windows_menu.infowindow) { if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(the_menu->windows_menu.infowindow))) gtk_widget_show(bg_gtk_trackinfo_get_widget(g->info_window)); else gtk_widget_hide(bg_gtk_trackinfo_get_widget(g->info_window)); } else if(w == the_menu->windows_menu.logwindow) { if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(the_menu->windows_menu.logwindow))) gtk_widget_show(bg_gtk_log_window_get_widget(g->log_window)); else gtk_widget_hide(bg_gtk_log_window_get_widget(g->log_window)); } else if(w == the_menu->windows_menu.mdbwindow) { if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(the_menu->windows_menu.mdbwindow))) gtk_widget_show(g->mdb_window); else gtk_widget_hide(g->mdb_window); } else if(w == the_menu->help_menu.about) { if(!g->about_window) g->about_window = bg_gtk_about_window_create(); gtk_widget_show(g->about_window); } #if 0 else if(w == the_menu->help_menu.help) { // bg_display_html_help("userguide/GUI-Player.html"); } #endif /* Commands (== accelerators) */ else if(w == the_menu->command_menu.inc_volume) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_VOLUME_UP); else if(w == the_menu->command_menu.dec_volume) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_VOLUME_DOWN); else if(w == the_menu->command_menu.pause) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_PAUSE); else if(w == the_menu->command_menu.play) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_PLAY); else if(w == the_menu->command_menu.mute) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_MUTE); else if(w == the_menu->command_menu.next_chapter) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_NEXT_CHAPTER); else if(w == the_menu->command_menu.previous_chapter) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_PREV_CHAPTER); else if(w == the_menu->command_menu.next) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_NEXT); else if(w == the_menu->command_menu.previous) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_PREV); else if(w == the_menu->command_menu.stop) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_STOP); else if(w == the_menu->command_menu.current_to_favourites) bg_player_accel_pressed(g->player_ctrl, ACCEL_CURRENT_TO_FAVOURITES); else if(w == the_menu->command_menu.quit) bg_player_accel_pressed(g->player_ctrl, ACCEL_QUIT); else if(w == the_menu->command_menu.next_visualization) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_NEXT_VISUALIZATION); else if(w == the_menu->command_menu.seek_menu.seek_00) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_START); else if(w == the_menu->command_menu.seek_menu.seek_10) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_10); else if(w == the_menu->command_menu.seek_menu.seek_20) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_20); else if(w == the_menu->command_menu.seek_menu.seek_30) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_30); else if(w == the_menu->command_menu.seek_menu.seek_40) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_40); else if(w == the_menu->command_menu.seek_menu.seek_50) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_50); else if(w == the_menu->command_menu.seek_menu.seek_60) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_60); else if(w == the_menu->command_menu.seek_menu.seek_70) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_70); else if(w == the_menu->command_menu.seek_menu.seek_80) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_80); else if(w == the_menu->command_menu.seek_menu.seek_90) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_90); else if(w == the_menu->command_menu.seek_menu.seek_backward) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_BACKWARD); else if(w == the_menu->command_menu.seek_menu.seek_forward) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_FORWARD); else if(w == the_menu->command_menu.seek_menu.seek_backward_fast) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_BACKWARD_FAST); else if(w == the_menu->command_menu.seek_menu.seek_forward_fast) bg_player_accel_pressed(g->player_ctrl, BG_PLAYER_ACCEL_SEEK_FORWARD_FAST); /* Stream selection */ else if(stream_menu_has_widget(&the_menu->audio_stream_menu, w, &i)) bg_player_set_audio_stream(g->mainwin.player_ctrl.cmd_sink, i); else if(stream_menu_has_widget(&the_menu->video_stream_menu, w, &i)) bg_player_set_video_stream(g->mainwin.player_ctrl.cmd_sink, i); else if(stream_menu_has_widget(&the_menu->subtitle_stream_menu, w, &i)) bg_player_set_subtitle_stream(g->mainwin.player_ctrl.cmd_sink, i); /* Chapters */ else if(chapter_menu_has_widget(&the_menu->chapter_menu, w, &i)) bg_player_set_chapter(g->mainwin.player_ctrl.cmd_sink, i); } static GtkWidget * create_item(const char * label, const char * icon, gmerlin_t * gmerlin, GtkWidget * menu) { GtkWidget * ret; if(icon) ret = bg_gtk_icon_menu_item_new(label, icon); else ret = gtk_menu_item_new_with_label(label); g_signal_connect(G_OBJECT(ret), "activate", G_CALLBACK(menu_callback), gmerlin); gtk_widget_show(ret); gtk_menu_shell_append(GTK_MENU_SHELL(menu), ret); return ret; } static GtkWidget * create_toggle_item(const char * label, gmerlin_t * gmerlin, GtkWidget * menu, guint * id) { guint32 handler_id; GtkWidget * ret; ret = gtk_check_menu_item_new_with_label(label); handler_id = g_signal_connect(G_OBJECT(ret), "toggled", G_CALLBACK(menu_callback), gmerlin); if(id) *id = handler_id; gtk_widget_show(ret); gtk_menu_shell_append(GTK_MENU_SHELL(menu), ret); return ret; } static GtkWidget * create_stream_item(gmerlin_t * gmerlin, stream_menu_t * m, guint * id) { GtkWidget * ret; ret = gtk_radio_menu_item_new_with_label(m->group, ""); m->group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(ret)); *id = g_signal_connect(G_OBJECT(ret), "activate", G_CALLBACK(menu_callback), gmerlin); gtk_menu_shell_insert(GTK_MENU_SHELL(m->menu), ret, (int)(id - m->ids) + 2); return ret; } static GtkWidget * create_chapter_item(gmerlin_t * gmerlin, chapter_menu_t * m, guint * id) { GtkWidget * ret; ret = gtk_radio_menu_item_new_with_label(m->group, ""); m->group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(ret)); *id = g_signal_connect(G_OBJECT(ret), "activate", G_CALLBACK(menu_callback), gmerlin); gtk_menu_shell_append(GTK_MENU_SHELL(m->menu), ret); return ret; } static GtkWidget * create_submenu_item(const char * label, const char * icon, GtkWidget * child_menu, GtkWidget * parent_menu) { GtkWidget * ret; ret = bg_gtk_icon_menu_item_new(label, icon); // ret = gtk_menu_item_new_with_label(label); gtk_menu_item_set_submenu(GTK_MENU_ITEM(ret), child_menu); gtk_widget_show(ret); gtk_menu_shell_append(GTK_MENU_SHELL(parent_menu), ret); return ret; } static void stream_menu_init(stream_menu_t * s, gmerlin_t * gmerlin, int has_plugins, int has_filters, bg_plugin_type_t plugin_type) { GtkWidget * separator; s->menu = create_menu(); s->off_item = gtk_radio_menu_item_new_with_label(NULL, TR("Off")); s->off_id = g_signal_connect(G_OBJECT(s->off_item), "activate", G_CALLBACK(menu_callback), gmerlin); s->group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(s->off_item)); gtk_widget_show(s->off_item); gtk_menu_shell_append(GTK_MENU_SHELL(s->menu), s->off_item); separator = gtk_separator_menu_item_new(); gtk_widget_show(separator); gtk_menu_shell_append(GTK_MENU_SHELL(s->menu), separator); } static void stream_menu_free(stream_menu_t * s) { if(s->stream_items) free(s->stream_items); if(s->ids) free(s->ids); } static void stream_menu_set_num(gmerlin_t * g, stream_menu_t * s, int num) { int i; if(num > s->streams_alloc) { s->stream_items = realloc(s->stream_items, num * sizeof(*s->stream_items)); s->ids = realloc(s->ids, num * sizeof(*s->ids)); for(i = s->streams_alloc; i < num; i++) s->stream_items[i] = create_stream_item(g, s, &s->ids[i]); stream_menu_set_index(s, s->idx); s->streams_alloc = num; } for(i = 0; i < num; i++) gtk_widget_show(s->stream_items[i]); for(i = num; i < s->streams_alloc; i++) gtk_widget_hide(s->stream_items[i]); s->num_streams = num; } static void stream_menu_set_index(stream_menu_t * s, int index) { int i; /* Block event handlers */ g_signal_handler_block(G_OBJECT(s->off_item), s->off_id); for(i = 0; i < s->streams_alloc; i++) g_signal_handler_block(G_OBJECT(s->stream_items[i]), s->ids[i]); /* Select item */ if(index == -1) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->off_item), 1); else if(index < s->streams_alloc) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->stream_items[index]), 1); /* Unblock event handlers */ g_signal_handler_unblock(G_OBJECT(s->off_item), s->off_id); for(i = 0; i < s->streams_alloc; i++) g_signal_handler_unblock(G_OBJECT(s->stream_items[i]), s->ids[i]); s->idx = index; } static void chapter_menu_set_num(main_menu_t * m, int num, int timescale) { int i; chapter_menu_t * s = &m->chapter_menu; if(!num) gtk_widget_hide(m->chapter_item); else gtk_widget_show(m->chapter_item); if(num > s->chapters_alloc) { s->chapter_items = realloc(s->chapter_items, num * sizeof(*s->chapter_items)); s->ids = realloc(s->ids, num * sizeof(*s->ids)); for(i = s->chapters_alloc; i < num; i++) s->chapter_items[i] = create_chapter_item(m->g, s, &s->ids[i]); s->chapters_alloc = num; } s->timescale = timescale; for(i = 0; i < num; i++) gtk_widget_show(s->chapter_items[i]); for(i = num; i < s->chapters_alloc; i++) gtk_widget_hide(s->chapter_items[i]); s->num_chapters = num; } void main_menu_set_audio_index(main_menu_t * m, int index) { stream_menu_set_index(&m->audio_stream_menu, index); } void main_menu_set_video_index(main_menu_t * m, int index) { stream_menu_set_index(&m->video_stream_menu, index); } void main_menu_set_subtitle_index(main_menu_t * m, int index) { stream_menu_set_index(&m->subtitle_stream_menu, index); } void main_menu_set_oa_uri(main_menu_t * m, const char * uri) { bg_gtk_backend_menu_set_from_uri(m->oa_menu, uri); } void main_menu_set_ov_uri(main_menu_t * m, const char * uri) { bg_gtk_backend_menu_set_from_uri(m->ov_menu, uri); } void main_menu_set_num_streams(main_menu_t * m, int audio_streams, int video_streams, int subtitle_streams) { stream_menu_set_num(m->g, &m->audio_stream_menu, audio_streams); stream_menu_set_num(m->g, &m->video_stream_menu, video_streams); stream_menu_set_num(m->g, &m->subtitle_stream_menu, subtitle_streams); } void main_menu_set_chapters(main_menu_t * m, const gavl_dictionary_t * list) { int i; int num; int timescale; char * label; GtkWidget * w; if(!list || !gavl_chapter_list_is_valid(list)) { gtk_widget_hide(m->chapter_item); return; } else { gtk_widget_show(m->chapter_item); num = gavl_chapter_list_get_num(list); timescale = gavl_chapter_list_get_timescale(list); gtk_widget_set_sensitive(m->chapter_item, 1); chapter_menu_set_num(m, num, timescale); for(i = 0; i < num; i++) { label = bg_get_chapter_label(i, gavl_chapter_list_get_time(list, i), timescale, gavl_chapter_list_get_label(list, i)); w = m->chapter_menu.chapter_items[i]; gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(w))), label); free(label); } } } void main_menu_chapter_changed(main_menu_t * m, int chapter) { GtkWidget * w; if(chapter >= m->chapter_menu.num_chapters) return; w = m->chapter_menu.chapter_items[chapter]; g_signal_handler_block(G_OBJECT(w), m->chapter_menu.ids[chapter]); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), 1); g_signal_handler_unblock(G_OBJECT(w), m->chapter_menu.ids[chapter]); } void main_menu_set_audio_info(main_menu_t * m, int stream, const gavl_dictionary_t * metadata) { char * label; GtkWidget * w; label = bg_get_stream_label(stream, metadata); w = m->audio_stream_menu.stream_items[stream]; gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(w))), label); free(label); } void main_menu_set_video_info(main_menu_t * m, int stream, const gavl_dictionary_t * metadata) { char * label; GtkWidget * w; label = bg_get_stream_label(stream, metadata); w = m->video_stream_menu.stream_items[stream]; gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(w))), label); free(label); } void main_menu_set_subtitle_info(main_menu_t * m, int stream, const gavl_dictionary_t * metadata) { char * label; GtkWidget * w; label = bg_get_stream_label(stream, metadata); // fprintf(stderr, "main_menu_set_subtitle_info %d %s\n", stream, label); w = m->subtitle_stream_menu.stream_items[stream]; gtk_label_set_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(w))), label); free(label); } main_menu_t * main_menu_create(gmerlin_t * gmerlin) { main_menu_t * ret; GtkWidget * menu; ret = calloc(1, sizeof(*ret)); ret->g = gmerlin; /* Windows */ ret->windows_menu.menu = create_menu(); ret->windows_menu.mdbwindow = create_toggle_item(TR("Media DB"), gmerlin, ret->windows_menu.menu, &ret->windows_menu.mdbwindow_id); ret->windows_menu.infowindow = create_toggle_item(TR("Info window"), gmerlin, ret->windows_menu.menu, &ret->windows_menu.infowindow_id); ret->windows_menu.logwindow = create_toggle_item(TR("Log window"), gmerlin, ret->windows_menu.menu, &ret->windows_menu.logwindow_id); gtk_widget_show(ret->windows_menu.menu); /* Help */ ret->help_menu.menu = create_menu(); ret->help_menu.about = create_item(TR("About..."), BG_ICON_INFO, gmerlin, ret->help_menu.menu); // ret->help_menu.help = create_pixmap_item(TR("Userguide"), "help_16.png", // gmerlin, ret->help_menu.menu); gtk_widget_show(ret->help_menu.menu); /* Streams */ stream_menu_init(&ret->audio_stream_menu, gmerlin, 1, 1, BG_PLUGIN_OUTPUT_AUDIO); stream_menu_init(&ret->video_stream_menu, gmerlin, 1, 1, BG_PLUGIN_OUTPUT_VIDEO); stream_menu_init(&ret->subtitle_stream_menu, gmerlin, 0, 0, BG_PLUGIN_NONE); /* Chapters */ ret->chapter_menu.menu = create_menu(); /* Commands */ ret->command_menu.menu = create_menu(); ret->command_menu.inc_volume = create_item(TR("Increase volume"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.inc_volume, "activate", ret->g->accel_group, GDK_KEY_AudioRaiseVolume, 0, GTK_ACCEL_VISIBLE); ret->command_menu.dec_volume = create_item(TR("Decrease volume"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.dec_volume, "activate", ret->g->accel_group, GDK_KEY_AudioLowerVolume, 0, GTK_ACCEL_VISIBLE); ret->command_menu.mute = create_item(TR("Toggle mute"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.mute, "activate", ret->g->accel_group, GDK_KEY_M, 0, GTK_ACCEL_VISIBLE); ret->command_menu.next = create_item(TR("Next track"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.next, "activate", ret->g->accel_group, GDK_KEY_AudioNext, 0, GTK_ACCEL_VISIBLE); ret->command_menu.previous = create_item(TR("Previous track"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.previous, "activate", ret->g->accel_group, GDK_KEY_AudioPrev, 0, GTK_ACCEL_VISIBLE); ret->command_menu.next_chapter = create_item(TR("Next chapter"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.next_chapter, "activate", ret->g->accel_group, GDK_KEY_AudioNext, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); ret->command_menu.previous_chapter = create_item(TR("Previous chapter"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.previous_chapter, "activate", ret->g->accel_group, GDK_KEY_AudioPrev, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); ret->command_menu.stop = create_item(TR("Stop"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.stop, "activate", ret->g->accel_group, GDK_KEY_BackSpace, 0, GTK_ACCEL_VISIBLE); ret->command_menu.goto_current = create_item(TR("Goto current track"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.goto_current, "activate", ret->g->accel_group, GDK_KEY_g, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); ret->command_menu.next_visualization = create_item(TR("Next visualization"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.next_visualization, "activate", ret->g->accel_group, GDK_KEY_v, 0, GTK_ACCEL_VISIBLE); ret->command_menu.current_to_favourites = create_item(TR("Copy current track to favourites"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.current_to_favourites, "activate", ret->g->accel_group, GDK_KEY_F9, 0, GTK_ACCEL_VISIBLE); ret->command_menu.play = create_item(TR("Play"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.play, "activate", ret->g->accel_group, GDK_KEY_AudioPlay, 0, GTK_ACCEL_VISIBLE); ret->command_menu.pause = create_item(TR("Pause"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.pause, "activate", ret->g->accel_group, GDK_KEY_space, 0, GTK_ACCEL_VISIBLE); ret->command_menu.quit = create_item(TR("Quit gmerlin"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.quit, "activate", ret->g->accel_group, GDK_KEY_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); /* Command -> Seek */ ret->command_menu.seek_menu.menu = create_menu(); ret->command_menu.seek_menu.seek_forward = create_item(TR("Seek forward"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_forward, "activate", ret->g->accel_group, GDK_KEY_Right, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_backward = create_item(TR("Seek backward"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_backward, "activate", ret->g->accel_group, GDK_KEY_Left, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_forward_fast = create_item(TR("Seek forward fast"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_forward, "activate", ret->g->accel_group, GDK_KEY_Right, GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_backward_fast = create_item(TR("Seek backward fast"), NULL, gmerlin, ret->command_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_backward, "activate", ret->g->accel_group, GDK_KEY_Left, GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_00 = create_item(TR("Seek to start"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_00, "activate", ret->g->accel_group, GDK_KEY_0, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_10 = create_item(TR("Seek to 10%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_10, "activate", ret->g->accel_group, GDK_KEY_1, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_20 = create_item(TR("Seek to 20%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_20, "activate", ret->g->accel_group, GDK_KEY_2, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_30 = create_item(TR("Seek to 30%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_30, "activate", ret->g->accel_group, GDK_KEY_3, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_40 = create_item(TR("Seek to 40%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_40, "activate", ret->g->accel_group, GDK_KEY_4, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_50 = create_item(TR("Seek to 50%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_50, "activate", ret->g->accel_group, GDK_KEY_5, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_60 = create_item(TR("Seek to 60%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_60, "activate", ret->g->accel_group, GDK_KEY_6, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_70 = create_item(TR("Seek to 70%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_70, "activate", ret->g->accel_group, GDK_KEY_7, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_80 = create_item(TR("Seek to 80%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_80, "activate", ret->g->accel_group, GDK_KEY_8, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_menu.seek_90 = create_item(TR("Seek to 90%"), NULL, gmerlin, ret->command_menu.seek_menu.menu); gtk_widget_add_accelerator(ret->command_menu.seek_menu.seek_90, "activate", ret->g->accel_group, GDK_KEY_9, 0, GTK_ACCEL_VISIBLE); ret->command_menu.seek_item = create_submenu_item(TR("Seek..."), NULL, ret->command_menu.seek_menu.menu, ret->command_menu.menu); /* Backend menus */ ret->player_backend_menu = bg_gtk_backend_menu_create(GAVL_META_CLASS_BACKEND_RENDERER, 1, /* Will send GAVL_CMD_SET_RESOURCE events */ gmerlin->mainwin.player_ctrl.evt_sink); ret->mdb_backend_menu = bg_gtk_backend_menu_create(GAVL_META_CLASS_BACKEND_MDB, 1, /* Will send GAVL_CMD_SET_RESOURCE events */ gmerlin->mainwin.player_ctrl.evt_sink); ret->oa_menu = bg_gtk_backend_menu_create(GAVL_META_CLASS_SINK_AUDIO, 0, /* Will send GAVL_CMD_SET_RESOURCE events */ gmerlin->mainwin.player_ctrl.evt_sink); ret->ov_menu = bg_gtk_backend_menu_create(GAVL_META_CLASS_SINK_VIDEO, 0, /* Will send GAVL_CMD_SET_RESOURCE events */ gmerlin->mainwin.player_ctrl.evt_sink); /* Main menu */ ret->menu = create_menu(); menu = create_menu(); create_submenu_item(TR("Streams"), NULL, ret->audio_stream_menu.menu, menu); create_submenu_item(TR("Sink"), NULL, bg_gtk_backend_menu_get_widget(ret->oa_menu), menu); ret->audio_item = create_submenu_item(TR("Audio..."), BG_ICON_MUSIC, menu, ret->menu); menu = create_menu(); create_submenu_item(TR("Streams"), NULL, ret->video_stream_menu.menu, menu); create_submenu_item(TR("Sink"), NULL, bg_gtk_backend_menu_get_widget(ret->ov_menu), menu); ret->video_item = create_submenu_item(TR("Video..."), BG_ICON_FILM, menu, ret->menu); ret->subtitle_stream_item = create_submenu_item(TR("Subtitles..."), BG_ICON_SUBTITLE, ret->subtitle_stream_menu.menu, ret->menu); ret->chapter_item = create_submenu_item(TR("Chapters..."),BG_ICON_CHAPTERS, ret->chapter_menu.menu, ret->menu); /* Don't crash on empty menus */ gtk_widget_hide(ret->chapter_item); ret->preferences_item = create_item(TR("Preferences..."), BG_ICON_CONFIG, gmerlin, ret->menu); gtk_widget_add_accelerator(ret->preferences_item, "activate", ret->g->accel_group, GDK_KEY_o, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); ret->windows_item = create_submenu_item(TR("Windows..."), NULL, ret->windows_menu.menu, ret->menu); ret->command_item = create_submenu_item(TR("Commands..."), NULL, ret->command_menu.menu, ret->menu); ret->player_backend_item = create_submenu_item(TR("Player backend"), BG_ICON_PLAYER, bg_gtk_backend_menu_get_widget(ret->player_backend_menu), ret->menu); ret->mdb_backend_item = create_submenu_item(TR("Database backend"), BG_ICON_SERVER, bg_gtk_backend_menu_get_widget(ret->mdb_backend_menu), ret->menu); ret->help_item = create_submenu_item(TR("Help..."),BG_ICON_HELP, ret->help_menu.menu, ret->menu); gtk_widget_show(ret->menu); return ret; } void main_menu_destroy(main_menu_t * m) { stream_menu_free(&m->audio_stream_menu); stream_menu_free(&m->video_stream_menu); stream_menu_free(&m->subtitle_stream_menu); if(m->player_backend_menu) bg_gtk_backend_menu_destroy(m->player_backend_menu); if(m->mdb_backend_menu) bg_gtk_backend_menu_destroy(m->mdb_backend_menu); if(m->oa_menu) bg_gtk_backend_menu_destroy(m->oa_menu); if(m->ov_menu) bg_gtk_backend_menu_destroy(m->ov_menu); free(m); } GtkWidget * main_menu_get_widget(main_menu_t * m) { return m->menu; } void main_menu_set_info_window_item(main_menu_t * m, int state) { g_signal_handler_block(G_OBJECT(m->windows_menu.infowindow), m->windows_menu.infowindow_id); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(m->windows_menu.infowindow), state); g_signal_handler_unblock(G_OBJECT(m->windows_menu.infowindow), m->windows_menu.infowindow_id); } void main_menu_set_mdb_window_item(main_menu_t * m, int state) { g_signal_handler_block(G_OBJECT(m->windows_menu.mdbwindow), m->windows_menu.mdbwindow_id); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(m->windows_menu.mdbwindow), state); g_signal_handler_unblock(G_OBJECT(m->windows_menu.mdbwindow), m->windows_menu.mdbwindow_id); } void main_menu_set_log_window_item(main_menu_t * m, int state) { g_signal_handler_block(G_OBJECT(m->windows_menu.logwindow), m->windows_menu.logwindow_id); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(m->windows_menu.logwindow), state); g_signal_handler_unblock(G_OBJECT(m->windows_menu.logwindow), m->windows_menu.logwindow_id); } void main_menu_ping(main_menu_t * m) { bg_gtk_backend_menu_ping(m->player_backend_menu); bg_gtk_backend_menu_ping(m->mdb_backend_menu); bg_gtk_backend_menu_ping(m->oa_menu); bg_gtk_backend_menu_ping(m->ov_menu); } bplaum-gmerlin-ebbe714/apps/player/mainwindow.c000066400000000000000000001230341513225502300217000ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #define LOG_DOMAIN "mainwindow" #include #define DELAY_TIME 10 #define DEFAULT_LABEL "Gmerlin Player (version "VERSION")" #define ERROR_LABEL "Playback error, check log messages for details" /* typedef struct { GtkWidget * win; GtkWidget * play_button; GtkWidget * stop_button; GtkWidget * next_button; GtkWidget * prev_button; GtkWidget * menu_button; GtkWidget * close_button; } main_window_t; */ /* Seek flags */ #define SEEK_ACTIVE (1<<0) #define SEEK_WAS_PAUSED (1<<1) #define SEEK_PAUSE_SENT (1<<2) #define DISPLAY_MODE_NORMAL 0 #define DISPLAY_MODE_REM 1 #define DISPLAY_MODE_ALL 2 #define DISPLAY_MODE_ALL_REM 3 #define NUM_DISPLAY_MODES 4 static const char * icon_css = \ "* { font-family: "BG_ICON_FONT_FAMILY"; }"; static void button_callback(GtkWidget * w, gpointer data) { main_window_t * win = data; if(w == win->play_button) { bg_player_play(win->player_ctrl.cmd_sink); } else if(w == win->pause_button) { bg_player_pause(win->player_ctrl.cmd_sink); } else if(w == win->stop_button) { bg_player_stop(win->player_ctrl.cmd_sink); } else if(w == win->next_button) { bg_player_next(win->player_ctrl.cmd_sink); } else if(w == win->prev_button) { bg_player_prev(win->player_ctrl.cmd_sink); } else if(w == win->close_button) { bg_gtk_quit(); } else if(w == win->menu_button) { gtk_menu_popup_at_widget(GTK_MENU(main_menu_get_widget(win->g->main_menu)), win->menu_button, GDK_GRAVITY_CENTER, GDK_GRAVITY_NORTH_WEST, NULL); } } static GtkWidget * player_button_create(main_window_t * win, const char * icon) { GtkStyleContext *context; GtkWidget * ret; ret = gtk_button_new_with_label(icon); context = gtk_widget_get_style_context(ret); gtk_style_context_add_class(context,"player-button"); gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(win->skin_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(win->icon_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); g_signal_connect(G_OBJECT(ret), "clicked", G_CALLBACK(button_callback), win); gtk_widget_set_halign(ret, GTK_ALIGN_START); gtk_widget_set_hexpand(ret, FALSE); gtk_widget_show(ret); return ret; } static GtkWidget * title_button_create(main_window_t * win, const char * icon) { GtkWidget * ret; GtkStyleContext *context; ret = gtk_button_new_with_label(icon); context = gtk_widget_get_style_context(ret); gtk_style_context_add_class(context,"title-button"); gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(win->skin_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(win->icon_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); gtk_widget_show(ret); g_signal_connect(G_OBJECT(ret), "clicked", G_CALLBACK(button_callback), win); return ret; } static void set_css_class(GtkWidget * w, GtkCssProvider * skin_provider, GtkCssProvider * icon_provider, const char * klass) { GtkStyleContext *context; context = gtk_widget_get_style_context(w); gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(skin_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); if(icon_provider) gtk_style_context_add_provider(context, GTK_STYLE_PROVIDER(icon_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); gtk_style_context_add_class(context, klass); } static void scale_value_changed(GtkWidget* self, gpointer data) { double value; main_window_t * w = data; value = gtk_range_get_value(GTK_RANGE(w->seek_slider)); if(self == w->seek_slider) { if(w->seek_flags & SEEK_ACTIVE) { if(!(w->seek_flags & SEEK_WAS_PAUSED) && !(w->seek_flags & SEEK_PAUSE_SENT)) { bg_player_pause(w->player_ctrl.cmd_sink); w->seek_flags |= SEEK_PAUSE_SENT; } } bg_player_seek_perc(w->player_ctrl.cmd_sink, value); } if(self == w->volume_slider) { bg_player_set_volume(w->player_ctrl.cmd_sink, gtk_range_get_value(GTK_RANGE(w->volume_slider))); } } static void hide_label(GtkWidget * w) { GtkStyleContext * context = gtk_widget_get_style_context(w); if(!gtk_style_context_has_class(context, "invisible")) gtk_style_context_add_class(context,"invisible"); } static void show_label(GtkWidget * w) { GtkStyleContext * context = gtk_widget_get_style_context(w); if(gtk_style_context_has_class(context, "invisible")) gtk_style_context_remove_class(context,"invisible"); } static void set_time_label(main_window_t * w, gavl_time_t t) { char str[GAVL_TIME_STRING_LEN]; #if 0 switch(w->display_mode) { case DISPLAY_MODE_NORMAL: gavl_dictionary_get_long(dict, BG_PLAYER_TIME, &t); break; case DISPLAY_MODE_REM: gavl_dictionary_get_long(dict, BG_PLAYER_TIME_REM, &t); break; case DISPLAY_MODE_ALL: gavl_dictionary_get_long(dict, BG_PLAYER_TIME_ABS, &t); break; case DISPLAY_MODE_ALL_REM: gavl_dictionary_get_long(dict, BG_PLAYER_TIME_REM_ABS, &t); break; } #endif if(t > (gavl_time_t)GAVL_TIME_SCALE*3600*24*356) gavl_time_prettyprint_local(t, str); else gavl_time_prettyprint(t, str); gtk_label_set_text(GTK_LABEL(w->time_label), str); } static void set_display_mode(main_window_t * w) { const gavl_value_t * time_val; gavl_time_t t; const char * time_name = NULL; /* Update labels */ switch(w->display_mode) { case DISPLAY_MODE_NORMAL: hide_label(w->all_label); hide_label(w->rem_label); time_name = BG_PLAYER_STATE_TIME; break; case DISPLAY_MODE_REM: hide_label(w->all_label); show_label(w->rem_label); time_name = BG_PLAYER_STATE_TIME_REM; break; case DISPLAY_MODE_ALL: show_label(w->all_label); hide_label(w->rem_label); time_name = BG_PLAYER_STATE_TIME_ABS; break; case DISPLAY_MODE_ALL_REM: show_label(w->all_label); show_label(w->rem_label); time_name = BG_PLAYER_STATE_TIME_REM_ABS; break; } if(time_name && (time_val = bg_state_get(&w->g->state, BG_PLAYER_STATE_CTX, time_name)) && // long gavl_value_get_long(time_val, &t)) set_time_label(w, t); } static gboolean button_press_event(GtkWidget* self, GdkEventButton * evt, gpointer data) { main_window_t * w = data; if(self == w->seek_slider) { if(!(w->seek_flags & SEEK_ACTIVE)) { const gavl_value_t * status_val; w->seek_flags = 0; if((status_val = bg_state_get(&w->g->state, BG_PLAYER_STATE_CTX, BG_PLAYER_STATE_STATUS)) && // dictionary (status_val->v.i == BG_PLAYER_STATUS_PAUSED)) w->seek_flags |= SEEK_WAS_PAUSED; w->seek_flags |= SEEK_ACTIVE; } } else if(self == w->volume_slider) w->volume_active = 1; return FALSE; } static gboolean button_release_event(GtkWidget* self, GdkEventButton * evt, gpointer data) { main_window_t * w = data; if(self == w->seek_slider) { if(!(w->seek_flags & SEEK_WAS_PAUSED)) bg_player_pause(w->player_ctrl.cmd_sink); w->seek_flags = 0; } else if(self == w->volume_slider) w->volume_active = 0; return FALSE; } #define META_ATTRIBUTES "size=\"small\" alpha=\"70%%\"" static char * add_metadata_string(char * markup, const char * str, const char * icon) { char * tmp_string = g_markup_printf_escaped("%s %s", icon, str); if(markup) markup = gavl_strcat(markup, " "); markup = gavl_strcat(markup, tmp_string); g_free(tmp_string); return markup; } static char * add_metadata_markup(char * markup, const gavl_dictionary_t * m, const char * key, const char * icon) { const char * var; if(!(var = gavl_dictionary_get_string(m, key))) return markup; return add_metadata_string(markup, var, icon); } static char * add_metadata_markup_array(char * markup, const gavl_dictionary_t * m, const char * key, const char * icon) { char * tmp_string; if(!(tmp_string = gavl_metadata_join_arr(m, key, ", "))) return markup; markup = add_metadata_string(markup, tmp_string, icon); free(tmp_string); return markup; } static char * get_track_markup(const gavl_dictionary_t * m) { const char * var; char * tmp_string; char * markup = NULL; char * metadata = NULL; gavl_time_t duration = -1; if((var = gavl_dictionary_get_string(m, GAVL_META_LABEL))) { tmp_string = g_markup_printf_escaped("%s", var); markup = gavl_sprintf("%s\n", tmp_string); free(tmp_string); } else return gavl_strdup(DEFAULT_LABEL); metadata = add_metadata_markup_array(metadata, m, GAVL_META_ARTIST, BG_ICON_MICROPHONE); metadata = add_metadata_markup(metadata, m, GAVL_META_ALBUM, BG_ICON_MUSIC_ALBUM); metadata = add_metadata_markup_array(metadata, m, GAVL_META_GENRE, BG_ICON_MASKS); metadata = add_metadata_markup_array(metadata, m, GAVL_META_TAG, BG_ICON_TAGS); metadata = add_metadata_markup(metadata, m, GAVL_META_STATION, BG_ICON_RADIO); metadata = add_metadata_markup_array(metadata, m, GAVL_META_COUNTRY, BG_ICON_FLAG); if((var = gavl_dictionary_get_string(m, GAVL_META_DATE))) { if(!gavl_string_starts_with(var, "9999")) { if(!gavl_string_ends_with(var, "99-99")) metadata = add_metadata_string(metadata, var, BG_ICON_CALENDAR); else { tmp_string = gavl_strndup(var, var + 4); metadata = add_metadata_string(metadata, tmp_string, BG_ICON_CALENDAR); free(tmp_string); } } } // markup = add_metadata_markup_array(markup, m, GAVL_META_APPROX_DURATION, BG_ICON_CLOCK); if(gavl_dictionary_get_long(m, GAVL_META_APPROX_DURATION, &duration) && (duration > 0)) { char str[GAVL_TIME_STRING_LEN]; gavl_time_prettyprint(duration, str); metadata = add_metadata_string(metadata, str, BG_ICON_CLOCK); } if(metadata) markup = gavl_strcat(markup, metadata); markup = gavl_strcat(markup, ""); if(metadata) free(metadata); return markup; } static void set_volume_icon(main_window_t * w, double volume) { if(volume < 1.0/3.0) gtk_label_set_text(GTK_LABEL(w->volume_label), BG_ICON_VOLUME_MIN); else if(volume < 2.0/3.0) gtk_label_set_text(GTK_LABEL(w->volume_label), BG_ICON_VOLUME_MID); else gtk_label_set_text(GTK_LABEL(w->volume_label), BG_ICON_VOLUME_MAX); } static gboolean do_configure(gpointer data) { gmerlin_t * gmerlin; gmerlin = (gmerlin_t*)data; gmerlin_configure(gmerlin); return FALSE; } static int handle_player_message_gmerlin(void * data, gavl_msg_t * msg) { main_window_t * w = data; switch(msg->NS) { case GAVL_MSG_NS_GENERIC: switch(msg->ID) { case GAVL_CMD_SET_RESOURCE: { const char * klass; const char * uri; gavl_dictionary_t dev; gavl_dictionary_init(&dev); gavl_msg_get_arg_dictionary_c(msg, 0, &dev); // fprintf(stderr, "Set Resource\n"); // gavl_dictionary_dump(&dev, 2); if((klass = gavl_dictionary_get_string(&dev, GAVL_META_CLASS)) && (uri = gavl_dictionary_get_string(&dev, GAVL_META_URI))) { if(!strcmp(klass, GAVL_META_CLASS_BACKEND_MDB)) { pthread_mutex_lock(&w->g->backend_mutex); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Changing MDB: %s", uri); gmerlin_disconnect_mdb(w->g); w->g->mdb_ctrl = NULL; if(w->g->mdb_backend) { bg_plugin_unref(w->g->mdb_backend); w->g->mdb_backend = NULL; } if(!strcmp(uri, "local")) w->g->mdb_ctrl = bg_mdb_get_controllable(w->g->mdb); else { if((w->g->mdb_backend = bg_backend_handle_create(&dev))) w->g->mdb_ctrl = bg_backend_handle_get_controllable(w->g->mdb_backend); } gmerlin_connect_mdb(w->g); pthread_mutex_unlock(&w->g->backend_mutex); } else if(!strcmp(klass, GAVL_META_CLASS_BACKEND_RENDERER)) { pthread_mutex_lock(&w->g->backend_mutex); gmerlin_disconnect_player(w->g); w->g->player_ctrl = NULL; if(w->g->player_backend) { bg_plugin_unref(w->g->player_backend); w->g->player_backend = NULL; } gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Changing renderer: %s", uri); if(!strcmp(uri, "local")) w->g->player_ctrl = bg_player_get_controllable(w->g->player); else { if((w->g->player_backend = bg_backend_handle_create(&dev))) w->g->player_ctrl = bg_backend_handle_get_controllable(w->g->player_backend); else { gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Creating renderer failed"); break; } } gmerlin_connect_player(w->g); pthread_mutex_unlock(&w->g->backend_mutex); } else if(!strcmp(klass, GAVL_META_CLASS_SINK_AUDIO)) { gavl_value_t val; gavl_msg_t * msg; fprintf(stderr, "Set audio sink\n"); gavl_value_init(&val); gavl_value_set_string(&val, uri); msg = bg_msg_sink_get(w->player_ctrl.cmd_sink); gavl_msg_set_state(msg, BG_CMD_SET_STATE, 1, BG_PLAYER_STATE_CTX, BG_PLAYER_STATE_OA_URI, &val); bg_msg_sink_put(w->player_ctrl.cmd_sink); gavl_value_free(&val); } else if(!strcmp(klass, GAVL_META_CLASS_SINK_VIDEO)) { gavl_value_t val; gavl_msg_t * msg; fprintf(stderr, "Set video sink\n"); gavl_value_init(&val); gavl_value_set_string(&val, uri); msg = bg_msg_sink_get(w->player_ctrl.cmd_sink); gavl_msg_set_state(msg, BG_CMD_SET_STATE, 1, BG_PLAYER_STATE_CTX, BG_PLAYER_STATE_OV_URI, &val); bg_msg_sink_put(w->player_ctrl.cmd_sink); gavl_value_free(&val); } } // gavl_dictionary_dump(&dev, 2); gavl_dictionary_free(&dev); // fprintf(stderr, "\n"); } break; } break; case BG_MSG_NS_STATE: switch(msg->ID) { case BG_MSG_STATE_CHANGED: { gavl_value_t val; const char * ctx; const char * var; int last; gavl_value_init(&val); gavl_msg_get_state(msg, &last, &ctx, &var, &val, &w->g->state); if(!strcmp(ctx, BG_PLAYER_STATE_CTX)) { if(!strcmp(var, BG_PLAYER_STATE_TIME) && (w->display_mode == DISPLAY_MODE_NORMAL)) // dictionary { gavl_time_t t; if(gavl_value_get_long(&val, &t)) set_time_label(w, t); } else if(!strcmp(var, BG_PLAYER_STATE_TIME_REM) && (w->display_mode == DISPLAY_MODE_REM)) // long { gavl_time_t t; if(gavl_value_get_long(&val, &t)) set_time_label(w, t); } else if(!strcmp(var, BG_PLAYER_STATE_TIME_ABS) && (w->display_mode == DISPLAY_MODE_ALL)) // long { gavl_time_t t; if(gavl_value_get_long(&val, &t)) set_time_label(w, t); } else if(!strcmp(var, BG_PLAYER_STATE_TIME_REM_ABS) && (w->display_mode == DISPLAY_MODE_ALL_REM)) // long { gavl_time_t t; if(gavl_value_get_long(&val, &t)) set_time_label(w, t); } else if(!strcmp(var, BG_PLAYER_STATE_TIME_PERC)) // float { if(!(w->seek_flags & SEEK_ACTIVE)) { double perc = -1.0; if(gavl_value_get_float(&val, &perc) && (perc >= 0.0)) { g_signal_handler_block(G_OBJECT(w->seek_slider), w->seek_change_id); gtk_range_set_value(GTK_RANGE(w->seek_slider), perc); g_signal_handler_unblock(G_OBJECT(w->seek_slider), w->seek_change_id); } } } else if(!strcmp(var, BG_PLAYER_STATE_VOLUME)) // float { g_signal_handler_block(G_OBJECT(w->volume_slider), w->volume_change_id); gtk_range_set_value(GTK_RANGE(w->volume_slider), val.v.d); g_signal_handler_unblock(G_OBJECT(w->volume_slider), w->volume_change_id); set_volume_icon(w, val.v.d); } else if(!strcmp(var, BG_PLAYER_STATE_STATUS)) // int { GtkStyleContext * context; const char * icon = bg_player_get_state_icon(val.v.i); gtk_label_set_text(GTK_LABEL(w->status_label), icon); context = gtk_widget_get_style_context(w->track_info); if(val.v.i == BG_PLAYER_STATUS_ERROR) { if(gtk_style_context_has_class(context, "track-info")) { gtk_style_context_remove_class(context,"track-info"); gtk_style_context_add_class(context,"error-info"); } } else { if(gtk_style_context_has_class(context, "error-info")) { gtk_style_context_remove_class(context,"error-info"); gtk_style_context_add_class(context,"track-info"); } } switch(val.v.i) { case BG_PLAYER_STATUS_STOPPED: gtk_widget_hide(w->track_image); gtk_widget_hide(w->track_icon); gtk_label_set_markup(GTK_LABEL(w->track_info), DEFAULT_LABEL); gtk_widget_set_sensitive(w->seek_slider, FALSE); break; case BG_PLAYER_STATUS_ERROR: { gtk_widget_hide(w->track_image); gtk_widget_hide(w->track_icon); gtk_label_set_markup(GTK_LABEL(w->track_info), ERROR_LABEL); gtk_widget_set_sensitive(w->seek_slider, FALSE); bg_gtk_log_window_flush(w->g->log_window); } break; case BG_PLAYER_STATUS_PLAYING: w->seek_flags = 0; break; } } else if(!strcmp(var, BG_PLAYER_STATE_MODE)) // int { const char * icon = bg_play_mode_to_icon(val.v.i); gtk_label_set_text(GTK_LABEL(w->mode_label), icon); } else if(!strcmp(var, BG_PLAYER_STATE_CURRENT_TRACK)) // dictionary { char * markup; const gavl_dictionary_t * dict; const gavl_dictionary_t * m; GdkPixbuf * pbuf; int num_audio_streams; int num_video_streams; int num_text_streams; int num_overlay_streams; int i; int can_seek; gavl_time_t duration; duration = GAVL_TIME_UNDEFINED; can_seek = 0; // fprintf(stderr, "Track changed\n"); if(!(dict = gavl_value_get_dictionary(&val)) || !(m = gavl_track_get_metadata(dict))) break; bg_gtk_trackinfo_set(w->g->info_window, dict); if((pbuf = bg_gtk_load_track_image(dict, 80, 80))) { gtk_image_set_from_pixbuf(GTK_IMAGE(w->track_image), pbuf); gtk_widget_show(w->track_image); gtk_widget_hide(w->track_icon); } else { // gavl_log(GAVL_LOG_WARNING, LOG_DOMAIN, "Got no track image"); // gavl_dictionary_dump(dict, 2); gtk_widget_hide(w->track_image); } /* TODO: Track icon */ gavl_dictionary_get_long(m, GAVL_META_APPROX_DURATION, &duration); gavl_dictionary_get_int(m, GAVL_META_CAN_SEEK, &can_seek); if((duration < 0) && !gavl_dictionary_get(m, GAVL_STATE_SRC_SEEK_WINDOW)) { gtk_range_set_range(GTK_RANGE(w->seek_slider), 0.0, 0.0); } else { gtk_range_set_range(GTK_RANGE(w->seek_slider), 0.0, 1.0); } if(can_seek) // Can seek { gtk_widget_set_sensitive(w->seek_slider, TRUE); } else { gtk_widget_set_sensitive(w->seek_slider, FALSE); } markup = get_track_markup(m); gtk_label_set_markup(GTK_LABEL(w->track_info), markup); free(markup); /* Update menu */ num_audio_streams = gavl_track_get_num_audio_streams(dict); num_video_streams = gavl_track_get_num_video_streams(dict); num_text_streams = gavl_track_get_num_text_streams(dict); num_overlay_streams = gavl_track_get_num_overlay_streams(dict); main_menu_set_num_streams(w->g->main_menu, num_audio_streams, num_video_streams, num_text_streams + num_overlay_streams); for(i = 0; i < num_audio_streams; i++) main_menu_set_audio_info(w->g->main_menu, i, gavl_track_get_audio_metadata(dict, i)); for(i = 0; i < num_video_streams; i++) main_menu_set_video_info(w->g->main_menu, i, gavl_track_get_video_metadata(dict, i)); for(i = 0; i < num_text_streams; i++) main_menu_set_subtitle_info(w->g->main_menu, i, gavl_track_get_text_metadata(dict, i)); for(i = 0; i < num_overlay_streams; i++) main_menu_set_subtitle_info(w->g->main_menu, i + num_text_streams, gavl_track_get_overlay_metadata(dict, i)); main_menu_set_chapters(w->g->main_menu, gavl_dictionary_get_chapter_list(m)); } else if(!strcmp(var, BG_PLAYER_STATE_MUTE)) // int { if(val.v.i) gtk_label_set_text(GTK_LABEL(w->volume_label), BG_ICON_VOLUME_MUTE); else set_volume_icon(w, gtk_range_get_value(GTK_RANGE(w->volume_slider))); } else if(!strcmp(var, BG_PLAYER_STATE_CHAPTER)) // int { int chapter; if(!gavl_value_get_int(&val, &chapter)) return 1; main_menu_chapter_changed(w->g->main_menu, chapter); } else if(!strcmp(var, BG_PLAYER_STATE_AUDIO_STREAM_CURRENT)) // int { int stream; if(!gavl_value_get_int(&val, &stream)) return 1; main_menu_set_audio_index(w->g->main_menu, stream); } else if(!strcmp(var, BG_PLAYER_STATE_VIDEO_STREAM_CURRENT)) // int { int stream; if(!gavl_value_get_int(&val, &stream)) return 1; main_menu_set_video_index(w->g->main_menu, stream); } else if(!strcmp(var, BG_PLAYER_STATE_SUBTITLE_STREAM_CURRENT)) // int { int stream; if(!gavl_value_get_int(&val, &stream)) return 1; main_menu_set_subtitle_index(w->g->main_menu, stream); } else if(!strcmp(var, BG_PLAYER_STATE_OV_URI)) // string { // fprintf(stderr, "Got OV uri: %s\n", gavl_value_get_string(&val)); main_menu_set_ov_uri(w->g->main_menu, gavl_value_get_string(&val)); } else if(!strcmp(var, BG_PLAYER_STATE_OA_URI)) // string { // fprintf(stderr, "Got OA uri: %s\n", gavl_value_get_string(&val)); main_menu_set_oa_uri(w->g->main_menu, gavl_value_get_string(&val)); } #if 0 else fprintf(stderr, "State changed %s\n", var); #endif } else if(!strcmp(ctx, BG_GTK_LOGWINDOW_STATE_CTX)) { if(!strcmp(var, BG_GTK_LOGWINDOW_VISIBLE)) { int enable = 0; if(!gavl_value_get_int(&val, &enable)) return 1; main_menu_set_log_window_item(w->g->main_menu, enable); } } else if(!strcmp(ctx, GAVL_STATE_CTX_SRC)) { fprintf(stderr, "src state changed: %s\n", var); gavl_value_dump(&val, 2); } gavl_value_free(&val); } break; } break; case BG_MSG_NS_PLAYER: { int arg_i_1; switch(msg->ID) { case BG_PLAYER_MSG_ACCEL: arg_i_1 = gavl_msg_get_arg_int(msg, 0); switch(arg_i_1) { case BG_PLAYER_ACCEL_PLAY: { const gavl_value_t * status_val; if(!(status_val = bg_state_get(&w->g->state, BG_PLAYER_STATE_CTX, BG_PLAYER_STATE_STATUS))) break; if(status_val->v.i == BG_PLAYER_STATUS_PLAYING) return 1; else if(status_val->v.i == BG_PLAYER_STATUS_PAUSED) bg_player_pause(w->player_ctrl.cmd_sink); else bg_player_play(w->player_ctrl.cmd_sink); break; } case ACCEL_QUIT: bg_gtk_quit(); return 0; break; case ACCEL_CURRENT_TO_FAVOURITES: // bg_media_tree_copy_current_to_favourites(win->gmerlin->tree); return 1; break; case ACCEL_OPTIONS: g_idle_add(do_configure, w->g); break; case ACCEL_GOTO_CURRENT: // bg_gtk_tree_window_goto_current(win->gmerlin->tree_window); break; } break; } } } return 1; } static gboolean idle_callback(gpointer data) { main_window_t * w = data; bg_msg_sink_iteration(w->player_ctrl.evt_sink); /* Handle remote registry */ main_menu_ping(w->g->main_menu); return TRUE; } static void mode_pressed(GtkGestureMultiPress *gesture, int n_press, double x, double y, gpointer user_data) { main_window_t * w = user_data; gavl_value_t val; gavl_msg_t * msg; gavl_value_init(&val); gavl_value_set_int(&val, 1); // Toggle msg = bg_msg_sink_get(w->player_ctrl.cmd_sink); gavl_msg_set_state(msg, BG_CMD_SET_STATE_REL, 1, BG_PLAYER_STATE_CTX, BG_PLAYER_STATE_MODE, &val); bg_msg_sink_put(w->player_ctrl.cmd_sink); } static void time_pressed(GtkGestureMultiPress *gesture, int n_press, double x, double y, gpointer user_data) { main_window_t * w = user_data; w->display_mode++; if(w->display_mode >= NUM_DISPLAY_MODES) w->display_mode = DISPLAY_MODE_NORMAL; set_display_mode(w); } void main_window_init(main_window_t * ret, gmerlin_t * g) { GtkWidget * main_grid; GtkWidget * subgrid; GtkWidget * subsubgrid; GtkWidget * headerbar; char * path; GtkGesture *gesture; ret->g = g; /* Load css stuff */ ret->icon_provider = gtk_css_provider_new(); ret->skin_provider = gtk_css_provider_new(); if((path = bg_search_file_read("player", "gmerlin-player.css"))) { gtk_css_provider_load_from_path(ret->skin_provider, path, NULL); free(path); } gtk_css_provider_load_from_data(ret->icon_provider, icon_css, -1, NULL); ret->win = bg_gtk_window_new(GTK_WINDOW_TOPLEVEL); set_css_class(ret->win, ret->skin_provider, NULL, "playerwindow"); /* Header bar */ headerbar = gtk_header_bar_new(); set_css_class(headerbar, ret->skin_provider, NULL, "windowheader"); gtk_window_set_titlebar(GTK_WINDOW(ret->win), headerbar); gtk_header_bar_set_title(GTK_HEADER_BAR(headerbar), "Gmerlin Player"); gtk_header_bar_set_has_subtitle(GTK_HEADER_BAR(headerbar), FALSE); ret->close_button = title_button_create(ret, BG_ICON_X); ret->menu_button = title_button_create(ret, BG_ICON_MENU); gtk_header_bar_pack_start(GTK_HEADER_BAR(headerbar), ret->menu_button); gtk_header_bar_pack_end(GTK_HEADER_BAR(headerbar), ret->close_button); gtk_widget_show(headerbar); /* */ main_grid = gtk_grid_new(); /* Display grid */ subgrid = gtk_grid_new(); /* Upper row */ subsubgrid = gtk_grid_new(); ret->status_label = gtk_label_new(BG_ICON_STOP); set_css_class(ret->status_label, ret->skin_provider, ret->icon_provider, "status-label"); gtk_widget_set_hexpand(ret->status_label, FALSE); gtk_widget_set_vexpand(ret->status_label, FALSE); gtk_widget_set_halign(ret->status_label, GTK_ALIGN_START); gtk_widget_show(ret->status_label); ret->mode_label = gtk_label_new(BG_ICON_ARROW_RIGHT); set_css_class(ret->mode_label, ret->skin_provider, ret->icon_provider, "mode-label"); gtk_widget_set_hexpand(ret->mode_label, FALSE); gtk_widget_set_vexpand(ret->mode_label, FALSE); gtk_widget_set_halign(ret->mode_label, GTK_ALIGN_START); gtk_widget_show(ret->mode_label); ret->mode_box = gtk_event_box_new(); bg_gtk_tooltips_set_tip(ret->mode_box, "Playback mode\nClick to change", PACKAGE); gesture = gtk_gesture_multi_press_new(ret->mode_box); g_signal_connect(G_OBJECT(gesture), "pressed", G_CALLBACK(mode_pressed), ret); // gtk_widget_add_controller(ret->mode_box, GTK_EVENT_CONTROLLER(gesture)); gtk_container_add(GTK_CONTAINER(ret->mode_box), ret->mode_label); gtk_widget_set_hexpand(ret->mode_box, FALSE); gtk_widget_set_vexpand(ret->mode_box, FALSE); gtk_widget_set_halign(ret->mode_label, GTK_ALIGN_START); gtk_widget_show(ret->mode_box); gtk_grid_attach(GTK_GRID(subsubgrid), ret->status_label, 0, 0, 1, 2); gtk_grid_attach(GTK_GRID(subsubgrid), ret->mode_box, 1, 0, 1, 2); ret->time_label = gtk_label_new("0:00"); set_css_class(ret->time_label, ret->skin_provider, NULL, "time-label"); gtk_widget_set_hexpand(ret->time_label, TRUE); gtk_widget_set_halign(ret->time_label, GTK_ALIGN_END); gtk_widget_show(ret->time_label); ret->time_box = gtk_event_box_new(); gesture = gtk_gesture_multi_press_new(ret->time_box); g_signal_connect(G_OBJECT(gesture), "pressed", G_CALLBACK(time_pressed), ret); gtk_widget_set_hexpand(ret->time_box, TRUE); gtk_widget_set_vexpand(ret->time_box, FALSE); gtk_widget_set_halign(ret->time_box, GTK_ALIGN_END); bg_gtk_tooltips_set_tip(ret->time_box, "Click to change time display mode", PACKAGE); gtk_widget_show(ret->time_box); gtk_container_add(GTK_CONTAINER(ret->time_box), ret->time_label); gtk_grid_attach(GTK_GRID(subsubgrid), ret->time_box, 2, 0, 1, 2); ret->all_label = gtk_label_new("ALL"); gtk_widget_set_hexpand(ret->all_label, FALSE); gtk_widget_set_vexpand(ret->all_label, FALSE); set_css_class(ret->all_label, ret->skin_provider, NULL, "all-label"); gtk_widget_show(ret->all_label); gtk_grid_attach(GTK_GRID(subsubgrid), ret->all_label, 3, 0, 1, 1); ret->rem_label = gtk_label_new("REM"); gtk_widget_set_hexpand(ret->rem_label, FALSE); gtk_widget_set_vexpand(ret->rem_label, FALSE); set_css_class(ret->rem_label, ret->skin_provider, NULL, "rem-label"); gtk_widget_show(ret->rem_label); gtk_grid_attach(GTK_GRID(subsubgrid), ret->rem_label, 3, 1, 1, 1); gtk_widget_set_hexpand(subgrid, TRUE); gtk_widget_set_vexpand(subgrid, TRUE); set_css_class(subgrid, ret->skin_provider, NULL, "display"); gtk_widget_show(subsubgrid); gtk_grid_attach(GTK_GRID(subgrid), subsubgrid, 0, 0, 1, 1); /* Lower row */ subsubgrid = gtk_grid_new(); set_css_class(subsubgrid, ret->skin_provider, NULL, "track-display"); ret->track_image = gtk_image_new(); set_css_class(ret->track_image, ret->skin_provider, NULL, "track-image"); gtk_grid_attach(GTK_GRID(subsubgrid), ret->track_image, 0, 0, 1, 1); gtk_widget_set_valign(ret->track_image, GTK_ALIGN_CENTER); gtk_widget_set_halign(ret->track_image, GTK_ALIGN_START); gtk_widget_set_hexpand(ret->track_image, FALSE); ret->track_icon = gtk_label_new(NULL); set_css_class(ret->track_icon, ret->skin_provider, ret->icon_provider, "track-icon"); gtk_grid_attach(GTK_GRID(subsubgrid), ret->track_icon, 1, 0, 1, 1); ret->track_info = gtk_label_new(DEFAULT_LABEL); set_css_class(ret->track_info, ret->skin_provider, NULL, "track-info"); gtk_label_set_line_wrap(GTK_LABEL(ret->track_info), TRUE); gtk_widget_set_valign(ret->track_info, GTK_ALIGN_START); gtk_widget_set_halign(ret->track_info, GTK_ALIGN_START); gtk_widget_set_hexpand(ret->track_info, TRUE); gtk_widget_show(ret->track_info); gtk_grid_attach(GTK_GRID(subsubgrid), ret->track_info, 2, 0, 1, 1); gtk_widget_show(subsubgrid); gtk_grid_attach(GTK_GRID(subgrid), subsubgrid, 0, 1, 1, 1); #if 0 { GValue val; GtkStyleContext* c = gtk_widget_get_style_context(subsubgrid); gtk_style_context_get_style_property(c, "min-width", &val); fprintf(stderr, "max_width: %d\n", g_value_get_int(&val)); g_value_unset(&val); gtk_style_context_get_style_property(c, "min-height", &val); fprintf(stderr, "max_height: %d\n", g_value_get_int(&val)); g_value_unset(&val); } #endif /* Pack display grid */ gtk_widget_show(subgrid); gtk_grid_attach(GTK_GRID(main_grid), subgrid, 0, 0, 1, 1); /* Seek slider */ // subgrid = gtk_grid_new(); // gtk_grid_set_column_homogeneous(GTK_GRID(subgrid), // TRUE); ret->seek_slider = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.0, 1.0, 0.01); set_css_class(ret->seek_slider, ret->skin_provider, NULL, "seek-slider"); ret->seek_change_id = g_signal_connect(G_OBJECT(ret->seek_slider), "value-changed", G_CALLBACK(scale_value_changed), ret); g_signal_connect(G_OBJECT(ret->seek_slider), "button-press-event", G_CALLBACK(button_press_event), ret); g_signal_connect(G_OBJECT(ret->seek_slider), "button-release-event", G_CALLBACK(button_release_event), ret); gtk_scale_set_draw_value(GTK_SCALE(ret->seek_slider), FALSE); gtk_widget_show(ret->seek_slider); gtk_grid_attach(GTK_GRID(main_grid), ret->seek_slider, 0, 1, 1, 1); /* Player buttons and volume */ subgrid = gtk_grid_new(); ret->play_button = player_button_create(ret, BG_ICON_PLAY); ret->stop_button = player_button_create(ret, BG_ICON_STOP); ret->pause_button = player_button_create(ret, BG_ICON_PAUSE); ret->next_button = player_button_create(ret, BG_ICON_NEXT); ret->prev_button = player_button_create(ret, BG_ICON_PREV); /* Volume label */ ret->volume_label = gtk_label_new(BG_ICON_VOLUME_MIN); set_css_class(ret->volume_label, ret->skin_provider, ret->icon_provider, "volume-label"); gtk_widget_set_vexpand(ret->volume_label, FALSE); gtk_widget_set_valign(ret->volume_label, GTK_ALIGN_CENTER); gtk_widget_show(ret->volume_label); /* Volume slider */ ret->volume_slider = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0.0, 1.0, 0.01); ret->volume_change_id = g_signal_connect(G_OBJECT(ret->volume_slider), "value-changed", G_CALLBACK(scale_value_changed), ret); g_signal_connect(G_OBJECT(ret->volume_slider), "button-press-event", G_CALLBACK(button_press_event), ret); g_signal_connect(G_OBJECT(ret->volume_slider), "button-release-event", G_CALLBACK(button_release_event), ret); set_css_class(ret->volume_slider, ret->skin_provider, NULL, "volume-slider"); gtk_scale_set_draw_value(GTK_SCALE(ret->volume_slider), FALSE); gtk_widget_set_hexpand(ret->volume_slider, TRUE); gtk_widget_set_halign(ret->volume_slider, GTK_ALIGN_FILL); gtk_widget_show(ret->volume_slider); gtk_grid_attach(GTK_GRID(subgrid), ret->prev_button, 0, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->stop_button, 1, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->play_button, 2, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->pause_button, 3, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->next_button, 4, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->volume_label, 5, 0, 1, 1); gtk_grid_attach(GTK_GRID(subgrid), ret->volume_slider, 6, 0, 1, 1); gtk_widget_set_vexpand(subgrid, FALSE); gtk_widget_set_valign(subgrid, GTK_ALIGN_FILL); gtk_widget_set_hexpand(subgrid, TRUE); gtk_widget_show(subgrid); gtk_grid_attach(GTK_GRID(main_grid), subgrid, 0, 2, 2, 1); /* */ gtk_widget_show(main_grid); gtk_container_add(GTK_CONTAINER(ret->win), main_grid); bg_control_init(&ret->player_ctrl, bg_msg_sink_create(handle_player_message_gmerlin, ret, 0)); g_timeout_add(DELAY_TIME, idle_callback, (gpointer)ret); set_display_mode(ret); gtk_window_add_accel_group (GTK_WINDOW(ret->win), ret->g->accel_group); } void main_window_show(main_window_t * w) { gtk_widget_show(w->win); } void main_window_connect(main_window_t * w) { bg_controllable_connect(w->g->player_ctrl, &w->player_ctrl); } void main_window_disconnect(main_window_t * w) { bg_controllable_disconnect(w->g->player_ctrl, &w->player_ctrl); } bplaum-gmerlin-ebbe714/apps/player/player_remote.h000066400000000000000000000026311513225502300223770ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #define PLAYER_REMOTE_PORT (BG_REMOTE_PORT_BASE+1) #define PLAYER_REMOTE_PATH "/ws/renderer" #define PLAYER_REMOTE_ENV "GMERLIN_PLAYER_REMOTE_PORT" /* Player commands */ /* Add or play a location (arg1: Location) */ #define PLAYER_COMMAND_ADD_LOCATION (BG_PLAYER_MSG_MAX+6) #define PLAYER_COMMAND_PLAY_LOCATION (BG_PLAYER_MSG_MAX+7) /* Open devices */ #define PLAYER_COMMAND_OPEN_DEVICE (BG_PLAYER_MSG_MAX+12) #define PLAYER_COMMAND_PLAY_DEVICE (BG_PLAYER_MSG_MAX+13) bplaum-gmerlin-ebbe714/apps/player/playerwindow.h000066400000000000000000000057471513225502300222670ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include typedef struct { char * background; char * background_highlight; bg_gtk_button_skin_t play_button; bg_gtk_button_skin_t pause_button; bg_gtk_button_skin_t prev_button; bg_gtk_button_skin_t next_button; bg_gtk_button_skin_t stop_button; bg_gtk_button_skin_t menu_button; bg_gtk_button_skin_t close_button; bg_gtk_slider_skin_t seek_slider; bg_gtk_slider_skin_t volume_slider; display_skin_t display; } player_window_skin_t; void player_window_skin_load(player_window_skin_t *, xmlDocPtr doc, xmlNodePtr node); void player_window_skin_destroy(player_window_skin_t *); /* Player window */ typedef struct player_window_s { gmerlin_t * gmerlin; /* Window stuff */ GtkWidget * window; GtkWidget * layout; /* For moving the window */ int mouse_x; int mouse_y; int window_x; int window_y; /* Background */ cairo_surface_t * background_pixbuf; cairo_surface_t * background_pixbuf_highlight; int mouse_inside; /* GUI Elements */ bg_gtk_button_t * play_button; bg_gtk_button_t * stop_button; bg_gtk_button_t * pause_button; bg_gtk_button_t * next_button; bg_gtk_button_t * prev_button; bg_gtk_button_t * close_button; bg_gtk_button_t * menu_button; bg_gtk_slider_t * seek_slider; bg_gtk_slider_t * volume_slider; display_t * display; gavl_time_t duration; int seek_active; float volume; /* For the player window only (NOT for album windows) */ GtkAccelGroup *accel_group; /* For avoiding infinite recursions */ guint enter_notify_id; guint leave_notify_id; int have_state; } player_window_t; void player_window_create(gmerlin_t*); void player_window_show(player_window_t * win); void player_window_set_skin(player_window_t * win, player_window_skin_t*, const char * directory); void player_window_destroy(player_window_t * win); void player_window_init_state(gavl_dictionary_t * dict); bplaum-gmerlin-ebbe714/apps/player/remote.c000066400000000000000000000040571513225502300210220ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include "gmerlin.h" #include "player_remote.h" void gmerlin_handle_remote(gmerlin_t * g, gavl_msg_t * msg) { int id; const char * arg_str; const char * locations[2]; id = gavl_msg_get_id(msg); fprintf(stderr, "gmerlin_handle_remote %d\n", id); switch(id) { case PLAYER_COMMAND_ADD_LOCATION: arg_str = gavl_msg_get_arg_string_c(msg, 0); locations[0] = arg_str; locations[1] = NULL; gmerlin_add_locations(g, locations); break; case PLAYER_COMMAND_PLAY_LOCATION: arg_str = gavl_msg_get_arg_string_c(msg, 0); locations[0] = arg_str; locations[1] = NULL; gmerlin_play_locations(g, locations); break; case PLAYER_COMMAND_OPEN_DEVICE: arg_str = gavl_msg_get_arg_string_c(msg, 0); gmerlin_open_device(g, arg_str); break; case PLAYER_COMMAND_PLAY_DEVICE: arg_str = gavl_msg_get_arg_string_c(msg, 0); gmerlin_play_device(g, arg_str); break; default: { /* Send to player */ bg_msg_sink_t * s = g->player_ctrl->cmd_sink; bg_msg_sink_put_copy(s, msg); } } } bplaum-gmerlin-ebbe714/apps/player/skin.c000066400000000000000000000045701513225502300204730ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include "gmerlin.h" #include #include static const char * default_skin_directory = DATA_DIR"/skins/Default"; char * gmerlin_skin_load(gmerlin_skin_t * s, char * directory) { xmlNodePtr node; char * filename = NULL; xmlDocPtr doc = NULL; filename = gavl_sprintf("%s/skin.xml", directory); doc = xmlParseFile(filename); if(!doc) { free(filename); directory = gavl_strrep(directory, default_skin_directory); filename = gavl_sprintf("%s/skin.xml", directory); doc = xmlParseFile(filename); } if(!doc) { goto fail; } s->directory = gavl_strrep(s->directory, directory); node = doc->children; if(BG_XML_STRCMP(node->name, "SKIN")) { goto fail; } node = node->children; while(node) { if(!node->name) { node = node->next; continue; } /* Main window */ if(!BG_XML_STRCMP(node->name, "PLAYERWIN")) player_window_skin_load(&s->playerwindow, doc, node); node = node->next; } fail: if(doc) xmlFreeDoc(doc); if(filename) free(filename); return directory; } void gmerlin_skin_set(gmerlin_t * g) { player_window_set_skin(g->player_window, &g->skin.playerwindow, g->skin.directory); } void gmerlin_skin_free(gmerlin_skin_t * s) { } bplaum-gmerlin-ebbe714/apps/remote/000077500000000000000000000000001513225502300173545ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/remote/Makefile.am000066400000000000000000000010231513225502300214040ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CPPFLAGS = -I$(top_srcdir)/include AM_CFLAGS = \ @XML2_CFLAGS@ \ @DBUS_CFLAGS@ \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ Desktopdir = $(datadir)/applications Desktop_DATA = gmerlin-remote.desktop bin_PROGRAMS = gmerlin-remote gmerlin_remote_SOURCES = \ gmerlin-remote.c gmerlin_remote_LDADD = $(top_builddir)/lib/libgmerlin.la @UUID_LIBS@ EXTRA_DIST = gmerlin-remote.desktop bplaum-gmerlin-ebbe714/apps/remote/gmerlin-remote.c000066400000000000000000000356511513225502300224600ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #include #include #include // #include #include #include #include #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "gmerlin-remote" #ifdef HAVE_DBUS #include #endif gavl_time_t duration = GAVL_TIME_UNDEFINED; static char * remote_addr = NULL; static int local_port = 0; bg_controllable_t * backend_ctrl = NULL; bg_plugin_handle_t * backend = NULL; bg_http_server_t * srv = NULL; static char * label = NULL; static gavl_array_t fe_arr; static void flush_command() { // gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Flush 1"); while(bg_backend_handle_ping(backend) > 0) ; // gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Flush 2"); } static void cmd_scan(void * data, int * argc, char *** _argv, int arg) { bg_resourcemanager_get_controllable(); bg_resource_list_by_class(GAVL_META_CLASS_BACKEND_RENDERER, 1, 3*GAVL_TIME_SCALE); exit(EXIT_SUCCESS); } static void cmd_play(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_PLAYER_MSG_ACCEL, BG_MSG_NS_PLAYER); gavl_msg_set_arg_int(msg, 0, BG_PLAYER_ACCEL_PLAY); bg_msg_sink_put(backend_ctrl->cmd_sink); flush_command(); } static void cmd_next(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_PLAYER_MSG_ACCEL, BG_MSG_NS_PLAYER); gavl_msg_set_arg_int(msg, 0, BG_PLAYER_ACCEL_NEXT); bg_msg_sink_put(backend_ctrl->cmd_sink); flush_command(); } static void cmd_prev(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_PLAYER_MSG_ACCEL, BG_MSG_NS_PLAYER); gavl_msg_set_arg_int(msg, 0, BG_PLAYER_ACCEL_PREV); bg_msg_sink_put(backend_ctrl->cmd_sink); flush_command(); } static void cmd_stop(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); gavl_msg_set_id_ns(msg, BG_PLAYER_MSG_ACCEL, BG_MSG_NS_PLAYER); gavl_msg_set_arg_int(msg, 0, BG_PLAYER_ACCEL_STOP); bg_msg_sink_put(backend_ctrl->cmd_sink); flush_command(); } static void cmd_toggle_mute(void * data, int * argc, char *** _argv, int arg) { bg_player_toggle_mute(backend_ctrl->cmd_sink); } static void cmd_pause(void * data, int * argc, char *** _argv, int arg) { gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); bg_player_pause_m(msg); bg_msg_sink_put(backend_ctrl->cmd_sink); flush_command(); } static void cmd_addplay(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; gavl_dictionary_t m; gavl_dictionary_init(&m); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -addplay requires an argument\n"); exit(-1); } bg_player_load_uri(backend_ctrl->cmd_sink, argv[arg], 1); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_add(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -add requires an argument\n"); exit(-1); } bg_player_load_uri(backend_ctrl->cmd_sink, argv[arg], 0); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_volume(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; float vol; gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -volume requires an argument\n"); exit(-1); } vol = strtod(argv[arg], NULL); bg_player_set_volume_m(msg, vol); bg_msg_sink_put(backend_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_volume_rel(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; float vol; gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -volume_rel requires an argument\n"); exit(-1); } vol = strtod(argv[arg], NULL); bg_player_set_volume_rel_m(msg, vol); bg_msg_sink_put(backend_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_seek_rel(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; float diff; gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -seek_rel requires an argument\n"); exit(-1); } diff = strtod(argv[arg], NULL); bg_player_seek_rel_m(msg, gavl_seconds_to_time(diff)); bg_msg_sink_put(backend_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_seek_perc(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; float perc; gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -seek_rel requires an argument\n"); exit(-1); } perc = strtod(argv[arg], NULL); bg_player_seek_perc_m(msg, perc / 100.0); bg_msg_sink_put(backend_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } static void cmd_chapter(void * data, int * argc, char *** _argv, int arg) { char ** argv = *_argv; int index; gavl_msg_t * msg = bg_msg_sink_get(backend_ctrl->cmd_sink); if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -chapter requires an argument\n"); exit(-1); } if(!strcmp(argv[arg], "+")) bg_player_next_chapter_m(msg); else if(!strcmp(argv[arg], "-")) bg_player_prev_chapter_m(msg); else { index = atoi(argv[arg]); bg_player_set_chapter_m(msg, index); } bg_msg_sink_put(backend_ctrl->cmd_sink); bg_cmdline_remove_arg(argc, _argv, arg); flush_command(); } bg_cmdline_arg_t commands[] = { { .arg = "-play", .help_string = TRS("Play current track"), .callback = cmd_play, }, { .arg = "-next", .help_string = TRS("Switch to next track"), .callback = cmd_next, }, { .arg = "-prev", .help_string = TRS("Switch to previous track"), .callback = cmd_prev, }, { .arg = "-stop", .help_string = TRS("Stop playback"), .callback = cmd_stop, }, { .arg = "-pause", .help_string = TRS("Pause playback"), .callback = cmd_pause, }, { .arg = "-mute", .help_string = TRS("Toggle mute"), .callback = cmd_toggle_mute, }, #if 1 { .arg = "-add", .help_arg = TRS(""), .help_string = TRS("Add to the incoming album"), .callback = cmd_add, }, { .arg = "-addplay", .help_arg = TRS(""), .help_string = TRS("Add to the incoming album and play it"), .callback = cmd_addplay, }, #endif { .arg = "-volume", .help_arg = TRS(""), .help_string = TRS("Set player volume. is in dB, 0.0 is max"), .callback = cmd_volume, }, { .arg = "-volume-rel", .help_arg = TRS(""), .help_string = TRS("In- or decrease player volume. is in dB"), .callback = cmd_volume_rel, }, { .arg = "-seek-rel", .help_arg = TRS(""), .help_string = TRS("Seek relative. is in seconds."), .callback = cmd_seek_rel, }, { .arg = "-seek-perc", .help_arg = TRS(""), .help_string = TRS("Seek percentage based. is between 0 and 100."), .callback = cmd_seek_perc, }, { .arg = "-chapter", .help_arg = "[num|+|-]", .help_string = TRS("Go to the specified chapter. Use '+' and '-' to go to the next or previous chapter respectively"), .callback = cmd_chapter, }, { /* End of options */ } }; static void opt_fe(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_addr(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -addr requires an argument"); exit(-1); } remote_addr = gavl_strrep(remote_addr, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_port(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -port requires an argument"); exit(-1); } local_port = atoi((*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static void opt_label(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -label requires an argument"); exit(-1); } label = (*argv)[arg]; bg_cmdline_remove_arg(argc, argv, arg); } static bg_cmdline_arg_t global_options[] = { { .arg = "-scan", .help_string = TRS("Scan for devices"), .callback = cmd_scan, }, { .arg = "-addr", .help_arg = "", .help_string = TRS("Address to connect to. Default is "BG_BACKEND_URI_SCHEME_GMERLIN_RENDERER"://localhost:10101"), .callback = opt_addr, }, { .arg = "-port", .help_arg = "", .help_string = TRS("Local port"), .callback = opt_port, }, { .arg = "-label", .help_string = TRS("Label to use"), .callback = opt_label, }, { .arg = "-fe", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of frontends. Use -list-fe to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe, }, { .arg = "-list-fe", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_renderer, }, { /* End of options */ } }; #if 0 static void opt_help(void * data, int * argc, char *** argv, int arg) { FILE * out = stderr; fprintf(out, "Usage: %s [options] command\n\n", (*argv)[0]); fprintf(out, "Options:\n\n"); bg_cmdline_print_help(global_options); fprintf(out, "\ncommand is of the following:\n\n"); bg_cmdline_print_help(commands); exit(0); } #endif const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options] command\n"), .help_before = TRS("Remote control command for the Gmerlin GUI Player\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Global options"), global_options }, { TRS("Commands"), commands }, { } }, }; static bg_http_server_t * create_server() { bg_http_server_t * ret = bg_http_server_create(); if(local_port > 0) bg_http_server_set_default_port(ret, local_port); bg_http_server_set_static_path(ret, "/static"); bg_http_server_enable_appicons(ret); /* Start server */ bg_http_server_start(ret); return ret; } int main(int argc, char ** argv) { gavl_dictionary_t dev; gavl_time_t delay_time = GAVL_TIME_SCALE / 50; bg_frontend_t ** frontends = NULL; int num_frontends = 0; // bg_websocket_connection_t * remote; gavl_array_init(&fe_arr); bg_plugins_init(); gavl_dictionary_init(&dev); bg_app_init("gmerlin-remote", TRS("Gmerlin remote control"), "remote"); setlocale(LC_ALL, ""); setlocale(LC_NUMERIC, "C"); bg_handle_sigint(); bg_cmdline_init(&app_data); if(argc < 2) bg_cmdline_print_help(argv[0], 0); bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); if(!remote_addr) remote_addr = BG_BACKEND_URI_SCHEME_GMERLIN_RENDERER"://127.0.0.1:10101/ws/"GAVL_META_CLASS_BACKEND_RENDERER; srv = create_server(); gavl_dictionary_set_string(&dev, GAVL_META_URI, remote_addr); if(label) gavl_dictionary_set_string(&dev, GAVL_META_LABEL, label); if(!(backend = bg_backend_handle_create(&dev))) goto fail; backend_ctrl = bg_backend_handle_get_controllable(backend); bg_cmdline_parse(commands, &argc, &argv, NULL); frontends = bg_frontends_create(backend_ctrl, BG_PLUGIN_FRONTEND_RENDERER, &fe_arr, &num_frontends); if(num_frontends > 0) { gavl_timer_t * timer; int ret; timer = gavl_timer_create(); gavl_timer_start(timer); while(1) { if(bg_got_sigint()) break; ret = 0; // ret += bg_backend_handle_ping(backend); bg_msg_sink_iteration(backend_ctrl->evt_sink); ret += bg_msg_sink_get_num(backend_ctrl->evt_sink); ret += bg_backend_handle_ping(backend); ret += bg_frontends_ping(frontends, num_frontends); if(srv) ret += bg_http_server_iteration(srv); if(!ret) gavl_time_delay(&delay_time); } gavl_timer_destroy(timer); } fail: bg_frontends_destroy(frontends, num_frontends); if(srv) bg_http_server_destroy(srv); if(backend) bg_plugin_unref(backend); gavl_dictionary_free(&dev); return 0; } bplaum-gmerlin-ebbe714/apps/remote/gmerlin-remote.desktop000066400000000000000000000002651513225502300237000ustar00rootroot00000000000000[Desktop Entry] Name=Gmerlin remote Name[de]=Gmerlin remote Comment=Mediaplayer control proxy Exec=gmerlin-remote Icon=gmerlin-remote Type=Application Categories=AudioVideo;Player; bplaum-gmerlin-ebbe714/apps/renderer/000077500000000000000000000000001513225502300176675ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/renderer/Makefile.am000066400000000000000000000011411513225502300217200ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ @DBUS_CFLAGS@ \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = gmerlin-renderer gmerlin_renderer_SOURCES = \ renderer.c \ gmerlin-renderer.c Desktopdir = $(datadir)/applications Desktop_DATA = gmerlin-renderer.desktop gmerlin_renderer_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl @UUID_LIBS@ @XML2_LIBS@ @JSON_LIBS@ -lpthread noinst_HEADERS = renderer.h EXTRA_DIST = gmerlin-renderer.desktop bplaum-gmerlin-ebbe714/apps/renderer/gmerlin-renderer.c000066400000000000000000000112761513225502300233030ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include "renderer.h" #include #include #include #define LOG_DOMAIN "gmerlin-renderer" #include #include #include #include #include #include static char * save_config = NULL; static gavl_array_t fe_arr; static void opt_fe(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static bg_cmdline_arg_t global_options[] = { { .arg = "-sc", .help_arg = "", .help_string = TRS("Save config to file"), .argv = &save_config, }, BG_OPT_LOAD_CONFIG, { .arg = "-i", .help_arg = "", .help_string = TRS("Input options"), }, { .arg = "-aud", .help_arg = "", .help_string = TRS("Audio options"), }, { .arg = "-vid", .help_arg = "", .help_string = TRS("Video options"), }, BG_PLUGIN_OPT_OA, BG_PLUGIN_OPT_OV, BG_PLUGIN_OPT_FA, BG_PLUGIN_OPT_FV, { .arg = "-vis", .help_arg = "", .help_string = TRS("Audio visualization"), }, { .arg = "-osd", .help_arg = "", .help_string = TRS("OSD Options"), }, { .arg = "-fe", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of frontends. Use -list-fe to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe, }, { .arg = "-list-fe", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_renderer, }, { /* End */ } }; const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options]\n"), .help_before = TRS("Gmerlin Mediarenderer\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), global_options }, { } }, .files = (bg_cmdline_ext_doc_t[]) { { "~/.gmerlin/plugins.xml", TRS("Cache of the plugin registry (shared by all applications)") }, { "~/.gmerlin/generic/cfg.xml", TRS("Default plugin parameters are read from there. Use gmerlin_plugincfg to change them.") }, { /* End */ } }, }; int main(int argc, char ** argv) { int ret = EXIT_FAILURE; gavl_time_t delay_time = GAVL_TIME_SCALE / 50; // 20 ms renderer_t s; gavl_array_init(&fe_arr); bg_frontend_set_option(&fe_arr, "renderer_gmerlin,renderer_upnp,mpris"); bg_app_init("gmerlin-renderer", TRS("Gmerlin renderer"), "renderer"); bg_handle_sigint(); bg_iconfont_init(); signal(SIGPIPE, SIG_IGN); /* Create global config registry */ bg_cfg_registry = gavl_dictionary_create(); bg_plugins_init(); /* Pre-initialize the frontends */ bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); renderer_init(&s, &fe_arr); if(save_config) { gavl_dictionary_t tmp; gavl_dictionary_init(&tmp); gavl_dictionary_copy(&tmp, bg_cfg_registry); bg_cfg_section_delete_subsection_by_name(&tmp, "plugins"); bg_cfg_registry_save_to(&tmp, save_config); gavl_dictionary_free(&tmp); } while(1) { if(!renderer_iteration(&s)) { if(bg_got_sigint()) break; gavl_time_delay(&delay_time); } } /* TODO: Save state */ renderer_cleanup(&s); bg_global_cleanup(); return ret; } bplaum-gmerlin-ebbe714/apps/renderer/gmerlin-renderer.desktop000066400000000000000000000003111513225502300245160ustar00rootroot00000000000000[Desktop Entry] Name=Gmerlin renderer Name[de]=Gmerlin renderer Comment=Media rendering service Exec=gmerlin-renderer Icon=gmerlin-renderer Type=Application NoDisplay=YES Categories=AudioVideo;Player; bplaum-gmerlin-ebbe714/apps/renderer/renderer.c000066400000000000000000000147611513225502300216520ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include "renderer.h" #include #include #include #include #include #include #define LOG_DOMAIN "renderer" #define VAR_PREFIX "renderer" const bg_parameter_info_t * renderer_get_parameters(renderer_t * s); static const bg_parameter_info_t parameters[] = { { .name = "loglevel", .type = BG_PARAMETER_INT, .long_name = TRS("Log level"), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(4), .val_default = GAVL_VALUE_INIT_INT(3), }, { .name = "syslog", .long_name = TRS("Syslog name"), .type = BG_PARAMETER_STRING, }, { .name = "label", .long_name = TRS("Label"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("Gmerlin renderer"), }, { .name = "vardir", .type = BG_PARAMETER_DIRECTORY, .long_name = TRS("Storage directory"), }, { .name = "state_file", .type = BG_PARAMETER_FILE, .long_name = TRS("State file"), }, { /* End */ }, }; void renderer_init(renderer_t * s, gavl_array_t * fe_arr) { gavl_dictionary_t * section_reg; gavl_dictionary_t * section_default; const gavl_value_t * uuid_val; const char * uuid = NULL; bg_controllable_t * player_ctrl; gavl_value_t icons_val; gavl_value_init(&icons_val); memset(s, 0, sizeof(*s)); s->srv = bg_http_server_create(); section_reg = bg_cfg_registry_find_section(bg_cfg_registry, "renderer"); section_default = bg_cfg_section_create("renderer"); bg_cfg_section_create_items(section_default, renderer_get_parameters(s)); gavl_dictionary_update_fields(section_default, section_reg); bg_cfg_section_apply(section_default, renderer_get_parameters(s), renderer_set_parameter, s); gavl_dictionary_destroy(section_default); /* Create vardir */ if(!s->vardir) s->vardir = bg_search_var_dir(VAR_PREFIX); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Using data directory: %s", s->vardir); /* Load state */ if(!s->state_file) s->state_file = gavl_sprintf("%s/state.xml", s->vardir); if(!bg_dictionary_load_xml(&s->state, s->state_file, "state") || !(uuid_val = bg_state_get(&s->state, "server", "uuid")) || !(uuid = gavl_value_get_string(uuid_val))) { uuid_t u; char uuid_str[37]; gavl_value_t v; uuid_generate(u); uuid_unparse(u, uuid_str); gavl_value_init(&v); gavl_value_set_string(&v, uuid_str); bg_state_set(&s->state, 1, "server", "uuid", &v, NULL, 0); uuid_val = bg_state_get(&s->state, "server", "uuid"); uuid = gavl_value_get_string(uuid_val); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Generated uuid: %s", uuid); } else gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Using saved uuid: %s", uuid); s->player = bg_player_create(); s->player_cfg = bg_player_get_cfg(s->player); player_ctrl = bg_player_get_controllable(s->player); /* Apply config */ section_reg = bg_cfg_registry_find_section(bg_cfg_registry, "player"); bg_cfg_ctx_array_create_sections(s->player_cfg, section_reg); bg_player_apply_cmdline(s->player_cfg); bg_cfg_ctx_set_sink_array(s->player_cfg, player_ctrl->cmd_sink); bg_cfg_ctx_apply_array(s->player_cfg); /* Start http part */ bg_http_server_set_static_path(s->srv, "/static"); bg_http_server_start(s->srv); /* Create frontends */ s->frontends = bg_frontends_create(player_ctrl, BG_PLUGIN_FRONTEND_RENDERER, fe_arr, &s->num_frontends); bg_player_state_init(&s->state); bg_player_run(s->player); bg_state_apply(&s->state, player_ctrl->cmd_sink, BG_CMD_SET_STATE); gavl_value_init(&icons_val); } void renderer_cleanup(renderer_t * s) { if(s->player) bg_player_quit(s->player); if(s->state_file) { bg_dictionary_save_xml(&s->state, s->state_file, "state"); free(s->state_file); } gavl_dictionary_free(&s->state); bg_frontends_destroy(s->frontends, s->num_frontends); if(s->parameters) bg_parameter_info_destroy_array(s->parameters); if(s->srv) bg_http_server_destroy(s->srv); if(s->player) bg_player_destroy(s->player); } int renderer_iteration(renderer_t * s) { int ret = 0; ret += bg_http_server_iteration(s->srv); ret += bg_frontends_ping(s->frontends, s->num_frontends); return ret; } const bg_parameter_info_t * renderer_get_parameters(renderer_t * s) { if(!s->parameters) { const bg_parameter_info_t * arr[3]; arr[0] = bg_http_server_get_parameters(s->srv); arr[1] = parameters; arr[2] = NULL; s->parameters = bg_parameter_info_concat_arrays(arr); } return s->parameters; } void renderer_set_parameter(void * priv, const char * name, const gavl_value_t * val) { renderer_t * s = priv; if(!name) { bg_http_server_set_parameter(s->srv, NULL, NULL); return; } else if(!strcmp(name, "vardir")) s->vardir = gavl_strrep(s->vardir, val->v.str); else if(!strcmp(name, "state_file")) s->state_file = gavl_strrep(s->state_file, val->v.str); else if(!strcmp(name, "label")) gavl_dictionary_set_string(&bg_app_vars, BG_APP_LABEL, val->v.str); else if(!strcmp(name, "syslog")) { if(val->v.str) bg_log_syslog_init(val->v.str); } else if(!strcmp(name, "loglevel")) gavl_set_log_verbose(val->v.i); else bg_http_server_set_parameter(s->srv, name, val); } bplaum-gmerlin-ebbe714/apps/renderer/renderer.h000066400000000000000000000034211513225502300216460ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include #include #ifdef HAVE_DBUS #include #endif typedef struct { bg_player_t * player; bg_cfg_ctx_t * player_cfg; // char * label; // Visible in the network bg_http_server_t * srv; bg_frontend_t ** frontends; int num_frontends; bg_parameter_info_t * parameters; char * vardir; gavl_dictionary_t state; char * state_file; } renderer_t; void renderer_init(renderer_t * s, gavl_array_t * fe_arr); void renderer_cleanup(renderer_t * s); int renderer_iteration(renderer_t * s); void renderer_set_parameter(void * priv, const char * name, const gavl_value_t * val); bplaum-gmerlin-ebbe714/apps/server/000077500000000000000000000000001513225502300173675ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/server/Makefile.am000066400000000000000000000007201513225502300214220ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = gmerlin-server gmerlin_server_SOURCES = \ server.c \ gmerlin-server.c gmerlin_server_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl @UUID_LIBS@ @XML2_LIBS@ @JSON_LIBS@ -lpthread noinst_HEADERS = server.h bplaum-gmerlin-ebbe714/apps/server/gmerlin-server.c000066400000000000000000000073721513225502300225050ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include "server.h" #include #define LOG_DOMAIN "gmerlin-server" #include #include #include #include #include #include #include gavl_array_t fe_arr; static void opt_fe(void * data, int * argc, char *** argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -fe requires an argument"); exit(-1); } bg_frontend_set_option(&fe_arr, (*argv)[arg]); bg_cmdline_remove_arg(argc, argv, arg); } static bg_cmdline_arg_t global_options[] = { BG_OPT_LOAD_CONFIG, BG_OPT_SAVE_CONFIG, { .arg = "-fe", .help_arg = "frontend1[,frontend2]", .help_string = TRS("Comma separated list of frontends. Use -list-fe to list available frontends. The prefix fe_ can be omitted"), .callback = opt_fe, }, { .arg = "-list-fe", .help_string = TRS("List available frontends"), .callback = bg_plugin_registry_list_fe_mdb, }, { /* End */ } }; const bg_cmdline_app_data_t app_data = { .package = PACKAGE, .version = VERSION, .synopsis = TRS("[options]\n"), .help_before = TRS("Gmerlin Mediaserver\n"), .args = (bg_cmdline_arg_array_t[]) { { TRS("Options"), global_options }, { } }, .files = (bg_cmdline_ext_doc_t[]) { { "~/.gmerlin/plugins.xml", TRS("Cache of the plugin registry (shared by all applications)") }, { "~/.gmerlin/generic/cfg.xml", TRS("Default plugin parameters are read from there. Use gmerlin_plugincfg to change them.") }, { /* End */ } }, }; int main(int argc, char ** argv) { int result; int ret = EXIT_FAILURE; gavl_time_t delay_time = GAVL_TIME_SCALE / 50; // 20 ms server_t s; gavl_array_init(&fe_arr); bg_frontend_set_option(&fe_arr, "mdb_gmerlin,mdb_upnp"); bg_app_init("gmerlin-server", TRS("Gmerlin media server"), "server"); /* Make strcasecmp work */ setlocale(LC_COLLATE, ""); bg_handle_sigint(); signal(SIGPIPE, SIG_IGN); bg_cfg_registry = gavl_dictionary_create(); // Ensure that the server section comes first in the configfile bg_cfg_registry_find_section(bg_cfg_registry, "server"); bg_plugins_init(); bg_cmdline_init(&app_data); bg_cmdline_parse(global_options, &argc, &argv, NULL); result = server_init(&s, &fe_arr); bg_cfg_registry_save_config(); if(!result) goto fail; while(1) { if(!server_iteration(&s)) { if(bg_got_sigint()) break; gavl_time_delay(&delay_time); } } ret = EXIT_SUCCESS; fail: /* TODO: Save state */ server_cleanup(&s); bg_global_cleanup(); return ret; } bplaum-gmerlin-ebbe714/apps/server/server.c000066400000000000000000000253641513225502300210530ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include "server.h" #include #include #include #include #include #include #include #include #include #define LOG_DOMAIN "server" #define VAR_PREFIX "server" const char * storage_vars[] = { "cfg", NULL, }; static const bg_parameter_info_t parameters[] = { { .name = "loglevel", .type = BG_PARAMETER_INT, .long_name = TRS("Log level"), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(4), .val_default = GAVL_VALUE_INIT_INT(3), }, { .name = "syslog", .long_name = TRS("Syslog name"), .type = BG_PARAMETER_STRING, }, { .name = "label", .long_name = TRS("Label"), .type = BG_PARAMETER_STRING, .val_default = GAVL_VALUE_INIT_STRING("Gmerlin server"), }, { .name = "db", .long_name = TRS("Database path"), .type = BG_PARAMETER_DIRECTORY, .val_default = GAVL_VALUE_INIT_STRING("."), }, { .name = "vardir", .type = BG_PARAMETER_DIRECTORY, .long_name = TRS("Storage directory"), }, { .name = "state_file", .type = BG_PARAMETER_FILE, .long_name = TRS("State file"), }, { .name = "max_client_ids", .type = BG_PARAMETER_INT, .flags = BG_PARAMETER_HIDE_DIALOG, .long_name = TRS("Maximum number of clients which can store data"), .val_default = GAVL_VALUE_INIT_INT(16), .val_min = GAVL_VALUE_INIT_INT(0), .val_max = GAVL_VALUE_INIT_INT(65535), }, { /* End */ }, }; void server_set_parameter(void * priv, const char * name, const gavl_value_t * val) { server_t * s = priv; if(!name) { bg_http_server_set_parameter(s->srv, NULL, NULL); return; } if(!strcmp(name, "db")) s->dbpath = gavl_strrep(s->dbpath, val->v.str); else if(!strcmp(name, "vardir")) s->vardir = gavl_strrep(s->vardir, val->v.str); else if(!strcmp(name, "state_file")) s->state_file = gavl_strrep(s->state_file, val->v.str); else if(!strcmp(name, "label")) { s->label = gavl_strrep(s->label, val->v.str); if(s->mdb) bg_mdb_set_root_name(s->mdb, s->label); // fprintf(stderr, "Server label: %s\n", s->label); } else if(!strcmp(name, "max_client_ids")) s->max_client_ids = val->v.i; else if(!strcmp(name, "syslog")) { if(val->v.str) bg_log_syslog_init(val->v.str); } else if(!strcmp(name, "loglevel")) gavl_set_log_verbose(val->v.i); else bg_http_server_set_parameter(s->srv, name, val); } static const bg_parameter_info_t * server_get_parameters(server_t * s) { if(!s->parameters) { const bg_parameter_info_t * arr[4]; arr[0] = bg_http_server_get_parameters(s->srv); arr[1] = bg_media_dirs_get_parameters(); arr[2] = parameters; arr[3] = NULL; s->parameters = bg_parameter_info_concat_arrays(arr); } return s->parameters; } /* Initialize an array of known mimetypes as state variable */ static const char * manifest_file = "{\n" "\"short_name\": \"%s\",\n" "\"name\": \"%s\",\n" "\"display\": \"standalone\",\n" "\"icons\": [ \n" "{\n" "\"src\": \"static/icons/server_16.png\",\n" "\"sizes\": \"16x16\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "},\n" "{\n" "\"src\": \"static/icons/server_48.png\",\n" "\"sizes\": \"48x48\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "},\n" "{\n" "\"src\": \"static/icons/server_96.png\",\n" "\"sizes\": \"96x96\",\n" "\"type\": \"image/png\",\n" "\"density\": 1.0\n" "} ],\n" "\"start_url\": \"%s\"\n" "}\n"; static int server_handle_manifest(bg_http_connection_t * conn, void * data) { const char * var; int result = 0; server_t * s = data; if(!strcmp(conn->path, "/manifest.json")) { char * start_url = NULL; if((var = gavl_dictionary_get_string(&conn->req, "Referer"))) { gavl_dictionary_t url_vars; char * protocol = NULL; char * host = NULL; int port = 0; const char * cid; char * m = NULL; int len = 0; bg_http_connection_check_keepalive(conn); gavl_dictionary_init(&url_vars); // fprintf(stderr, "Referer: %s\n", var); gavl_url_split(var, &protocol, NULL, NULL, &host, &port, NULL); gavl_url_get_vars_c(var, &url_vars); if((cid = gavl_dictionary_get_string(&url_vars, BG_URL_VAR_CLIENT_ID))) { start_url = gavl_sprintf("%s://%s:%d/?%s=%s", protocol, host, port, BG_URL_VAR_CLIENT_ID, cid); m = gavl_sprintf(manifest_file, s->label, s->label, start_url); len = strlen(m); bg_http_connection_init_res(conn, conn->protocol, 200, "OK"); gavl_dictionary_set_string(&conn->res, "Content-Type", "application/manifest+json"); gavl_dictionary_set_long(&conn->res, "Content-Length", len); if(!bg_http_connection_write_res(conn)) { bg_http_connection_clear_keepalive(conn); goto cleanup; } result = 1; } if(!result) { bg_http_connection_init_res(conn, conn->protocol, 400, "Bad Request"); if(!bg_http_connection_write_res(conn)) { bg_http_connection_clear_keepalive(conn); goto cleanup; } } if(result && !gavl_socket_write_data(conn->fd, (const uint8_t*)m, len)) bg_http_connection_clear_keepalive(conn); cleanup: if(protocol) free(protocol); if(host) free(host); gavl_dictionary_free(&url_vars); // fprintf(stderr, "Got manifest:\n%s\n", m); if(m) free(m); } return result; } return 0; } int server_init(server_t * s, gavl_array_t * fe_arr) { char * tmp_string; bg_controllable_t * mdb_ctrl; gavl_dictionary_t * section_reg; gavl_dictionary_t * section_default; const gavl_value_t * uuid_val; const char * uuid = NULL; memset(s, 0, sizeof(*s)); s->srv = bg_http_server_create(); bg_http_server_get_media_dirs(s->srv); /* Set parameters */ section_reg = bg_cfg_registry_find_section(bg_cfg_registry, "server"); section_default = bg_cfg_section_create("server"); bg_cfg_section_create_items(section_default, server_get_parameters(s)); gavl_dictionary_update_fields(section_default, section_reg); bg_cfg_section_apply(section_default, server_get_parameters(s), server_set_parameter, s); gavl_dictionary_destroy(section_default); /* Create vardir */ if(!s->vardir) s->vardir = bg_search_var_dir(VAR_PREFIX); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Using data directory: %s", s->vardir); /* Load state */ if(!s->state_file) s->state_file = gavl_sprintf("%s/state.xml", s->vardir); if(!bg_dictionary_load_xml(&s->state, s->state_file, "state") || !(uuid_val = bg_state_get(&s->state, "server", "uuid")) || !(uuid = gavl_value_get_string(uuid_val))) { uuid_t u; char uuid_str[37]; gavl_value_t v; uuid_generate(u); uuid_unparse(u, uuid_str); gavl_value_init(&v); gavl_value_set_string(&v, uuid_str); bg_state_set(&s->state, 1, "server", "uuid", &v, NULL, 0); uuid_val = bg_state_get(&s->state, "server", "uuid"); uuid = gavl_value_get_string(uuid_val); gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Generated uuid: %s", uuid); } else gavl_log(GAVL_LOG_INFO, LOG_DOMAIN, "Using saved uuid: %s", uuid); if(!(s->mdb = bg_mdb_create(s->dbpath, 0, NULL))) return 0; bg_http_server_set_mdb(s->srv, s->mdb); mdb_ctrl = bg_mdb_get_controllable(s->mdb); /* Add handlers */ bg_http_server_set_generate_client_ids(s->srv); bg_http_server_set_root_file(s->srv, "/static/app.html"); bg_http_server_add_handler(s->srv, server_handle_manifest, BG_HTTP_PROTO_HTTP, NULL, s); bg_http_server_set_static_path(s->srv, "/static"); /* Set root metadata */ if(!s->label) s->label = gavl_strdup("Gmerlin Server"); bg_mdb_set_root_name(s->mdb, s->label); /* Create server side storage */ tmp_string = gavl_sprintf("%s/storage", s->vardir); s->storage = bg_server_storage_create(tmp_string, s->max_client_ids, storage_vars); free(tmp_string); bg_http_server_add_handler(s->srv, bg_server_storage_handle_http, BG_HTTP_PROTO_HTTP, "/storage/", s->storage); /* Start http part */ bg_http_server_start(s->srv); bg_mdb_set_root_icons(s->mdb); /* Create frontends */ s->frontends = bg_frontends_create(mdb_ctrl, BG_PLUGIN_FRONTEND_MDB, fe_arr, &s->num_frontends); return 1; } void server_cleanup(server_t * s) { if(s->mdb) bg_mdb_stop(s->mdb); if(s->mdb) bg_mdb_destroy(s->mdb); if(s->srv) bg_http_server_destroy(s->srv); // if(s->remotedev_sink) // bg_msg_sink_destroy(s->remotedev_sink); if(s->dbpath) free(s->dbpath); if(s->label) free(s->label); if(s->parameters) bg_parameter_info_destroy_array(s->parameters); if(s->vardir) free(s->vardir); if(s->storage) bg_server_storage_destroy(s->storage); if(s->state_file) { bg_dictionary_save_xml(&s->state, s->state_file, "state"); free(s->state_file); } gavl_dictionary_free(&s->state); } int server_iteration(server_t * s) { int ret = 0; ret += bg_http_server_iteration(s->srv); ret += bg_frontends_ping(s->frontends, s->num_frontends); return ret; } bplaum-gmerlin-ebbe714/apps/server/server.h000066400000000000000000000033721513225502300210530ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include #include #include #include #include #include typedef struct { char * label; // Visible in the network char * dbpath; // Database path (parent dir of gmerlin-mdb) bg_http_server_t * srv; bg_mdb_t * mdb; bg_frontend_t ** frontends; int num_frontends; bg_parameter_info_t * parameters; char * vardir; bg_server_storage_t * storage; int max_client_ids; gavl_dictionary_t state; char * state_file; } server_t; int server_init(server_t * s, gavl_array_t * fe_arr); void server_cleanup(server_t * s); int server_iteration(server_t * s); void server_set_parameter(void * priv, const char * name, const gavl_value_t * val); bplaum-gmerlin-ebbe714/apps/server/server_upnp.c000066400000000000000000000016651513225502300221130ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ bplaum-gmerlin-ebbe714/apps/thumbnailer/000077500000000000000000000000001513225502300203735ustar00rootroot00000000000000bplaum-gmerlin-ebbe714/apps/thumbnailer/Makefile.am000066400000000000000000000005461513225502300224340ustar00rootroot00000000000000plugindir=$(pkglibdir)/plugins AM_CFLAGS = \ -DLOCALE_DIR=\"$(localedir)\" \ -DPLUGIN_DIR=\"$(plugindir)\" \ -DDOC_DIR=\"$(docdir)\" \ -DDATA_DIR=\"$(pkgdatadir)\" AM_LDFLAGS = @GMERLIN_EXE_LDFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = gmerlin-video-thumbnailer gmerlin_video_thumbnailer_LDADD = $(top_builddir)/lib/libgmerlin.la -ldl bplaum-gmerlin-ebbe714/apps/thumbnailer/gmerlin-video-thumbnailer.c000066400000000000000000000260021513225502300256100ustar00rootroot00000000000000/***************************************************************** * gmerlin - a general purpose multimedia framework and applications * * Copyright (c) 2001 - 2024 Members of the Gmerlin project * http://github.com/bplaum * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU 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, see . * *****************************************************************/ #include #include /* stat() */ #include /* stat() */ #include /* stat() */ #include #include #include #include #include #include #include #include #define LOG_DOMAIN "thumbnailer" static int thumb_size = 128; static gavl_time_t seek_time = GAVL_TIME_UNDEFINED; static float seek_percentage = 10.0; static void opt_size(void * data, int * argc, char *** _argv, int arg) { if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -s requires an argument"); exit(-1); } thumb_size = atoi((*_argv)[arg]); bg_cmdline_remove_arg(argc, _argv, arg); } static void opt_time(void * data, int * argc, char *** _argv, int arg) { char * str; if(arg >= *argc) { gavl_log(GAVL_LOG_ERROR, LOG_DOMAIN, "Option -t requires an argument"); exit(-1); } str = (*_argv)[arg]; if(str[strlen(str)-1] == '%') seek_percentage = strtod(str, NULL); else seek_time = gavl_seconds_to_time(strtod(str, NULL)); bg_cmdline_remove_arg(argc, _argv, arg); } static bg_cmdline_arg_t global_options[] = { { .arg = "-s", .help_arg = "", .help_string = "Maximum width or height", .callback = opt_size, }, { .arg = "-t", .help_arg = "