diff --git a/veejay-current/reloaded-gtk3/.gitignore b/veejay-current/reloaded-gtk3/.gitignore new file mode 100644 index 00000000..425c309d --- /dev/null +++ b/veejay-current/reloaded-gtk3/.gitignore @@ -0,0 +1,44 @@ +/INSTALL +/Makefile +/Makefile.in +/aclocal.m4 +/autom4te.cache/ +/compile +/config.guess +/config.h +/config.h.in +/config.log +/config.status +/config.sub +/configure +/depcomp +/gveejay-paths.h +/gveejay-paths.sh +/install-sh +/libtool +/ltmain.sh +/m4/ +/missing +/src/.deps/ +/src/Makefile +/src/Makefile.in +/src/cellrendererspin.o +/src/curve.o +/src/gtkcolorsel.o +/src/gtkknob.o +/src/gtktimeselection.o +/src/gveejay.o +/src/keyboard.o +/src/mjpeg_logging.o +/src/mpegconsts.o +/src/mpegtimecode.o +/src/multitrack.o +/src/reloaded +/src/sequence.o +/src/tracksources.o +/src/utils.o +/src/vj-api.o +/src/vj-midi.o +/src/yuv4mpeg.o +/src/yuv4mpeg_ratio.o +/stamp-h1 diff --git a/veejay-current/reloaded-gtk3/AUTHORS b/veejay-current/reloaded-gtk3/AUTHORS new file mode 100644 index 00000000..6b9db106 --- /dev/null +++ b/veejay-current/reloaded-gtk3/AUTHORS @@ -0,0 +1,28 @@ +Tim Philipp Mόller + (CellRendererSpin 15 minute hack - good enough) + +Matthijs v. Henten + Glade-2 interface design + Icon/picture design + +Thomas Reinhold + Samplebank + +Dursun Koca + Veejay Logo (V) design + +Niels Elburg + Lead programming + +Jerome Blanchi + user interface improvemnts, port to GTK 3 + +Contributions by: + Toni < oc2pus@arcor.de > + (making gveejay happen on GTK 2.4, veejay.spec file) + +Icons: + + share/multicast.ico + + icons8.com as Creative Commons Attribution-NoDerivs 3.0 Unported diff --git a/veejay-current/reloaded-gtk3/COPYING b/veejay-current/reloaded-gtk3/COPYING new file mode 100644 index 00000000..d60c31a9 --- /dev/null +++ b/veejay-current/reloaded-gtk3/COPYING @@ -0,0 +1,340 @@ + 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. diff --git a/veejay-current/reloaded-gtk3/ChangeLog b/veejay-current/reloaded-gtk3/ChangeLog new file mode 100644 index 00000000..e69de29b diff --git a/veejay-current/reloaded-gtk3/Makefile.am b/veejay-current/reloaded-gtk3/Makefile.am new file mode 100644 index 00000000..32a5c6c3 --- /dev/null +++ b/veejay-current/reloaded-gtk3/Makefile.am @@ -0,0 +1,178 @@ +# Process with automake to produce Makefile.in +SUBDIRS = src + +ACLOCAL_AMFLAGS = -I m4 + +EXTRA_DIST = \ + autogen.sh\ + depcomp \ + cpuinfo.sh \ + autogen.sh \ + debian/copyright \ + debian/changelog \ + debian/control \ + debian/rules \ + share/bg.png \ + share/bg_black.png \ + share/bg_blue.png \ + share/bg_green.png \ + share/bg_grey.png \ + share/bg_red.png \ + share/bg_yellow.png \ + share/blackwhite.rc \ + share/button_back.png \ + share/button_bounce.png \ + share/button_dec.png \ + share/button_down.png \ + share/button_fbw.png \ + share/button_ffw.png \ + share/button_gotoend.png \ + share/button_gotostart.png \ + share/button_inc.png \ + share/button_loop.png \ + share/button_looponce.png \ + share/button_mini_decrement.png \ + share/button_mini_increment.png \ + share/button_next.png \ + share/button_pause.png \ + share/button_play.png \ + share/button_playmode.png \ + share/button_prev.png \ + share/button_rand.png \ + share/button_reverse.png \ + share/button_right.png \ + share/button_skip.png \ + share/button_skull.png \ + share/button_text.png \ + share/button_up.png \ + share/fx_entry_off.png \ + share/fx_entry_on.png \ + share/gveejay-default.rc \ + share/gveejay.glade \ + share/gveejay.rc \ + share/gveejay.reloaded.glade \ + share/gveejay.reloaded.css \ + share/high_contrast.rc \ + share/icon_apply.png \ + share/icon_berserk.png \ + share/icon_bezerk.png \ + share/icon_bounce.png \ + share/icon_bug.png \ + share/icon_bundle.png \ + share/icon_cache.png \ + share/icon_clear.png \ + share/icon_clearall.png \ + share/icon_color.png \ + share/icon_connect.png \ + share/icon_copy.png \ + share/icon_crop.png \ + share/icon_cut.png \ + share/icon_disconnect.png \ + share/icon_fadein.png \ + share/icon_fadeout.png \ + share/icon_jack.png \ + share/icon_keybind.png \ + share/icon_keydetach.png \ + share/icon_keyframe.png \ + share/icon_launch.png \ + share/icon_loop.png \ + share/icon_looponce.png \ + share/icon_macroclear.png \ + share/icon_macropause.png \ + share/icon_macroplay.png \ + share/icon_macrorec.png \ + share/icon_mask.png \ + share/icon_minus.png \ + share/icon_new.png \ + share/icon_noloop.png \ + share/icon_open.png \ + share/icon_openlist.png \ + share/icon_openstream.png \ + share/icon_osd.png \ + share/icon_paste.png \ + share/icon_plarge.png \ + share/icon_playmode.png \ + share/icon_plus.png \ + share/icon_psmall.png \ + share/icon_question.png \ + share/icon_record.png \ + share/icon_recordstop.png \ + share/icon_recstop.png \ + share/icon_refresh.png \ + share/icon_render.png \ + share/icon_save.png \ + share/icon_saveas.png \ + share/icon_screenshot.png \ + share/icon_send.png \ + share/icon_skull.png \ + share/icon_stream.png \ + share/icon_trash.png \ + share/icon_video.png \ + share/knob.png \ + share/reloaded_classic.glade \ + share/smooth.rc \ + share/sync.png \ + share/veejay-icon.png \ + share/veejay-logo-small.png \ + share/veejay-logo.png \ + gveejay-paths.sh.in + +DISTCLEANFILES = \ + confdefs.h \ + config.cache \ + config.status \ + config.log \ + gveejay-paths.h + + +MAINTAINERCLEANFILES = \ + compile \ + depcomp \ + install-sh \ + missing \ + mkinstalldirs \ + Makefile.in \ + aclocal.m4 \ + config.guess \ + config.h.in \ + config.sub \ + configure \ + ltmain.sh \ + stamp-h.in + +## .glade files must be in same directory as pixmaps ?!! +install-data-local: + @$(NORMAL_INSTALL) + if test -d $(srcdir)/share; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir); \ + for dialog in $(srcdir)/share/*; do \ + if test -f $$dialog; then \ + $(INSTALL_DATA) $$dialog $(DESTDIR)$(pkgdatadir); \ + fi \ + done \ + fi; + + + +gveejay-path.h: gveejay-paths.sh + @sh $< > $@.tmp ; + if cmp -s $@.tmp $@; then + rm $@.tmp; + else + mv $@.tmp $@ ; echo updated gveejay-paths.h; + fi + +dist-hook: + rm -f $(distdir)/gveejay-paths.sh + +## make rpms +rpm: Makefile + $(MAKE) dist + rpmbuild -ta --clean $(PACKAGE)-$(VERSION).tar.gz + +## make debs +deb: Makefile dist + -chmod -R +w $(PACKAGE)-$(VERSION) + rm -rf $(PACKAGE)-$(VERSION) + tar xzf $(PACKAGE)-$(VERSION).tar.gz + cd $(PACKAGE)-$(VERSION); dpkg-buildpackage -rfakeroot diff --git a/veejay-current/reloaded-gtk3/NEWS b/veejay-current/reloaded-gtk3/NEWS new file mode 100644 index 00000000..e69de29b diff --git a/veejay-current/reloaded-gtk3/PKGBUILD b/veejay-current/reloaded-gtk3/PKGBUILD new file mode 100644 index 00000000..07b38372 --- /dev/null +++ b/veejay-current/reloaded-gtk3/PKGBUILD @@ -0,0 +1,31 @@ +# Contributor: Luciano A. Ferrer +# Modified for ArchLinux by Niels +pkgname=reloaded +pkgrel=1 +pkgver=1.5.9 +pkgdesc="Reloaded is the graphical user interface for Veejay" +arch=('i686' 'x86_64') +url="http://www.veejayhq.net" +license=('GPL') +groups=() +conflicts=('reloaded') +depends=('libxml2' 'veejay' 'gtk2' 'glib2' 'glade' 'alsa-lib' ) +optdepends=() +source=() +md5sums=() +changelog=('ChangeLog') +backup=() +replaces=() + +build() { + export PKG_CONFIG_PATH=/usr/lib/pkgconfig + cd $startdir + ./autogen.sh + ./configure --prefix=/usr + make || return 1 +} + +package() { + cd $startdir + make DESTDIR="$pkgdir/" install +} diff --git a/veejay-current/reloaded-gtk3/README b/veejay-current/reloaded-gtk3/README new file mode 100644 index 00000000..ab911c29 --- /dev/null +++ b/veejay-current/reloaded-gtk3/README @@ -0,0 +1,113 @@ + + ~== + ~==== + :... ~~==== + :...... ~~~~==== + :.....: ~~~~==== + :...... -~~~~=== + :....... --~~~~~== + :....... ::~~~~~~= + :...... "::~~~~== + :....., :::~~~=== + :..... =::~~~~=== + :...... :::~~~==== + ....... ::~~~~~=== + ....... :::~~~~~~== + ...... ~::~~~~~~== + ...... |::~~~=| + ..... :::|:~==| + ..::: |:=|||==+ + ., :., :|||?||+= + ..::,,.: :||=~=.|| + ,...::,,, |~:=|||||+| + :..,:::||||~~~====++ + ,:,,,:::~~~~~===++++ Reloaded + ,::::~~~====++++ + ~~~~~===+++++ version 1.5.50 + ~~===+++++++: + N=++++++++++ June 2015 + +++++++++ + ++++:::: + ::::: + || + + + :: Reloaded, a graphical interface for Veejay :: + + + FEATURE OVERVIEW + + +General: + + # Thin client (TCP/IP) + # MIDI support (auto learning) + # Slick interface designed for live performing + # Tracks multiple veejay servers + +Install +======= + +See file 'INSTALL' + +See doc/Howto_Compile.html +See doc/Howto_Compile_on_Ubuntu.html + +Documentation +============= + +See source code. + +Running +======= + +$ reloaded + + +To use a midi controller with veejay you must connect +the veejay's sequencer port to the MIDI controller port. +There is a utility 'aconnect' (comes with ALSA) that does this. + +1. List inputs (midi keyboards) + $ aconnect -i + + client 129: 'Virtual Keyboard' [type=user] + + +2. List outputs (Veejay) + $ aconnect -o + + client 128: 'Veejay' [type=user] + + +3. Connect the ports + + $ aconnect 129 128 + + +4. Launch reloaded + + + +Know bugs +========= +- Multitracker crashes when using very high resolution video + + + + +About +===== + +GveejayReloaded is a client for veejay. As long as veejay (the server) +is running, you can connect and disconnect from it with reloaded. + + + + + + + + + + diff --git a/veejay-current/reloaded-gtk3/autogen.sh b/veejay-current/reloaded-gtk3/autogen.sh new file mode 100755 index 00000000..ee01832f --- /dev/null +++ b/veejay-current/reloaded-gtk3/autogen.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +# if you use autoconf 2.64 or earlier, +# you may have to create the m4 directory yourself +# + +if [ ! -d m4 ]; then + mkdir m4 +fi + +autoreconf -v -fi -I m4 diff --git a/veejay-current/reloaded-gtk3/configure.ac b/veejay-current/reloaded-gtk3/configure.ac new file mode 100644 index 00000000..52c96682 --- /dev/null +++ b/veejay-current/reloaded-gtk3/configure.ac @@ -0,0 +1,761 @@ +dnl Process this file with autoconf to produce a configure script. +dnl AC_INIT +AC_INIT([reloaded],[1.5.61],[nwelburg@gmail.com]) +AC_PREREQ(2.57) +AC_CONFIG_SRCDIR([src/gveejay.c]) + +RELOADED_MAJOR_VERSION=1 +RELOADED_MINOR_VERSION=5 +RELOADED_MICRO_VERSION=61 +RELOADED_VERSION=$VEEJAY_MAJOR_VERSION.$VEEJAY_MINOR_VERSION.$VEEJAY_MICRO_VERSION +RELOADED_CODENAME="Reloaded - build $RELOADED_MAJOR_VERSION $RELOADED_MINOR_VERSION $RELOADED_MICRO_VERSION" +AC_CONFIG_HEADERS([config.h]) + +AC_CANONICAL_HOST +AC_CANONICAL_TARGET +AC_CONFIG_MACRO_DIR([m4]) +AM_INIT_AUTOMAKE([1.7]) +AM_MAINTAINER_MODE + +AC_DEFINE(HAVE_CONFIG_H,1,[Include config.h]) +# libtool versioning +LT_RELEASE=$RELOADED_MAJOR_VERSION.$RELOADED_MINOR_VERSION.$RELOADED_MICRO_VERSION +LT_CURRENT=$RELOADED_MICRO_VERSION +LT_REVISION=$RELOADED_MICRO_VERSION +LT_AGE=$RELOADED_MICRO_VERSION +AC_SUBST(LT_RELEASE) +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + +AC_CONFIG_MACRO_DIR([m4]) + +dnl kill CFLAGS +CFLAGS="" +AC_ARG_ENABLE([strict], + AC_HELP_STRING([--enable-strict], + [Compile in paranoia assertion checking])) +AC_ARG_ENABLE([debug], + AC_HELP_STRING([--enable-debug], + [Compile in debugging information])) +AC_ARG_ENABLE([profiling], + [AS_HELP_STRING([--enable-profiling=gprof|gcov], + [Compile in profiling information, when no value given, gprof is selected. default: no])], + [case "${enableval}" in + yes | gprof) profiling=gprof ;; + gcov ) profiling=gcov ;; + no) profiling=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-profiling]) ;; + esac], + [profiling=false]) +AC_ARG_ENABLE([compile-warnings], + AC_HELP_STRING([--enable-compile-warnings], + [Turn on compiler warnings.])) +AC_ARG_ENABLE([warnings_as_errors], + AC_HELP_STRING([--enable-warnings_as_errors], + [Compiler warnings are errors.])) +AC_ARG_ENABLE([simd-accel], + AC_HELP_STRING([--enable-simd-accel], + [use SIMD multimedia instructions such as MMX, AltiVec, etc.if possible])) +AC_ARG_WITH([extra-cflags], + AC_HELP_STRING([--with-extra-cflags=flags], + [Options to be added to CFLAGS (optional)])) + +arch_target="auto" +AC_ARG_WITH([arch-target], AS_HELP_STRING( [--with-arch-target=generic or auto], + [Build a generic binary or auto-detect current cpu type (defaults to auto-detect)]), + [ arch_target="$withval"]) + +AC_GNU_SOURCE + +dnl Initialize libtool +AC_PROG_LIBTOOL + +dnl Checks for programs. +AC_PROG_AWK +AC_PROG_CC +AM_PROG_CC_STDC +AC_PROG_YACC +AM_PROG_LEX +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_C_BIGENDIAN +AC_C_CONST +AC_C_INLINE +AC_SYS_LARGEFILE + +dnl configure AS and ASFLAGS... +AM_PROG_AS + +AC_CHECK_HEADERS([fenv.h stdint.h inttypes.h sys/types.h alloca.h]) + +dnl AX_PREFIXED_DEFINE([RELOADED], [HAVE_STDINT_H]) +dnl AX_PREFIXED_DEFINE([RELOADED], [HAVE_INTTYPES_H]) + +AC_CHECK_FUNCS([posix_memalign memalign fmax lround pow bzero gettimeofday memset mmap strndup strstr strncasecmp]) +AC_CHECK_FUNCS([sched_get_priority_max]) +AC_CHECK_FUNCS([select socket getpagesize memcpy]) + +AC_CHECK_FUNC(getopt_long, + [AC_DEFINE(HAVE_GETOPT_LONG, 1, [long getopt support])], + [ # FreeBSD and BSD/OS have a gnugetopt library for this: + AC_CHECK_LIB([gnugetopt], [getopt_long], + [AC_DEFINE(HAVE_GETOPT_LONG, 1, + [long getopt support]) + LIBGETOPT_LIB="-lgnugetopt"]) + ]) + +AC_CHECK_SIZEOF([int]) +AC_CHECK_SIZEOF([long int]) +AC_CHECK_SIZEOF([size_t]) +AC_CHECK_SIZEOF([float]) + + + +AC_SUBST(LIBGETOPT_LIB) + +AC_TYPE_SIGNAL + +AC_MSG_NOTICE([The host is $host $host_cpu $host_vendor $host_os .]) + +case $host in + *-*-linux*) + AC_CHECK_HEADER(linux/version.h, + [have_linux=true + AC_DEFINE(HAVE_LINUX,1,[Linux platform]) + ], + [AC_MSG_ERROR([version.h not found - please install the linux kernel headers]) + ]) + LIBM_LIBS="-lm" + ;; + *-apple-darwin*) + AC_DEFINE(HAVE_DARWIN,1,[MAC OS X Darin]) + dnl OS-X/Darwin needs no-cpp-precomp + CFLAGS="$CFLAGS -no-cpp-precomp" + have_darwin=true + LIBM_LIBS="" + ;; + *) + AC_MSG_WARN([Alien platform - Good Luck!]) + LIBM_LIBS="" + ;; +esac + + +dnl ====== check for PKG_CONFIG_PATH +if test x"$PKG_CONFIG_PATH" = x ; then + AC_MSG_NOTICE([The PKG_CONFIG_PATH variable was not set]) + AC_MSG_NOTICE([You should set it to the directories that contain the .pc files]) + PKG_CONFIG_PATH=/usr/lib/pkgconfig +fi + + +AC_SUBST(LIBM_LIBS) + +dnl ********************************************************************* +dnl Check for the pthread lib +dnl +AC_SUBST(PTHREAD_LIBS) +have_pthread=false +AC_CHECK_LIB(pthread, pthread_create, + [ PTHREAD_LIBS="-lpthread" + AC_DEFINE(HAVE_LIBPTHREAD,1,[Compiling with pthread library]) + have_pthread=true ],,) + +AC_CHECK_FUNC(pthread_attr_getstacksize, + [ + AC_DEFINE(HAVE_PTHREADSTACKSIZE,,[Using pthread stack size]) + ] ) + + +have_alsa=false +AC_CHECK_LIB( asound, snd_seq_open, + [ + AC_DEFINE( HAVE_ALSA,1, [Whether or not we have alsa]) + ALSA_LIBS="-lasound" + AC_SUBST(ALSA_LIBS) + have_alsa=true ],,) + +AC_CHECK_HEADER(alsa/asoundlib.h,,[AC_MSG_ERROR([alsa/asoundlib.h not found - please install the alsa header])] ) + +have_dl_dlopen=false +AC_CHECK_LIB(dl,dlopen) +if test "$ac_cv_lib_dl_dlopen" = "yes"; then + AC_DEFINE(HAVE_DL_DLOPEN,1,[Compile with dlopen support]) + have_dl_dlopen=true +fi + +dnl Check for Veejay +have_veejay=false +PKG_CHECK_MODULES( VEEJAY, [veejay >= 1.5.60 ], + [ + AC_SUBST(VEEJAY_CFLAGS) + AC_SUBST(VEEJAY_LIBS) + have_veejay=true + AC_DEFINE(HAVE_VEEJAY,1, [Veejay 1.5.60 installed])] + , + [have_veejay=false]) + +if test x$have_veejay != xtrue ; then + AC_MSG_ERROR([Cannot find veejay 1.5.60 or later]) +fi + +have_sdl=false +if test x$with_sdl != xno ; then + PKG_CHECK_MODULES(SDL, [sdl >= 1.2], + [ + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + have_sdl=true + AC_DEFINE(HAVE_SDL,1,[use sdl keybindings])], + [have_sdl=false]) +fi + +if test x$have_sdl != xtrue ; then + AC_MSG_WARN([Cannot find SDL, reloaded will not be able to map keybindings]) +fi + +dnl ******************************************************************** +dnl Check to see if __progname is provided by the system +dnl ******************************************************************** +AC_CACHE_CHECK([for __progname], + [mjt_cv_extern___progname], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[extern char *__progname; + puts(__progname);]])], + [mjt_cv_extern___progname=yes], + [mjt_cv_extern___progname=no])]) +if test x$mjt_cv_extern___progname = xyes ; then + AC_DEFINE(HAVE___PROGNAME, 1, [Is __progname defined by system?]) +fi + +dnl Look for X +AC_PATH_XTRA +AM_CONDITIONAL(HAVE_X, test x$have_x = xyes) + +debugCFLAGS="" +debug_or_profiling="" + +AC_MSG_CHECKING(whether to compile in profiling information) +if test "x$profiling" = "xgprof" ; then + debugCFLAGS="$debugCFLAGS -g -no-pie -pg" + DEBUGLIBS="-pg" + AC_SUBST(DEBUGLIBS) + debug_or_profiling="profiling" + AC_MSG_RESULT([yes]) +elif test "x$profiling" = "xgcov" ; then + debugCFLAGS="$debugCFLAGS -fprofile-arcs -ftest-coverage" + DEBUGLIBS="-lgcov" + AC_SUBST(DEBUGLIBS) + debug_or_profiling="profiling" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING(whether to compile in debug symbols) +if test "x$enable_debug" = "xyes" ; then + debugCFLAGS="$debugCFLAGS -g" + debug_or_profiling="debug" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING(whether to compile in assertion checking) +if test "x$enable_strict" = "xyes" ; then + debugCFLAGS="$debugCFLAGS -DSTRICT_CHECKING" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +have_asm_nasm=false +have_asm_mmx=false +have_asm_sse=false +have_asm_sse2=false +have_asm_mmx2=false +have_asm_3dnow=false +have_cmov=false +have_x86cpu=false +have_x86_64cpu=false +have_altivec=false +have_mips=false +have_ppccpu=false +have_ps2=false +have_arm=false + +OP_CFLAGS="" + +AC_MSG_CHECKING([Architecture]) +case $host_cpu in + i[[3-7]]86) + AC_DEFINE(HAVE_X86CPU,1, [Compiling for x86 architecture CPU]) + AC_DEFINE(ARCH_X86,1,[Compiling for x86 architecture]) + have_x86cpu=true + + PROGRAM_NOPIC="-fno-PIC" + + if test -z $debug_or_profiling ; then + OP_CFLAGS="-O2" + fi + + dnl If the host is pentium, align on double word boundary + case $host_cpu in + i686) + CFLAGS="$CFLAGS" + ;; + *) + ;; + esac + + ;; + x86_64*|k8-*) + AC_DEFINE(HAVE_X86_CPU,1, [Compiling for x86-64 architecture CPU]) + AC_DEFINE(ARCH_X86_64,1, [Compiling for x86-64 architecture CPU]) + have_x86cpu=true + have_x86_64cpu=true + if test -z $debug_or_profiling ; then + OP_CFLAGS="-O2" + fi + + CFLAGS="$CFLAGS -m64 -fPIC -DPIC" + ;; + powerpc | powerpc64) + AC_DEFINE(HAVE_PPCCPU,1, [Compiling for PowerPC CPU]) + AC_DEFINE(ARCH_PPC,1,[Compiling for PowerPC]) + have_ppccpu=true + + case $host in + *-apple-darwin*) + PROGRAM_NOPIC="-mdynamic-no-pic" # dynamic-no-pic is an Apple gcc option +dnl CFLAGS="$CFLAGS -no-cpp-precomp" + + ;; + *) + PROGRAM_NOPIC="" + ;; + esac + ;; + mips | mipsel) + AC_DEFINE(ARCH_MIPS,,[Compiling for MIPS CPU]) + AC_DEFINE(HAVE_MIPS,,[Compiling for MIPS CPU]) + have_mips=true + AC_MSG_CHECKING([if we are compiling on playstation2 hardware]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], + [[#include + #include + ]])], + [have_ps2=true], + [have_ps2=false]) + + if test x$have_ps2 = xtrue ; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PS2,1,[Compile for playstation2]) + else + AC_MSG_RESULT(no) + fi + + ;; + arm|armv7l) + AC_DEFINE(HAVE_ARM,1,[Compiling for ARM CPU]) + have_arm=true + AC_MSG_RESULT(arm) + ;; + *) + AC_MSG_RESULT([unknown]) + ;; +esac + +CFLAGS="$CFLAGS -DFILE_OFFSET_BITS=64 -D_LARGE_FILES" +dnl This flag is used for PROGRAMS not SHARED LIBRARIES. PIC code is required +dnl for shared libraries but is slower than non-pic code. Compute bound +dnl programs such as yuvdenoise and y4mspatialfilter can use this flag by +dnl simply adding programname_CFLAGS=@PROGRAM_NOPIC@ to the Makefile.am + +AC_SUBST(PROGRAM_NOPIC) + +dnl ARM architecture detect NEON and set CFLAGS +if test x$have_arm = xtrue +then + AC_CACHE_CHECK(for NEON on processor(s), ac_cv_flag_neon, [ + if grep "^Features.* neon" /proc/cpuinfo > /dev/null; then + ac_cv_flag_neon=yes + else + ac_cv_flag_neon=no + fi + ]) + AC_MSG_RESULT($ac_cv_flag_neon) + + if test $ac_cv_flag_neon = yes ; then + AC_DEFINE(HAVE_ARM_NEON,1,[Compiling in NEON support]) + USER_CFLAGS="-mfpu=neon $USER_CFLAGS" + + else + USER_CFLAGS="-march=native $USER_CFLAGS" + fi + + if test "x$enable_debug" != "xyes" ; then + USER_CFLAGS="$USER_CFLAGS -O3 -fno-stack-protector" + else + USER_CFLAGS="$USER_CFLAGS -g -Wall" + fi + + CFLAGS="$USER_CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES" +fi + + +if test x$have_x86cpu = xtrue +then + AC_CACHE_CHECK(for MMX on processor(s), ac_cv_flag_mmx, [ + if grep "^flags.* mmx" /proc/cpuinfo > /dev/null; then + ac_cv_flag_mmx=yes + else + ac_cv_flag_mmx=no + fi + ]) + + if test $ac_cv_flag_mmx = yes; then + AC_DEFINE(HAVE_ASM_MMX,1,[Compiling in MMX support]) + AC_DEFINE(HAVE_MMX,1,[Compiling in MMX support]) + have_asm_mmx=true + fi + + AC_CACHE_CHECK(for SSE on processor(s), ac_cv_flag_sse, [ + if grep "^flags.* sse" /proc/cpuinfo > /dev/null; then + ac_cv_flag_sse=yes + else + ac_cv_flag_sse=no + fi + ]) + + if test $ac_cv_flag_sse = yes; then + AC_DEFINE(HAVE_ASM_SSE,1,[Compiling in SSE support]) + AC_DEFINE(HAVE_SSE,1,[Compiling in SSE support]) + have_asm_sse=true + fi + + + dnl check for sse2 + AC_CACHE_CHECK(for SSE2 on processor(s), ac_cv_flag_sse2, [ + if grep "^flags.* sse2" /proc/cpuinfo > /dev/null; then + ac_cv_flag_sse2=yes + else + ac_cv_flag_sse2=no + fi + ]) + + if test $ac_cv_flag_sse2 = yes; then + AC_DEFINE(HAVE_ASM_SSE2,1,[Compiling in SSE2 support]) + AC_DEFINE(HAVE_SSE2,1,[Compiling in SSE2 support]) + have_asm_sse2=true + fi + + AC_CACHE_CHECK(for 3DNOW on processor(s), ac_cv_flag_3dnow, [ + if grep "^flags.* 3dnow" /proc/cpuinfo > /dev/null; then + ac_cv_flag_3dnow=yes + else + ac_cv_flag_3dnow=no + fi + ]) + + if test $ac_cv_flag_3dnow = yes; then + AC_DEFINE(HAVE_ASM_3DNOW,1,[Compiling in 3Dnow]) + have_asm_3dnow=true + fi + + AC_CACHE_CHECK(for CMOV on processor(s), ac_cv_flag_cmov, [ + if grep "^flags.* cmov" /proc/cpuinfo > /dev/null; then + ac_cv_flag_cmov=yes + else + ac_cv_flag_cmov=yes + fi + ]) + + if test $ac_cv_flag_cmov = yes; then + AC_DEFINE(HAVE_CMOV,1,[Compiling in CMOV]) + have_cmov=true + fi + + + dnl check for MMX2 + AC_CACHE_CHECK(for MMX2 on processor(s), ac_cv_flag_mmx2, [ + if grep "^flags.* mmxext" /proc/cpuinfo > /dev/null; then + ac_cv_flag_mmx2=yes + else + ac_cv_flag_mmx2=yes + fi + ]) + + if test $ac_cv_flag_mmx2 = yes; then + AC_DEFINE(HAVE_ASM_MMX2,,[Compiling in MMX2]) + have_asm_mmx2=true + fi + +fi + +if test x$have_ppccpu = xtrue +then + AC_MSG_CHECKING([compiler support for AltiVec]) + cat > conftest.c < +#endif +int main() { + union { vector signed int v; + signed int i; + } vi; + vi.v = vec_splat_s32(1); + return vi.i; +} +EOF + ALTIVEC_CFLAGS="" + if $CC -o conftest conftest.c >/dev/null 2>&1; then + have_altivec=true + elif $CC $CFLAGS -faltivec -o conftest conftest.c >/dev/null 2>&1; then + # Mac OS X style + have_altivec=true + ALTIVEC_CFLAGS="-faltivec" + elif $CC $CFLAGS -fvec -o conftest conftest.c >/dev/null 2>&1; then + # Motorola style + have_altivec=true + ALTIVEC_CFLAGS="-fvec" + elif $CC $CFLAGS -DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec -o conftest conftest.c >/dev/null 2>&1; then + # gcc 3.1 style + have_altivec=true + ALTIVEC_CFLAGS="-DHAVE_ALTIVEC_H=1 -maltivec -mabi=altivec" + fi + rm -f conftest*; + + if test x$have_altivec = xtrue + then + # add -O3 flag + ALTIVEC_CFLAGS="-O3 ${ALTIVEC_CFLAGS}" + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ALTIVEC,1, + [Inline PPC Altivec primitives available]) + AC_SUBST(ALTIVEC_CFLAGS) + else + AC_MSG_RESULT(no) + fi + + +fi + +if test ! -r $srcdir/cpuinfo.sh; then + AC_MSG_ERROR([cpuinfo.sh script not found - do a cvs update]) +fi + + +if test x$have_x86cpu = xtrue -o x$have_ppccpu = xtrue; then + if test x$host_alias != x; then + dnl Cross compiling + AC_MSG_CHECKING(sub-architecture settings) + if test x$have_x86cpu = xtrue; then + host_mod_cpu=`echo $host_cpu|tr _ -` + ARCHFLAGS="-march=$host_mod_cpu -mcpu=$host_mod_cpu" + AC_MSG_RESULT($ARCHFLAGS) + fi + else + AC_MSG_CHECKING(sub-architecture settings ...) + + chmod +x $srcdir/cpuinfo.sh + + if test "$arch_target" = "auto"; then + ARCHFLAGS=`$srcdir/cpuinfo.sh` + else + ARCHFLAGS="-mtune=generic" + fi + AC_MSG_RESULT($ARCHFLAGS) + + fi +fi + + +if test x$have_x86cpu = xtrue; +then + if test -z $debug_or_profiling ; + then + if test x$ac_cv_flag_sse = xyes; then + CFLAGS="$CFLAGS -msse -mfpmath=sse" + fi + + if test x$av_cv_flag_sse2 = xyes; then + CFLAGS="$CFLAGS -msse2 -mfpmath=sse" + fi + fi +fi + +AC_MSG_RESULT($CFLAGS) + +PKG_CHECK_MODULES(LIBAVUTIL,[libavutil >= 49.7], have_avutil=true,have_avutil=false) +if test x$have_avutil = xfalse; +then + AC_MSG_ERROR([libavutil not found.]) +fi + +PKG_CHECK_MODULES( LIBX11, x11, have_x11=true,have_x11=false) +if test x$have_x11 = xfalse; +then + AC_MSG_ERROR([libx11 not found.]) +fi + +#PKG_CHECK_MODULES(DEPS, [glib-2.0 >= 2.42?]) //jessie oldstable +#AC_DEFINE(GLIB_VERSION_MIN_REQUIRED, GLIB_VERSION_2_30?, [Ignore post 2.42? deprecations]) + +dnl Check for Gtk3 +have_gtk3=false +gtk_modules="gtk+-3.0 >= 3" # 3.14 jessie oldstable +PKG_CHECK_MODULES( GTK, [$gtk_modules], + [ + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + have_gtk3=true + AC_DEFINE(GDK_VERSION_MIN_REQUIRED, GDK_VERSION_3_0, [Ignore post Gtk 3.0 deprecations]) + AC_DEFINE(GDK_VERSION_MAX_ALLOWED, GDK_VERSION_3_0, [Prevent post Gtk 3.0 APIs]) + ] + , + [have_gtk3=false]) + +if test x$have_gtk3 != xtrue ; then + AC_MSG_ERROR([Cannot find Gtk+ 3.0 or later.]) +fi + +FFMPEG_CFLAGS="${LIBAVUTIL_CFLAGS}" +AC_SUBST(FFMPEG_CFLAGS) +dnl ********************************************************************** +dnl All the conditional stuff for the Makefiles +AM_CONDITIONAL(HAVE_ASM_MMX, test x$have_asm_mmx = xtrue) +AM_CONDITIONAL(HAVE_X86CPU, test x$have_x86cpu = xtrue) +AM_CONDITIONAL(HAVE_PPCCPU, test x$have_ppccpu = xtrue) +AM_CONDITIONAL(ARCH_PPC, test x$have_ppccpu = xtrue) +AM_CONDITIONAL(ARCH_X86, test x$have_x86cpu = xtrue) +AM_CONDITIONAL(HAVE_ALTIVEC, test x$have_altivec = xtrue) +AM_CONDITIONAL(HAVE_ASM_MMX2, test x$have_asm_mmx2 = xtrue) +AM_CONDITIONAL(HAVE_ASM_SSE, test x$have_asm_sse = xtrue) +AM_CONDITIONAL(HAVE_ASM_SSE2, test x$have_asm_sse2 = xtrue) +AM_CONDITIONAL(HAVE_ASM_NASM, test x$have_asm_nasm = xtrue) +AM_CONDITIONAL(HAVE_MMX, test x$have_asm_mmx = xtrue) +AM_CONDITIONAL(HAVE_SSE, test x$have_asm_sse = xtrue) +AM_CONDITIONAL(HAVE_SSE2, test x$have_asm_sse2 = xtrue) +AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue) +dnl ********************************************************************* +dnl Check for what warnings we want gcc to use and adjust the CFLAGS +dnl as needed. This only works for GCC. +dnl We do this last as it can screw up library detection etc... + +CFLAGS="$ARCHFLAGS $CFLAGS" +CXXFLAGS="$ARCHFLAGS $CXXFLAGS" + +AC_SUBST(OP_CFLAGS) + +if test "x${GCC}" != "xyes" ; then + enable_compile_warnings=no +fi + +AC_MSG_CHECKING(what warning flags to pass to the C compiler) +warnCFLAGS= +warnCXXFLAGS= +if test "x$enable_compile_warnings" != "xno" ; then + if test "x$GCC" = "xyes" ; then + case "$CFLAGS" in + *-Wall*) ;; + *) warnCFLAGS="-Wall -Wunused " ;; + esac + if test "x$enable_compile_warnings" = "xyes" ; then + warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wundef -Wshadow -Wbad-function-cast -Wconversion -Wpadded -Wunreachable-code -Wmissing-declarations -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual" + warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Wcast-qual" + fi + if test "x$enable_warnings_as_errors" = "xyes" ; then + warnCFLAGS="$warnCFLAGS -Werror" + warnCXXFLAGS="$warnCXXFLAGS -Werror" + fi + fi +fi + +if test "x$cflags_set" != "xyes" ; then + if test -n $debug_or_profiling ; then + CFLAGS="$debugCFLAGS $warnCFLAGS $CFLAGS" + else + CFLAGS="$CFLAGS $warnCFLAGS" + fi + CXXFLAGS="$CXXFLAGS $warnCXXFLAGS" + cflags_set=yes +fi + +if test -z $debug_or_profiling ; then + CFLAGS="$CFLAGS -fno-stack-protector -Wno-deprecated-declarations" +fi + +if test x"$with_extra_cflags" != "x"; then + CFLAGS="$CFLAGS $with_extra_cflags" + CXXFLAGS="$CXXFLAGS $with_extra_cflags" +fi + +reloaded_datadir="${datarootdir}/reloaded" +AC_SUBST(reloaded_datadir) + +dnl ********************************************************************** +dnl Output a Makefile or two and the lib/header descriptor script +dnl +AC_CONFIG_FILES([ +Makefile +src/Makefile +gveejay-paths.sh +]) +AC_OUTPUT + +sh gveejay-paths.sh > gveejay-paths.h + +AC_DEFINE(VERSION, ${VERSION}) + +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([ GVeejayReloaded ${VERSION} build configuration :]) +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([ Compiler flags: $CFLAGS]) +AC_MSG_NOTICE([ $OP_CFLAGS]) +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([ Architecture: ${host_cpu} ]) +AC_MSG_NOTICE([]) +if test "$have_x86cpu" = "true" ; then +AC_MSG_NOTICE([ x86 ]) +AC_MSG_NOTICE([ MMX enabled : ${ac_cv_flag_mmx}]) +AC_MSG_NOTICE([ MMX2 enabled : ${ac_cv_flag_mmx2}]) +AC_MSG_NOTICE([ SSE enabled : ${ac_cv_flag_sse}]) +AC_MSG_NOTICE([ SSE2 enabled : ${ac_cv_flag_sse2}]) +AC_MSG_NOTICE([ 3DNOW enabled : ${ac_cv_flag_3dnow}]) +AC_MSG_NOTICE([ CMOV enabled : ${ac_cv_flag_cmov}]) +fi + +if test "$have_ppccpu" = "true" ; then +AC_MSG_NOTICE([ ppc]) +AC_MSG_NOTICE([ AltiVec enabled : ${have_altivec}]) +fi + +if test "$have_mips" = "true" ; then +AC_MSG_NOTICE([ mips]) +AC_MSG_NOTICE([ PS/2 enabled : ${have_ps2}]) +fi + +if test "$have_arm" = "true" ; then +AC_MSG_NOTICE([ arm]) +AC_MSG_NOTICE([ NEON enabled : ${ac_cv_flag_neon}]) +fi + +AC_MSG_NOTICE([]) +if test "$have_linux" = "true" ; then +AC_MSG_NOTICE([ Platform: Linux]) +fi + +if test "$have_darwin" = "true" ; then +AC_MSG_NOTICE([ Platform: Darwin]) +AC_MSG_NOTICE([ Good luck! You can be the first! ]) +fi +AC_MSG_NOTICE([]) +AC_MSG_NOTICE([ Required dependencies:]) +AC_MSG_NOTICE([ - Veejay 1.5.60 : ${have_veejay}]) +AC_MSG_NOTICE([ - POSIX Threads (pthread) : ${have_pthread}]) +AC_MSG_NOTICE([ - Gtk3 support (gui) : ${have_gtk3}]) +AC_MSG_NOTICE([ - Alsa support (midi sequencer) : ${have_alsa}]) +AC_MSG_NOTICE([]) diff --git a/veejay-current/reloaded-gtk3/cpuinfo.sh b/veejay-current/reloaded-gtk3/cpuinfo.sh new file mode 100755 index 00000000..ca4ad7ce --- /dev/null +++ b/veejay-current/reloaded-gtk3/cpuinfo.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# simple script that detects march setting for this computer +# only for gcc + +if test x"$CC" = x; then + CC=gcc +fi + +target=$1 + +cc_version=`$CC -dumpversion` +_cc_major=`echo $cc_version | cut -d'.' -f1` +_cc_minor=`echo $cc_version | cut -d'.' -f2` + +do_cc() +{ + $CC -o conftest conftest.c $@ >/dev/null 2>&1 +} + +extcheck() +{ +cat > conftest.c < +void catch() { exit(1); } +int main(void){ + signal(SIGILL, catch); + __asm__ __volatile__ ("$1":::"memory"); + exit(0); +} +EOF + +do_cc +if test -x ./conftest; then + ./conftest + if test $? -ne 0; then + return 1 + fi + return 0 +else + return 1 +fi +} + + +cat > conftest.c << EOF +int main(void) { return 0; } +EOF + +arch=`$CC -march=native -Q --help=target|grep -- '-march='|cut -f3|head -n1` +do_cc -march=$arch +if test $? -ne 0; then + # gcc failed, lets try -dumpmachine and test specifically for arm + # since we know that 'gcc -march=native -Q --help=target` fails on gcc 4.6.3 + machine=`$CC -dumpmachine` + cpu=`echo $machine |cut -d '-' -f1` + case $cpu in + arm) + arch=`cat /proc/cpuinfo|grep 'model name'|head -n1|cut -d ':' -f2 |cut -d ' ' -f2 | tr '[:upper:]' '[:lower:]'` + ;; + esac + +fi + +if [ -z "$arch" ]; then + arch="native" +fi + +rm -rf veejay.arch +echo "-march=$arch" > veejay.arch + diff --git a/veejay-current/reloaded-gtk3/debian/README b/veejay-current/reloaded-gtk3/debian/README new file mode 100644 index 00000000..d9ccebe4 --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/README @@ -0,0 +1,117 @@ + + ~== + ~==== + :... ~~==== + :...... ~~~~==== + :.....: ~~~~==== + :...... -~~~~=== + :....... --~~~~~== + :....... ::~~~~~~= + :...... "::~~~~== + :....., :::~~~=== + :..... =::~~~~=== + :...... :::~~~==== + ....... ::~~~~~=== + ....... :::~~~~~~== + ...... ~::~~~~~~== + ...... |::~~~=| + ..... :::|:~==| + ..::: |:=|||==+ + ., :., :|||?||+= + ..::,,.: :||=~=.|| + ,...::,,, |~:=|||||+| + :..,:::||||~~~====++ + ,:,,,:::~~~~~===++++ Reloaded + ,::::~~~====++++ + ~~~~~===+++++ version 1.5.47 + ~~===+++++++: + N=++++++++++ Feb. 2015. + +++++++++ + ++++:::: + ::::: + || + + + :: Reloaded, a graphical interface for Veejay :: + + + FEATURE OVERVIEW + + +General: + + # Thin client (TCP/IP) + # MIDI support (auto learning) + # Slick interface designed for live performing + # Tracks multiple veejay servers + +Install +======= + +See file 'INSTALL' + +See doc/Howto_Compile.html +See doc/Howto_Compile_on_Ubuntu.html + +Documentation +============= + +See source code. + +Running +======= + +Reloaded requires a running veejay + +$ reloaded + +$ reloaded -h hostname -p portnumber + + +To use a midi controller with veejay you must connect +the veejay's sequencer port to the MIDI controller port. +There is a utility 'aconnect' (comes with ALSA) that does this. + +1. List inputs (midi keyboards) + $ aconnect -i + + client 129: 'Virtual Keyboard' [type=user] + + +2. List outputs (Veejay) + $ aconnect -o + + client 128: 'Veejay' [type=user] + + +3. Connect the ports + + $ aconnect 129 128 + + +4. Launch reloaded + + + +Know bugs +========= +- Multitracker crashes when using very high resolution video + + + + +About +===== + +GveejayReloaded is a client for veejay. As long as veejay (the server) +is running, you can connect and disconnect from it with reloaded. + + + + + + + + + + diff --git a/veejay-current/reloaded-gtk3/debian/changelog b/veejay-current/reloaded-gtk3/debian/changelog new file mode 100644 index 00000000..96c948eb --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/changelog @@ -0,0 +1,5 @@ +veejay-client (1.5.47-1) unstable; urgency=low + + * New release + + -- Niels Elburg Sat, 07 Feb 2015 19:18:35 +0100 diff --git a/veejay-current/reloaded-gtk3/debian/compat b/veejay-current/reloaded-gtk3/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/compat @@ -0,0 +1 @@ +9 diff --git a/veejay-current/reloaded-gtk3/debian/control b/veejay-current/reloaded-gtk3/debian/control new file mode 100644 index 00000000..de661ffa --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/control @@ -0,0 +1,19 @@ +Source: veejay-client +Section: video +Priority: optional +Maintainer: Niels Elburg +Build-Depends: debhelper (>= 8.0.0), autotools-dev, libavcodec-dev,libavformat-dev,libavutil-dev,libswscale-dev,libgtk2.0-dev,libsdl1.2-dev,libxml2-dev,libx11-dev,libmjpegtools-dev,libasound2-dev,libglade2-dev,libgtk2.0-dev,libx11-dev,veejay (>= 1.5.47) +Standards-Version: 3.9.4 +Homepage: http://www.veejayhq.net +Vcs-Git: git://github.com/c0ntrol/veejay.git + +Package: veejay-client +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, veejay (>= 1.5.47) +Description: Reloaded, a graphical interface for veejay. + This program requires a running veejay. + Features: + * Thin client (TCP/IP) + * MIDI support (auto learning) + * Slick interface designed for live performing + * Tracks multiple veejay servers diff --git a/veejay-current/reloaded-gtk3/debian/copyright b/veejay-current/reloaded-gtk3/debian/copyright new file mode 100644 index 00000000..9a91f8d3 --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/copyright @@ -0,0 +1,53 @@ +Upstream Author(s): + + Glade-2 interface design + Icon/picture design + Matthijs v. Henten + + Samplebank + Thomas Reinhold + + Veejay Logo (V) design + Dursun Koca + + Lead programming + Niels Elburg + + Contributions by: + Toni < oc2pus@arcor.de > + (making gveejay happen on GTK 2.4, veejay.spec file) + + CellRendererSpin 15 minute hack - good enough + Tim Philipp MΓΌller + + Initial debian packaging by + Jof Thibaut + + +Copyright: + + Copyright (C) 2008-2015, Niels Elburg VeejayHQ. + +License: + + 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +The Debian packaging is: + + Copyright (C) 2010 Jof Thibaut + and is licensed under the GPL version 3, + see `/usr/share/common-licenses/GPL-3'. diff --git a/veejay-current/reloaded-gtk3/debian/docs b/veejay-current/reloaded-gtk3/debian/docs new file mode 100644 index 00000000..e845566c --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/docs @@ -0,0 +1 @@ +README diff --git a/veejay-current/reloaded-gtk3/debian/rules b/veejay-current/reloaded-gtk3/debian/rules new file mode 100755 index 00000000..ff1f80f2 --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + + +%: + dh $@ --with autotools-dev diff --git a/veejay-current/reloaded-gtk3/debian/source/format b/veejay-current/reloaded-gtk3/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/veejay-current/reloaded-gtk3/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/veejay-current/reloaded-gtk3/doc/FXAnim.txt b/veejay-current/reloaded-gtk3/doc/FXAnim.txt new file mode 100644 index 00000000..93a91322 --- /dev/null +++ b/veejay-current/reloaded-gtk3/doc/FXAnim.txt @@ -0,0 +1,29 @@ +..................................................................................................... +..β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–’β–ˆβ–ˆ...β–ˆβ–ˆβ–’.......β–„β–„β–„.......β–ˆβ–ˆβ–ˆβ–„....β–ˆ..β–ˆβ–ˆβ–“.β–ˆβ–ˆβ–ˆβ–„.β–„β–ˆβ–ˆβ–ˆβ–“.β–„β–„β–„.....β–„β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“.β–ˆβ–ˆβ–“.β–’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ...β–ˆβ–ˆβ–ˆβ–„....β–ˆ. +β–“β–ˆβ–ˆ...β–’.β–’β–’.β–ˆ.β–ˆ.β–’β–‘......β–’β–ˆβ–ˆβ–ˆβ–ˆβ–„.....β–ˆβ–ˆ.β–€β–ˆ...β–ˆ.β–“β–ˆβ–ˆβ–’β–“β–ˆβ–ˆβ–’β–€β–ˆβ–€.β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–ˆβ–ˆβ–„...β–“..β–ˆβ–ˆβ–’.β–“β–’β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’..β–ˆβ–ˆβ–’.β–ˆβ–ˆ.β–€β–ˆ...β–ˆ. +β–’β–ˆβ–ˆβ–ˆβ–ˆ.β–‘.β–‘β–‘..β–ˆ...β–‘......β–’β–ˆβ–ˆ..β–€β–ˆβ–„..β–“β–ˆβ–ˆ..β–€β–ˆ.β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ....β–“β–ˆβ–ˆβ–‘β–’β–ˆβ–ˆ..β–€β–ˆβ–„.β–’.β–“β–ˆβ–ˆβ–‘.β–’β–‘β–’β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–‘..β–ˆβ–ˆβ–’β–“β–ˆβ–ˆ..β–€β–ˆ.β–ˆβ–ˆβ–’ +β–‘β–“β–ˆβ–’..β–‘..β–‘.β–ˆ.β–ˆ.β–’.......β–‘β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆ.β–“β–ˆβ–ˆβ–’..β–β–Œβ–ˆβ–ˆβ–’β–‘β–ˆβ–ˆβ–‘β–’β–ˆβ–ˆ....β–’β–ˆβ–ˆ.β–‘β–ˆβ–ˆβ–„β–„β–„β–„β–ˆβ–ˆβ–‘.β–“β–ˆβ–ˆβ–“.β–‘.β–‘β–ˆβ–ˆβ–‘β–’β–ˆβ–ˆ...β–ˆβ–ˆβ–‘β–“β–ˆβ–ˆβ–’..β–β–Œβ–ˆβ–ˆβ–’ +β–‘β–’β–ˆβ–‘....β–’β–ˆβ–ˆβ–’.β–’β–ˆβ–ˆβ–’.......β–“β–ˆ...β–“β–ˆβ–ˆβ–’β–’β–ˆβ–ˆβ–‘...β–“β–ˆβ–ˆβ–‘β–‘β–ˆβ–ˆβ–‘β–’β–ˆβ–ˆβ–’...β–‘β–ˆβ–ˆβ–’.β–“β–ˆ...β–“β–ˆβ–ˆβ–’.β–’β–ˆβ–ˆβ–’.β–‘.β–‘β–ˆβ–ˆβ–‘β–‘.β–ˆβ–ˆβ–ˆβ–ˆβ–“β–’β–‘β–’β–ˆβ–ˆβ–‘...β–“β–ˆβ–ˆβ–‘ +.β–’.β–‘....β–’β–’.β–‘.β–‘β–“.β–‘.......β–’β–’...β–“β–’β–ˆβ–‘β–‘.β–’β–‘...β–’.β–’.β–‘β–“..β–‘.β–’β–‘...β–‘..β–‘.β–’β–’...β–“β–’β–ˆβ–‘.β–’.β–‘β–‘...β–‘β–“..β–‘.β–’β–‘β–’β–‘β–’β–‘.β–‘.β–’β–‘...β–’.β–’. +.β–‘......β–‘β–‘...β–‘β–’.β–‘........β–’...β–’β–’.β–‘β–‘.β–‘β–‘...β–‘.β–’β–‘.β–’.β–‘β–‘..β–‘......β–‘..β–’...β–’β–’.β–‘...β–‘.....β–’.β–‘..β–‘.β–’.β–’β–‘.β–‘.β–‘β–‘...β–‘.β–’β–‘ +.β–‘.β–‘.....β–‘....β–‘..........β–‘...β–’......β–‘...β–‘.β–‘..β–’.β–‘β–‘......β–‘.....β–‘...β–’....β–‘.......β–’.β–‘β–‘.β–‘.β–‘.β–’.....β–‘...β–‘.β–‘. +.........β–‘....β–‘..............β–‘..β–‘.........β–‘..β–‘.........β–‘.........β–‘..β–‘.........β–‘......β–‘.β–‘...........β–‘. +..................................................................................................... + +== Effects Animation +Because of a new veejay functionality, the fx parameters anim "workflow" (using reloaded) have changed: +. From _Fx List_ panel, Add an fx you like. +. From _Fx Chain_ panel, toggle _keyframing for this fx chain entry_ +. From _Fx Anim_ panel, choose a parameter and toogle _keyframe animation for this param_ +. From _Fx Anim_ panel, draw the curve and hit [OK] _apply this keyframe_ + +.Taddam the fx' param is animated ! + +=== Now, what else you can do ? +.Play with the automation +* toggle the full fx automation hitting _keyframing for this fx chain entry_ button (VIMS 145 / keybinding TBD) +* toggle by parameters hitting accordingly the _keyframe animation for this param_ button (VIMS 142 / keybinding TBD) + +.Clear the automation +* full automation, using the _reset_ button, from the _Fx Anim_ panel (VIMS ? / keybinding TBD), +* by parameters the _clear selected param_, from the _Fx Anim_ panel (VIMS ? / keybinding TBD). diff --git a/veejay-current/reloaded-gtk3/gveejay-paths.sh.in b/veejay-current/reloaded-gtk3/gveejay-paths.sh.in new file mode 100644 index 00000000..7fcc6a1b --- /dev/null +++ b/veejay-current/reloaded-gtk3/gveejay-paths.sh.in @@ -0,0 +1,16 @@ +#!/bin/sh -e +reloaded_datadir="@reloaded_datadir@" + +cat << EOF +/* + This file has been automatically generated. Do not edit + +*/ +#ifndef GVEEJAY_PATHS_H +#define GVEEJAY_PATHS_H + +#define RELOADED_DATADIR "$reloaded_datadir" + +#endif /* GVEEJAY_PATHS_H */ +EOF + diff --git a/veejay-current/reloaded-gtk3/gveejay.spec.in b/veejay-current/reloaded-gtk3/gveejay.spec.in new file mode 100644 index 00000000..268565bf --- /dev/null +++ b/veejay-current/reloaded-gtk3/gveejay.spec.in @@ -0,0 +1,115 @@ +# norootforbuild +# neededforbuild update-desktop-files gtk2-devel-packages glib2 gtk2 libglade3 gtk2-devel glib2-devel libglade-devel libxml2-devel pkgconfig + +%define name reloaded +%define version 1.5.2 +%define release reloaded +%define prefix /usr + +%define builddir $RPM_BUILD_DIR/%{name}-%{version} + +Summary: Video Mixing/Editing Instrument +Name: %{name} +Version: %{version} +Release: %{release} +Prefix: %{prefix} +Copyright: GNU GPL +URL: http://veejayq.net +Packager: nelburg +Group: Productivity/Multimedia/Video/Editors and Convertors +Source: %{name}-%{version}.tar.bz2 +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Prereq: /sbin/ldconfig +#Requires: libxml2 >= 2.5.4 +#Requires: gtk2 +#Requires: glib2 +#Requires: libglade2 +#Requires: libxml2 >= 2.5.4 +#Requires: cairo +#BuildRequires: pkgconfig +#BuildRequires: gtk2-devel +#BuildRequires: glib2-devel +#BuildRequires: libglade2-devel + +%description +Veejay is a visual instrument and realtime video sampler. +It allows you to 'play' the video like you would play a Piano and it allows +you to record the resulting video directly to disk for immediate playback (video sampling). + +GVeejayReloaded is the graphical interface for Veejay. + +Author: Niels Elburg + +Requires: gtk2 +Requires: glib2 +Requires: libglade2 +Requires: libxml2 >= 2.5.4 + +%prep +%setup -q -n %{name}-%{version} + +./autogen.sh +%{?suse_update_config:%{suse_update_config -f}} + +CFLAGS="$RPM_OPT_FLAGS" \ +CXXFLAGS="$RPM_OPT_FLAGS" \ +./configure \ + --with-arch-target=generic \ + --prefix=%{prefix} \ + --mandir=%{_mandir} + +%build +# Setup for parallel builds +numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :` +if [ "$numprocs" = "0" ]; then + numprocs=1 +fi +make -j$numprocs + +%install +[ -d %{buildroot} -a "%{buildroot}" != "" ] && rm -rf %{buildroot} + +make install-strip \ + DESTDIR=%{buildroot} + +# icon and menu-entry +mkdir -p %{buildroot}%{_datadir}/pixmaps +install -m 644 share/%{name}-logo.png %{buildroot}%{_datadir}/pixmaps/gveejay.png +cat > gveejay.desktop << EOF +[Desktop Entry] +Comment=Video Mixing/Editing Instrument +Exec=reloaded +GenericName= +Icon=%{name} +MimeType= +Name=Reloaded +Path= +StartupNotify=true +Terminal=false +Type=Application +EOF +%suse_update_desktop_file -i reloaded AudioVideo Player + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%clean +[ -d %{buildroot} -a "%{buildroot}" != "" ] && rm -rf %{buildroot} + +%files +%defattr(-, root, root) +%doc AUTHORS BUGS COPYING ChangeLog INSTALL README* +%doc doc +%{_bindir}/%{name} +%{_datadir}/%{name}/*.png +# reloaded +%{_bindir}/src +%{_datadir}/%{name}/gveejay-reloaded-2.glade +%{_datadir}/%{name}/gveejay.rc +%{_datadir}/pixmaps/gveejay.png +%{_datadir}/applications/gveejay.desktop + +%changelog -n veejay +Dec 20, 2009. Updated rpm spec for reloaded 1.5.2 +Mar 21, 2007. Initial rpm spec for gveejayreloaded diff --git a/veejay-current/reloaded-gtk3/menu/gveejayreloaded.desktop b/veejay-current/reloaded-gtk3/menu/gveejayreloaded.desktop new file mode 100644 index 00000000..299dc2b3 --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/gveejayreloaded.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=GVeejayReloaded +Comment=Graphical Veejay Client +Exec=gveejayreloaded +Terminal=false +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/menu/veejay1.desktop b/veejay-current/reloaded-gtk3/menu/veejay1.desktop new file mode 100644 index 00000000..31bce654 --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/veejay1.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Veejay (720x576 with audio) +Comment=Start new veejay project, 720x576 with default audio settings +Exec=veejay -v -W720 -H576 -a1 -d +Terminal=true +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/menu/veejay2.desktop b/veejay-current/reloaded-gtk3/menu/veejay2.desktop new file mode 100644 index 00000000..8f9c8ff1 --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/veejay2.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Veejay (720x576 without audio) +Comment=Start new Veejay project, 720x576 without audio +Exec=veejay -v -W720 -H576 -a0 -d +Terminal=true +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/menu/veejay3.desktop b/veejay-current/reloaded-gtk3/menu/veejay3.desktop new file mode 100644 index 00000000..c0e53f5e --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/veejay3.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Veejay (640x480, /dev/video0) +Comment=Start veejay server with capture device #0 in 640x480 +Exec=veejay -A1 -v -W640 -H480 +Terminal=true +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/menu/veejay4.desktop b/veejay-current/reloaded-gtk3/menu/veejay4.desktop new file mode 100644 index 00000000..53e6a3e6 --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/veejay4.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Veejay (720x576, /dev/video0) +Comment=Start veejay server from capture device #0 in 720x576 +Exec=veejay -A1 -v -W720 -H576 +Terminal=true +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/menu/veejay5.desktop b/veejay-current/reloaded-gtk3/menu/veejay5.desktop new file mode 100644 index 00000000..5371c744 --- /dev/null +++ b/veejay-current/reloaded-gtk3/menu/veejay5.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Name=Veejay (352x288, /dev/video0) +Comment=Start veejay server with capture device #0 in 352x288 +Exec=veejay -A1 -v -W352 -H288 +Terminal=true +Type=Application +Icon=veejay-icon.png +Categories=AudioVideoEditing;AudioVideo; diff --git a/veejay-current/reloaded-gtk3/share/bg.png b/veejay-current/reloaded-gtk3/share/bg.png new file mode 100644 index 00000000..92c332d4 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_black.png b/veejay-current/reloaded-gtk3/share/bg_black.png new file mode 100644 index 00000000..acc56362 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_black.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_blue.png b/veejay-current/reloaded-gtk3/share/bg_blue.png new file mode 100644 index 00000000..f1f1b98d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_blue.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_green.png b/veejay-current/reloaded-gtk3/share/bg_green.png new file mode 100644 index 00000000..af8aa721 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_green.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_grey.png b/veejay-current/reloaded-gtk3/share/bg_grey.png new file mode 100644 index 00000000..20ba15d7 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_grey.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_red.png b/veejay-current/reloaded-gtk3/share/bg_red.png new file mode 100644 index 00000000..16e4811c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_red.png differ diff --git a/veejay-current/reloaded-gtk3/share/bg_yellow.png b/veejay-current/reloaded-gtk3/share/bg_yellow.png new file mode 100644 index 00000000..c245dd3b Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/bg_yellow.png differ diff --git a/veejay-current/reloaded-gtk3/share/blackwhite.rc b/veejay-current/reloaded-gtk3/share/blackwhite.rc new file mode 100644 index 00000000..11331dcc --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/blackwhite.rc @@ -0,0 +1,118 @@ +# Edit these colors and fonts however you like. +style "default" +{ + engine "hcengine" {} + xthickness = 1 + ythickness = 1 + GtkWidget::shadow_type = GTK_SHADOW_ETCHED_OUT + #GtkWidget::interior_focus = 0 + #GtkWidget::focus_padding = 0 + #GtkWidget::default_border = {0, 0, 0, 0} + #GtkWidget::default_outside_border = {0, 0, 0, 0} + GtkWidget::default_spacing = 0 + GtkScale::stepper_size = 8 + GtkRange::through-width = 4 + GtkRange::trough_border = 0 + GtkRange::slider-width = 16 + GtkScale::slider-length = 10 + + font_name = "Sans 8" + + fg[NORMAL] = "#ffffff" # borders etc. + fg[PRELIGHT] = "#000000" + fg[ACTIVE] = "#ffffff" # ook borders, van sliders en notebook + fg[SELECTED] = "#000000" + fg[INSENSITIVE] = "#505050" + + bg[NORMAL] = "#303030" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#202020" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#00ff00" + bg[INSENSITIVE] = "#000000" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#c0c0c0" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#303060"# achtergrond van lists, status bars + base[PRELIGHT] = "#00fff0" + base[ACTIVE] = "#0000ff" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + +style "text" +{ + font_name = "Sans 8" + + fg[NORMAL] = "#ffffff" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#ffffff" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#ffffff" + + bg[NORMAL] = "#27282F" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#454f60" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + +style "buttons" +{ + + font_name = "Sans 8" + + fg[NORMAL] = "#888888" + fg[PRELIGHT] = "#888888" + fg[ACTIVE] = "#888888" + fg[SELECTED] = "#888888" + fg[INSENSITIVE] = "#888888" + + bg[NORMAL] = "#27282F" + bg[PRELIGHT] = "#aaacc1" + bg[ACTIVE] = "#454f60" + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + + +class "GtkButton" style "default" +class "GtkSpinButton" style "default" +class "GtkToggleButton" style "default" +class "GtkCheckBox" style "default" + +class "GtkLabel" style "default" + +class "GtkWidget" style "default" diff --git a/veejay-current/reloaded-gtk3/share/button_back.png b/veejay-current/reloaded-gtk3/share/button_back.png new file mode 100644 index 00000000..c2295b5b Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_back.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_bounce.png b/veejay-current/reloaded-gtk3/share/button_bounce.png new file mode 100644 index 00000000..82bbce6a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_bounce.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_dec.png b/veejay-current/reloaded-gtk3/share/button_dec.png new file mode 100644 index 00000000..4fc75576 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_dec.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_down.png b/veejay-current/reloaded-gtk3/share/button_down.png new file mode 100644 index 00000000..99621523 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_down.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_fbw.png b/veejay-current/reloaded-gtk3/share/button_fbw.png new file mode 100644 index 00000000..32e6b085 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_fbw.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_ffw.png b/veejay-current/reloaded-gtk3/share/button_ffw.png new file mode 100644 index 00000000..50108d46 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_ffw.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_gotoend.png b/veejay-current/reloaded-gtk3/share/button_gotoend.png new file mode 100644 index 00000000..d7d362f0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_gotoend.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_gotostart.png b/veejay-current/reloaded-gtk3/share/button_gotostart.png new file mode 100644 index 00000000..c0ed75cc Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_gotostart.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_inc.png b/veejay-current/reloaded-gtk3/share/button_inc.png new file mode 100644 index 00000000..862e48ee Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_inc.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_loop.png b/veejay-current/reloaded-gtk3/share/button_loop.png new file mode 100644 index 00000000..aacf503f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_loop.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_looponce.png b/veejay-current/reloaded-gtk3/share/button_looponce.png new file mode 100644 index 00000000..3e2e20d9 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_looponce.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_mini_decrement.png b/veejay-current/reloaded-gtk3/share/button_mini_decrement.png new file mode 100644 index 00000000..46dbe3ea Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_mini_decrement.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_mini_increment.png b/veejay-current/reloaded-gtk3/share/button_mini_increment.png new file mode 100644 index 00000000..f307df4c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_mini_increment.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_next.png b/veejay-current/reloaded-gtk3/share/button_next.png new file mode 100644 index 00000000..d5902fb0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_next.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_pause.png b/veejay-current/reloaded-gtk3/share/button_pause.png new file mode 100644 index 00000000..50b227a8 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_pause.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_play.png b/veejay-current/reloaded-gtk3/share/button_play.png new file mode 100644 index 00000000..e63e771f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_play.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_playmode.png b/veejay-current/reloaded-gtk3/share/button_playmode.png new file mode 100644 index 00000000..cdc841b0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_playmode.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_prev.png b/veejay-current/reloaded-gtk3/share/button_prev.png new file mode 100644 index 00000000..653c503f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_prev.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_rand.png b/veejay-current/reloaded-gtk3/share/button_rand.png new file mode 100644 index 00000000..f2dd61cc Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_rand.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_reverse.png b/veejay-current/reloaded-gtk3/share/button_reverse.png new file mode 100644 index 00000000..59bd29e0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_reverse.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_right.png b/veejay-current/reloaded-gtk3/share/button_right.png new file mode 100644 index 00000000..3ec7b43f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_right.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_skip.png b/veejay-current/reloaded-gtk3/share/button_skip.png new file mode 100644 index 00000000..7d649bb5 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_skip.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_skull.png b/veejay-current/reloaded-gtk3/share/button_skull.png new file mode 100644 index 00000000..bbed6da0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_skull.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_text.png b/veejay-current/reloaded-gtk3/share/button_text.png new file mode 100644 index 00000000..bfd19e8d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_text.png differ diff --git a/veejay-current/reloaded-gtk3/share/button_up.png b/veejay-current/reloaded-gtk3/share/button_up.png new file mode 100644 index 00000000..862e48ee Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/button_up.png differ diff --git a/veejay-current/reloaded-gtk3/share/fx_entry_off.png b/veejay-current/reloaded-gtk3/share/fx_entry_off.png new file mode 100644 index 00000000..adb5cafb Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/fx_entry_off.png differ diff --git a/veejay-current/reloaded-gtk3/share/fx_entry_on.png b/veejay-current/reloaded-gtk3/share/fx_entry_on.png new file mode 100644 index 00000000..8de23e6c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/fx_entry_on.png differ diff --git a/veejay-current/reloaded-gtk3/share/gveejay-default.rc b/veejay-current/reloaded-gtk3/share/gveejay-default.rc new file mode 100644 index 00000000..9fb9e798 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay-default.rc @@ -0,0 +1,21 @@ +# Edit these colors and fonts however you like. +style "default" +{ + xthickness = 1 + ythickness = 1 + GtkWidget::shadow_type = GTK_SHADOW_ETCHED_OUT + #GtkWidget::interior_focus = 0 + #GtkWidget::focus_padding = 0 + #GtkWidget::default_border = {0, 0, 0, 0} + #GtkWidget::default_outside_border = {0, 0, 0, 0} + GtkWidget::default_spacing = 0 + GtkScale::stepper_size = 8 + GtkRange::through-width = 4 + GtkRange::trough_border = 0 + GtkRange::slider-width = 16 + GtkScale::slider-length = 10 + font_name = "Sans 8" +} + + +class "GtkWidget" style "default" diff --git a/veejay-current/reloaded-gtk3/share/gveejay.glade b/veejay-current/reloaded-gtk3/share/gveejay.glade new file mode 100644 index 00000000..7a8745eb --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.glade @@ -0,0 +1,9693 @@ + + + + + + + True + gveejay - graphical veejay + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_EAST + True + + + + True + False + 3 + + + + True + False + 0 + + + + True + False + 3 + + + + True + True + False + 0 + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + True + True + 0 + localhost + True + * + False + + + 0 + True + True + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 3490 1024 65535 1 4 4 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + + True + Open EditList/Videofile + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + + + True + veejay launch/connect + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + Launch/reconnect + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_connect.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Cancel + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_disconnect.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Screenshot + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_screenshot.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Toggle Bezerk Mode + True + GTK_RELIEF_NORMAL + True + False + False + + + + + True + icon_berserk.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Display Debug + True + GTK_RELIEF_NORMAL + True + False + False + + + + + True + icon_bug.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Change Playback Mode + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_playmode.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Take Background Mask(diff overlay) + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_mask.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + + + + + True + icon_jack.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Create a new solid colored stream + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_color.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Open Veejay Liveset / Action file + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Veejay Liveset / Actionfile + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + Editlist positon + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 00000000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 14 + False + 0 + + + 0 + False + False + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 11 + False + 0 + + + 0 + False + False + + + + + + True + Editlist frames + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 00000000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 14 + False + 0 + + + 0 + False + False + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 11 + False + 0 + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + 0.800000011921 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotostart.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_fbw.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_reverse.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_pause.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_play.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_ffw.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotoend.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + True + True + + + + + + True + True + True + GTK_POS_LEFT + 0 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 1 2 4 + + + + 0 + True + True + + + + + + True + 1 + 0.5 + 0.5 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_prev.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_skip.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Mark current position as start of a new sample + True + [... + True + GTK_RELIEF_NORMAL + True + + + + 0 + True + True + + + + + + True + Mark current position as sample end and create new sample + True + ...] + True + GTK_RELIEF_NORMAL + True + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + True + False + GTK_POS_TOP + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.0010000000475 0.10000000149 0 + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + True + True + GTK_POS_BOTTOM + 2 + GTK_UPDATE_CONTINUOUS + True + 0 0 1 0.0500000007451 0.10000000149 0.20000000298 + + + + 0 + False + True + + + + + + True + True + True + GTK_POS_BOTTOM + 2 + GTK_UPDATE_CONTINUOUS + True + 1 0 1 0.00999999977648 0.10000000149 0 + + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + True + True + 0 + + + + + True + True + True + False + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + GTK_CORNER_TOP_LEFT + + + + 230 + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + False + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + 33 + True + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + False + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + + + + + + + + 0 + True + True + + + + + False + True + + + + + + True + Console + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + 5 + 2 + False + 0 + 3 + + + + True + Timecode + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Current position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Start position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + End position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + False + 0 + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 0 + False + False + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 0 + False + False + + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 1000000000 1 25 25 + + + + 1 + 2 + 3 + 4 + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 1000000000 1 25 25 + + + + 1 + 2 + 4 + 5 + + + + + + + True + Speed + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 -100 100 1 5 5 + + + + 1 + 2 + 2 + 3 + + + + + + + True + False + 0 + + + + True + 000000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 0 + False + False + + + + + + True + Enable/disable effectchain + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + True + EffectChain + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Play once + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_looponce.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + + True + Normal Loop + True + GTK_RELIEF_NORMAL + True + True + False + True + loop_none + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_bounce.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + + True + Pingpong loop + True + GTK_RELIEF_NORMAL + True + False + False + True + loop_none + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_loop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + GTK_PACK_END + + + + + + + + True + <b>Loop Types</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Start / Stop randomizer + True + rand() + True + GTK_RELIEF_NORMAL + True + False + False + + + + 0 + False + False + + + + + + True + True + Free Style + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + True + <b>Sample randomizer</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + False + GTK_POS_LEFT + 4 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0 + + + + 0 + True + True + + + + + + True + True + False + GTK_POS_LEFT + 4 + GTK_UPDATE_CONTINUOUS + True + 0 0 1 0.00999999977648 0.10000000149 0 + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + Bind marker + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + Clear marker + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + + + True + <b>Markers</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + + True + <b>Sample properties</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + Sample + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + True + EffectChain + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + + + 0 + True + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + False + True + + + + + + + False + True + + + + + + True + Color dial + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + True + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 5 + 2 + False + 0 + 0 + + + + True + Brightness + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Contrast + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Color + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Hue + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 3 + 4 + fill + fill + + + + + + True + White + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 4 + 5 + fill + fill + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 0 + 1 + fill + + + + + + + + True + Capture card settings + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + + True + Capture card controls + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + Hardware controls + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + <b>Stream properties</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + Stream + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 3 + 2 + False + 0 + 5 + + + + True + <i>Starting position</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 10 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + <i>Duration:</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + <i>Ending position:</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 10 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 10 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + + + True + <b>Current Selection</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.270000010729 + 0 + 3 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 2 + 2 + False + 0 + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + + 0 + 1 + 0 + 1 + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + + 0 + 1 + 1 + 2 + + + + + + + True + Take current position as ending position + True + Set end + True + GTK_RELIEF_NORMAL + True + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Take current position as starting position + True + Set start + True + GTK_RELIEF_NORMAL + True + + + + 1 + 2 + 0 + 1 + fill + + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + Cut selection to buffer + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_cut.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Copy selection to buffer + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Paste from buffer into editlist at current position + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_paste.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete selection (without buffer) + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_trash.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Crop to selection + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_crop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + Paste at position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + 0 + True + True + + + + + + True + Paste buffer at position + True + Paste At! + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + 2 + False + True + + + + + + + + True + <b>EditList Operations</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 3 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + Editlist + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + True + 0 + + + + True + Play selected sample/stream + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + + True + Open Samplelist + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Samplelist + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete Sample + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Copy sample to new + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + False + False + + + + + False + True + + + + + + True + Sample list + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + True + 0 + + + + True + Add Videofiles to EditList + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Selection + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save EditList + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Create sample from selection + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_new.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + False + True + + + + + + True + Editlist + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Samplelist + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + False + False + False + True + False + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + Entry enabled + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + 0 + True + True + + + + + + True + Set fade duration + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1 0.0500000007451 0.10000000149 0.10000000149 + + + + 0 + False + False + + + + + + True + Fade In + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_fadein.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Fade Out + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_fadeout.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Clear Entry + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Create bundle + True + GTK_RELIEF_HALF + True + + + + + True + icon_bundle.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Clear Chain + True + GTK_RELIEF_HALF + True + + + + + True + icon_clearall.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P0 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 146 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P1 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P2 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 136 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P3 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P4 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 177 0 255 0 0 0 + + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P5 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 86 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P6 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 126 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + + + True + P7 + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + + True + <b>Effect controls</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + Loops + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + True + Frames + True + GTK_RELIEF_NORMAL + True + True + False + True + sample_mulloop + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999999 1 10 10 + + + + 0 + True + True + + + + + + True + 00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + 133 + True + MJPEG +DVVIDEO +MPEG4 +MSMPEG4V3 +YV12 +YV16 + False + True + True + + + 0 + False + True + + + + + + True + True + Play when finished + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + Start recording + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_record.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Cancel recording + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_recordstop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + + + True + <b>Record to sample</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + label389 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + No. of frames to record: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999999 1 10 10 + + + + 0 + True + True + + + + + + True + 0:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 16 + 3 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + 100 + True + MJPEG +DVVIDEO +MPEG4 +MSMPEG4V3 +YV12 +YV16 + False + True + True + + + 0 + False + True + + + + + + True + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + True + Play when finished + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + + True + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + Start recording + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_record.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Cancel recording + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_recordstop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + True + True + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + + + + True + <b>Record to sample</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + label390 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Effect controls + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_IN + + + + True + False + True + + + + + + + False + True + + + + + + True + Color picker + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + False + True + + + + + + True + Effect mixing sources + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + False + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Effect Chain + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + True + False + + + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + True + True + + + + + 0 + True + True + + + + + + True + 1 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + True + 0 + + + + True + New + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_new.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Load Actionfile + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Write Actionfile + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + VIMS commands + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_question.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Set/Change Key + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_keybind.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete selected bundle + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Deatach Key from selected event + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_keydetach.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Apply changes to this bundle + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Clear text + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + + + True + <b>VIMS Bundle</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + False + True + + + + + + True + VIMS Bundles + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + True + True + 0 + + + + 140 + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + + + True + Device + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + + True + Video4Linux / Digital Video + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + 0 + False + True + + + + + + True + True + True + 0 + + + + True + 2 + 5 + False + 0 + 4 + + + + True + True + Try + True + GTK_RELIEF_NORMAL + True + + + + 4 + 5 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 4490 1 65535 1 10 10 + + + 4 + 5 + 0 + 1 + + + + + + + True + Port Number + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 2 + 3 + 0 + 1 + + + + + + + True + Remote + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + Use multicast + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + 1 + 0 + 1 + fill + + + + + + + + + True + Network + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + True + 0 + + + + True + 2 + 5 + False + 0 + 4 + + + + True + Filename + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 2 + 4 + 0 + 1 + + + + + + + True + True + Try + True + GTK_RELIEF_NORMAL + True + + + + 4 + 5 + 1 + 2 + fill + + + + + + + True + Load Actionfile + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 4 + 5 + 0 + 1 + fill + + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + use YUV4MPEG + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + use FFmpeg + True + GTK_RELIEF_NORMAL + True + False + False + True + inputstream_filey4m + + + 0 + False + False + + + + + + True + True + use picture + True + GTK_RELIEF_NORMAL + True + False + False + True + inputstream_filey4m + + + 0 + False + False + + + + + + + + + + True + Types + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + 1 + 0 + 2 + 3 + fill + fill + + + + + + + + True + File + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + + + True + <b>Input Streams</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + False + 0 + + + + True + False + 5 + + + + True + 2 + 4 + False + 0 + 0 + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + X offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + Y offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + 3 + 4 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + True + SAR + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + + 0 + True + True + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + Fullscreen + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + 30 + True + wbmp,wmf,jpeg,ani,bmp,gif,ico,pcx,png,pnm,ras,tga,xmb,tiff,xpm,svg + True + True + True + 4 + jpg + False + * + False + + + 0 + False + True + + + + + + True + Apply changes to primary output settings + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_apply.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + + + True + <b>Primary Video Window (SDL)</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + Input/Output + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + + + True + False + 30 + + + + True + False + 3 + + + + True + 352x288 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + @ + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 25 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + fps + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + PAL + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Top First + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + 44000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Hz/ + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 16 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + bits/ + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 2 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Ch + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + 0 + True + True + + + + + + True + 1 + 0.5 + 0 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 3 + + + + True + Playing now: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Sample + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + 00000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 7 + False + 0 + + + 0 + False + False + + + + + + + 0 + True + True + + + + + label_item + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + True + True + 0 + 600:; + True + * + False + + + + 3 + True + True + + + + + + True + Send VIMS to veejay + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + + True + VIMS commands + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_question.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + VIMS messenger + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + CPU remaining time + GTK_PROGRESS_RIGHT_TO_LEFT + 0 + 0.10000000149 + CPU remaining + PANGO_ELLIPSIZE_NONE + + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + False + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + True + False + True + 0 + + True + * + False + + + 0 + False + False + + + + + + + + False + window1 + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_EAST + True + + + + True + False + 0 + + + + True + True + True + False + False + True + False + False + False + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 19 0 19 1 10 10 + + + + 0 + False + True + + + + + + True + True + True + True + 0 + + True + * + False + 15 + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + Render to selected entry + True + GTK_RELIEF_NORMAL + True + + + + True + icon_render.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Move to new sample + True + GTK_RELIEF_NORMAL + True + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + True + button116 + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + + + + + + 0 + False + True + + + + + + + diff --git a/veejay-current/reloaded-gtk3/share/gveejay.rc b/veejay-current/reloaded-gtk3/share/gveejay.rc new file mode 100644 index 00000000..fbbfa605 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.rc @@ -0,0 +1,137 @@ +# Edit these colors and fonts however you like. +style "default" +{ +# engine "hcengine" {} + xthickness = 1 + ythickness = 1 + GtkWidget::shadow_type = GTK_SHADOW_ETCHED_IN + #GtkWidget::interior_focus = 0 + #GtkWidget::focus_padding = 0 + #GtkWidget::default_border = {0, 0, 0, 0} + #GtkWidget::default_outside_border = {0, 0, 0, 0} + GtkWidget::default_spacing = 0 + GtkScale::stepper_size = 8 + GtkRange::through-width = 4 + GtkRange::trough_border = 0 + GtkRange::slider-width = 16 + GtkScale::slider-length = 12 + + font_name = "Sans 8" + + fg[NORMAL] = "#646464" # borders etc. + fg[PRELIGHT] = "#646464" + fg[ACTIVE] = "#646464" # ook borders, van sliders en notebook + fg[SELECTED] = "#646464" + fg[INSENSITIVE] = "#404040" + + bg[NORMAL] = "#27282F" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#454f60" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + +style "text" +{ + font_name = "Sans 8" + + fg[NORMAL] = "#ffffff" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#ffffff" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#ffffff" + + bg[NORMAL] = "#27282F" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#454f60" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + +style "buttons" +{ + + font_name = "Sans 8" + + fg[NORMAL] = "#888888" + fg[PRELIGHT] = "#888888" + fg[ACTIVE] = "#888888" + fg[SELECTED] = "#888888" + fg[INSENSITIVE] = "#888888" + + bg[NORMAL] = "#27282F" + bg[PRELIGHT] = "#aaacc1" + bg[ACTIVE] = "#454f60" + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} +style "treeview" = "default" +{ + engine "pixmap" + { + # don't draw the focus around listitems + image + { + function = FOCUS + } + } +} +style "header" +{ + + GtkTreeView::odd_row_color = "#2c2c2c" + GtkTreeView::even_row_color = "#555555" + +} + +class "GtkButton" style "buttons" +class "GtkSpinButton" style "buttons" +class "GtkToggleButton" style "buttons" +class "GtkCheckBox" style "buttons" +widget_class "*Tree*" style "header" +class "GtkTreeView" style "treeview" +class "GtkLabel" style "text" +class "*List" style "text" +class "GtkListItem" style "text" +class "*GtkCList*" style "text" +class "GtkWidget" style "default" diff --git a/veejay-current/reloaded-gtk3/share/gveejay.reloaded.css b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.css new file mode 100644 index 00000000..14686470 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.css @@ -0,0 +1,16 @@ +.smallaspossible { + min-height: 0px; + min-width: 0px; +} + +.padplusfour { + padding-left: 4px; + padding-right: 4px; +} + +button { + color : #00ff00; + background-color : #ff00ff; + padding-left: 1px; + padding-right: 1px; +} diff --git a/veejay-current/reloaded-gtk3/share/gveejay.reloaded.glade b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.glade new file mode 100644 index 00000000..8ad1b878 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.glade @@ -0,0 +1,18487 @@ + + + + + + + 1 + 0.10000000000000001 + 0.01 + 0.10000000000000001 + + + False + False + Reloaded + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + 0 + + + False + 0 + + + True + False + + + True + True + False + False + + + + True + True + 0 + + + + + + + + True + True + False + Open advanced properties dialog + + + + True + False + gtk-preferences + + + + + False + False + 2 + + + + + + + True + False + <b>Video File</b> + True + + + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Open Veejay Liveset / Action file + + + + True + False + bg_red.png + + + + + False + False + 0 + + + + + True + True + False + Save Veejay Liveset / Actionfile + + + + True + False + bg_yellow.png + + + + + False + False + 1 + + + + + True + True + False + Cancel + + + + True + False + icon_disconnect.png + + + + + False + False + 2 + + + + + + + + + + + True + True + False + Play selected slot + + + + True + False + icon_send.png + + + + + False + False + 5 + + + + + + + + button119 + True + True + False + True + + + False + False + 7 + + + + + True + True + 1 + + + + + True + adjustment1 + 0 + False + + + + True + True + 2 + + + + + True + True + 0 + + + + + + + 255 + 96 + 1 + 10 + + + 255 + 86 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 10000 + 10 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 100 + 1 + 1 + + + 100 + 1 + 1 + + + 100 + 1 + 1 + + + 100 + 1 + 1 + + + 100 + 1 + + + 1000 + 1 + 1 + + + 1000 + 1 + 1 + + + 255 + 255 + 1 + 10 + + + 255 + 255 + 1 + 10 + + + 64 + 1 + 1 + 10 + + + False + Image Calibration + + + + True + False + vertical + + + True + False + start + 4 + Please select a source to calibrate + + + False + False + 0 + + + + + True + True + + + True + False + 0 + + + True + False + 12 + + + True + False + vertical + + + True + False + vertical + + + True + True + + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + Calibrate Stream + + + False + False + 1 + + + + + + + + + True + False + <b>Select a Source</b> + True + + + + + + + True + False + Source + + + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View DarkFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + False + + + 352 + 288 + True + True + + + True + False + + + True + False + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + 1 + + + + + True + False + Dark Frame + + + 1 + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View LightFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + False + + + True + True + + + True + False + + + True + False + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + 2 + + + + + True + False + Light Frame + + + 2 + False + + + + + True + False + + + True + False + vertical + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View FlatFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + 3 + + + + + True + False + Flat Frame + + + 3 + False + + + + + True + True + 1 + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + Frames + + + False + False + 0 + + + + + True + True + False + False + adjustment2 + 1 + + + False + True + 1 + + + + + + + + + True + False + <b>Duration</b> + True + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 8 + 8 + 8 + + + True + False + + + True + False + Method + + + False + False + 0 + + + + + True + False + + + True + False + 0 + 0 + + + True + False + 0 + 0 + 0 + 0 + + + True + False + vertical + + + Median + True + True + False + True + True + + + False + False + 0 + + + + + Average + True + True + True + True + False + True + True + True + cali_method_median + + + False + False + 1 + + + + + + + + + True + False + True + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + 0 + 0.43999999761581421 + 12 + + + True + False + vertical + + + True + False + + + True + True + False + False + adjustment3 + 1 + + + True + True + 0 + + + + + True + False + Kernel Size + + + False + False + 1 + + + + + True + True + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 1 + + + + + + + + + True + False + <b>Combine</b> + True + + + + + True + True + 0 + + + + + False + 0 + + + True + False + 12 + + + True + False + + + Stream + True + True + False + True + True + + + False + False + 0 + + + + + Global + True + True + False + True + True + radiobutton6 + + + False + False + 1 + + + + + + + + + True + False + <b>Run configuration</b> + True + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 0 + + + True + False + 0 + 0.0099999997764825821 + 133 + 132 + + + True + False + 58 + + + Reset + True + True + False + True + + + + False + False + 0 + + + + + Take Black Frames + True + True + False + True + + + + False + False + 1 + + + + + Save + True + False + True + False + True + + + + False + False + 2 + + + + + + + + + False + True + 8 + 2 + + + + + False + True + 2 + + + + + + + 255 + 255 + 1 + 10 + + + 255 + 1 + 10 + + + 9999999 + 1 + + + 1000000000 + 1 + + + 1000000000 + 1 + + + -25 + 25 + 1 + 1 + + + 1 + 12 + 1 + 1 + + + 100000000 + 1 + + + 100000000 + 1 + + + 100000000 + 1 + + + 19 + 1 + + + 999999 + 50 + 1 + + + 9999999 + 1 + + + 1 + 0.01 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 255 + 96 + 1 + 10 + + + 1 + 0.01 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 1 + 0.0099999997764800008 + 0.10000000000000001 + + + 248 + 96 + 1 + 10 + + + 255 + 146 + 1 + 10 + + + 255 + 201 + 1 + 10 + + + 255 + 146 + 1 + 10 + + + 255 + 255 + 1 + 10 + + + 255 + 96 + 1 + 10 + + + 255 + 96 + 1 + 10 + + + 255 + 86 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + 255 + 126 + 1 + 10 + + + + 13 + 1 + + + 255 + 201 + 1 + 10 + + + 9999999 + 1500 + 1 + 25 + + + 100 + 1 + + + 255 + 1 + 10 + + + 1 + 1 + 0.050000000000000003 + + + 1 + 100 + 25 + 1 + 10 + + + 1 + 65535 + 4490 + 1 + + + False + GVeejay Reloaded - New input stream + 500 + 400 + icon_stream.png + + + + 340 + True + False + 0 + + + True + False + 6 + vertical + + + True + False + vertical + + + True + True + True + + + True + True + + + True + True + Double click to active, single click column for changing settings + + + + + + + + + + True + False + <b>Video Capture Device</b> + True + + + + + False + False + 0 + + + + + True + True + + + True + False + 4 + 4 + + + Use multicast + True + True + False + True + True + + + 0 + 0 + + + + + True + False + Remote + + + 1 + 0 + + + + + True + False + Port Number + + + 1 + 1 + + + + + True + True + 200 + localhost + False + False + + + 2 + 0 + + + + + True + True + 4490 + False + False + adjustment75 + 1 + 4490 + + + 2 + 1 + + + + + Try + True + True + False + True + + + + 3 + 1 + + + + + + + + + + + + + True + False + <b>veejay-2-veejay via network</b> + True + + + + + False + True + 1 + + + + + True + True + + + True + False + 4 + 4 + + + use FFmpeg's AVFormat + True + True + True + True + inputstream_filey4m + + + 0 + 0 + + + + + True + False + URL or filename + + + 1 + 0 + + + + + True + True + False + False + + + 2 + 0 + + + + + True + False + Load Actionfile + + + + True + False + icon_open.png + + + + + 3 + 0 + + + + + use YUV4MPEG + True + False + True + True + + + 4 + 0 + + + + + Try + True + True + False + True + + + + 3 + 1 + + + + + + + + + + + + + + + + + + + True + False + <b>URL or filename</b> + True + + + + + False + True + 2 + + + + + False + True + 1 + + + + + True + True + True + False + Close this window + end + end + + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close + True + + + False + False + 1 + + + + + + + False + False + end + 1 + + + + + + + True + False + <b>Stream types</b> + True + + + + + + + 1024 + 65535 + 3490 + 1 + + + False + Reloaded - Connect to a veejay server + False + dialog + + + + + True + False + vertical + + + True + False + end + + + True + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_connect.png + + + False + False + 0 + + + + + True + False + _Connect + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + gtk-close + True + True + True + False + True + + + + False + False + 1 + + + + + False + False + end + 0 + + + + + True + False + vertical + + + True + False + veejay-logo-small.png + + + False + False + 0 + + + + + True + False + ver.3144 + + + False + False + 1 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + Hostname/IP address + right + + + 0 + 0 + + + + + True + False + Port + + + 1 + 0 + + + + + True + True + 6 + 3490 + False + False + adjustment76 + 1 + 3490 + + + 1 + 1 + + + + + True + True + 255 + localhost + False + False + + + + + 0 + 1 + + + + + + + + + True + False + <b>Connection</b> + True + + + + + False + True + 2 + + + + + False + True + 8 + 1 + + + + + False + 0.10000000149 + + + False + False + end + 2 + + + + + + veejay_connection_close + + + + 4096 + 1 + + + 4096 + 1 + + + 1 + 800 + 176 + 1 + + + 255 + 255 + 1 + 10 + + + 1 + 800 + 144 + 1 + + + 1 + 100 + 1 + 1 + + + 0.019999999553000001 + 1 + 0.019999999553000001 + 0.019999999553000001 + + + 4096 + 2 + 1 + + + 4096 + 1 + 1 + + + 4096 + 1 + 1 + + + 4096 + 1 + 1 + + + 16 + 1 + 10 + + + False + Preferences + False + dialog + + + + + True + False + vertical + + + True + False + end + + + gtk-close + True + True + True + False + True + + + + False + False + 0 + + + + + False + True + end + 5 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + vertical + + + True + False + 2 + 20 + + + True + False + 2 + 4 + 5 + 2 + True + + + True + False + Width + 0 + + + + + + + + + True + False + Image format + 0 + + + 2 + 1 + 2 + + + + + + + True + False + Height + 0 + + + 2 + 3 + + + + + + + True + True + 5 + False + False + adjustment77 + 1 + + + 1 + 2 + + + + + + + True + True + 5 + False + False + adjustment78 + 1 + + + 3 + 4 + + + + + + + True + True + Type extension to select image format (jpeg, png, ...) + 12 + 5 + jpeg + False + False + + + 2 + 4 + 1 + 2 + + + + + + + + + False + True + 0 + + + + + + + + + True + False + <b>Screenshot Dimensions</b> + True + + + + + True + True + 2 + 0 + + + + + False + False + 0 + + + True + False + 20 + 12 + + + True + False + 3 + 4 + 5 + 2 + True + + + True + False + Width: + 0 + + + + + + + + + True + False + Height: + 0 + + + 1 + 2 + + + + + + + True + True + 5 + False + False + adjustment79 + 1 + + + + 1 + 2 + + + + + + + True + True + 5 + False + False + adjustment80 + 1 + + + + 1 + 2 + 1 + 2 + + + + + + + False + Frame delay + 0 + + + 2 + 3 + + + + + + + True + False + False + adjustment81 + 1 + + + 3 + 4 + + + + + + + Keep 4:3 aspect + True + False + True + True + True + + + 2 + 4 + 1 + 2 + + + + + + + True + False + FPS + 0 + + + 2 + 3 + + + + + + + True + False + vertical + + + True + True + adjustment82 + 2 + False + + + + True + True + 0 + + + + + 1 + 3 + 2 + 3 + + + + + + + True + False + 0 + + + 3 + 4 + 2 + 3 + + + + + + + + + + + True + False + <b>Video preview</b> + True + + + + + True + True + 3 + 1 + + + + + True + False + 0 + + + True + False + 20 + 12 + + + True + False + vertical + + + True + False + 2 + 4 + 5 + 2 + True + + + True + False + Width: + 0 + + + + + + + + + True + False + Height: + 0 + + + 1 + 2 + + + + + + + True + False + X offset: + 0 + + + 2 + 3 + + + + + + + True + False + Y offset: + 0 + + + 2 + 3 + 1 + 2 + + + + + + + True + True + 5 + False + False + adjustment83 + 1 + + + + 1 + 2 + + + + + + + True + True + 5 + False + False + adjustment84 + 1 + + + + 1 + 2 + 1 + 2 + + + + + + + True + True + False + False + adjustment85 + 1 + + + 3 + 4 + + + + + + + True + True + False + False + adjustment86 + 1 + + + 3 + 4 + 1 + 2 + + + + + + + True + True + 8 + 0 + + + + + Keep 4:3 aspect + True + True + False + True + True + True + + + True + True + 2 + 1 + + + + + Fullscreen (CTRL-F = window) + True + True + False + True + True + + + + True + True + 2 + 2 + + + + + True + False + 10 + + + True + True + True + False + Apply changes to primary output settings + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-execute + + + False + False + 0 + + + + + True + False + Apply + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close SDL + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + True + True + 3 + + + + + + + + + True + False + <b>Primary Video Window (SDL)</b> + True + + + + + True + True + 2 + 2 + + + + + True + False + 13 + 0 + + + True + False + 12 + + + True + False + 4 + 4 + 4 + + + True + False + vloopback output device + 0 + + + + + True + True + ● + False + False + adjustment87 + + + 1 + 2 + + + + + True + True + True + True + Disable vloopback output video + + + + True + False + icon_disconnect.png + + + + + 3 + 4 + + + + + True + True + True + True + Enable vloopback output video + + + + True + False + icon_connect.png + + + + + 2 + 3 + + + + + + + + + True + False + <b>Video loopback settings</b> + True + + + + + True + True + 4 + 3 + + + + + + button117 + + + + 255 + 96 + 1 + 10 + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + False + GVeejay Reloaded - New input stream + 400 + 400 + icon_stream.png + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + vertical + + + True + True + + + True + True + False + True + + + + + + + + True + True + 0 + + + + + True + False + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + True + True + True + Close this window + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close + True + + + False + False + 1 + + + + + + + + + 3 + 4 + + + + + + + + + + False + False + 1 + + + + + + + + + True + False + <b>Generators</b> + True + + + + + + + True + False + gtk-clear + + + True + False + icon_color.png + + + True + False + icon_generator.png + + + True + False + gtk-network + + + True + False + icon_open.png + + + True + False + icon_stream.png + + + False + Reloaded + veejay-icon.png + + + True + False + vertical + + + True + False + + + True + False + _File + True + + + True + False + + + True + False + _Sample + True + + + True + False + + + _New from file + True + False + True + img_menu_open + False + + + + + + gtk-copy + True + False + True + True + + + + + + gtk-remove + True + False + True + True + + + + + + + + + + True + False + S_tream + True + + + True + False + + + N_ew stream + True + False + True + img_menu_stream + False + + + + + + _New Yuv4Mpeg + True + False + True + img_menu_network + False + + + + + + _New Solid + True + False + True + img_menu_color + False + + + + + + _New Generator + True + False + True + img_menu_exec + False + + + + + + gtk-remove + True + False + True + True + + + + + + + + + + True + False + _Midi + True + + + True + False + + + True + False + _Learn MIDI + True + + + + + + True + False + _MIDI enable + True + + + + + + _Clear MIDI layout + True + False + True + img_clear + False + + + + + + + + + + True + False + S_ave + True + + + True + False + + + True + False + _Save sample list + True + + + + + + True + False + Save _action file + True + + + + + + True + False + Save _MIDI layout + True + + + + + + + + + + True + False + _Load + True + + + True + False + + + True + False + Load _samplelist + True + + + + + + True + False + A_ppend samplelist + True + + + + + + True + False + Load _actionfile + True + + + + + + True + False + Load _MIDI layout + True + + + + + + True + False + Load _Calibration + True + + + + + + + + + + gtk-quit + True + False + True + True + + + + + + + + + + True + False + _Preferences + True + + + True + False + + + True + False + _Video Settings + True + + + + + + True + False + _Image Calibration + True + + + + + + True + False + VIMS _Bundles + True + + + + + + + + + + True + False + _Help + True + + + True + False + + + True + False + _Donate + True + + + + + + True + False + _About + True + + + + + + True + False + _Report a problem + True + + + + + + + + + + False + False + 0 + + + + + True + False + + + True + True + vjcontrols + + + True + False + vertical + + + True + False + 0 + + + True + False + vertical + + + True + False + + + True + True + False + Enable or disable selected FX + True + True + + + + + + + False + False + 0 + + + + + 36 + True + True + False + False + adjustment4 + 1 + + + + False + True + 1 + + + + + True + True + 15 + False + False + + + True + True + 2 + + + + + True + False + 20 + 0.10000000149011612 + + + True + True + 3 + + + + + True + True + False + True + + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_follow.png + + + + + False + False + 4 + + + + + True + True + 1 + + + + False + False + 5 + + + + + True + True + False + True + + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_render.png + + + + + False + False + 11 + 6 + + + + + False + True + 0 + + + + + 120 + True + False + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + center + vertical + adjustment5 + True + 0 + + + + + False + False + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p0</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment6 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p1</b> + True + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment7 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + center + center + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p2</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment8 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + False + 1 + + + + + + + True + False + <b>p3</b> + True + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment9 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p4</b> + True + + + + + True + True + 4 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment10 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p5</b> + True + + + + + True + True + 5 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment11 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + False + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p6</b> + True + + + + + True + True + 6 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment12 + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p7</b> + True + + + + + True + True + 7 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment13 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + center + center + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p8</b> + True + + + + + True + True + 8 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment14 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p9</b> + True + + + + + True + True + 9 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment15 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p10</b> + True + + + + + True + True + 10 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment16 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p11</b> + True + + + + + True + True + 11 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment17 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p12</b> + True + + + + + True + True + 12 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment18 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p13</b> + True + + + + + True + True + 13 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment19 + True + 0 + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + center + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + + False + False + 1 + + + + + + + True + False + <b>p14</b> + True + + + + + True + True + 14 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + False + 90 + 0 + 0.94999998807907104 + + + True + True + 0 + + + + + True + True + vertical + adjustment20 + True + 0 + 0 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + center + 4 + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + True + False + <b>p15</b> + True + + + + + True + True + 15 + + + + + True + True + 1 + + + + + True + True + + + True + False + vertical + + + True + False + + + Mixing effects + True + True + False + True + True + + + + False + False + 0 + + + + + Image effects + True + True + False + True + True + mixing_effects + + + + False + False + 1 + + + + + Alpha + True + True + False + True + True + mixing_effects + + + + False + False + 2 + + + + + + + + True + True + False + False + + + + True + True + 4 + + + + + False + True + 0 + + + + + True + False + False + False + + + True + True + + + True + True + + + + + + + + + + True + False + video effects + 270 + + + False + + + + + True + True + + + True + True + + + + + + + + 1 + + + + + True + False + image effects + 270 + + + 1 + False + + + + + True + True + + + True + True + + + + + + + + 2 + + + + + True + False + alpha effects + 270 + + + 2 + False + + + + + True + True + 1 + + + + + + + True + False + <b>FX list</b> + True + + + False + + + + + True + True + + + True + False + + + True + False + vertical + + + True + True + + + + + + True + True + 0 + + + + + True + False + vertical + + + + + + True + True + 1 + + + + + + + + + 1 + + + + + True + False + <b>Mixing Sources</b> + True + + + 1 + False + + + + + True + True + + + True + False + + + True + False + True + + + + + + + 2 + + + + + True + False + <b>Color Wheel</b> + True + + + 2 + False + + + + + True + True + 2 + + + + + + + True + False + <b>FX controls</b> + True + + + + + True + True + 0 + + + + + + + True + False + <b>FX</b> + True + + + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + vertical + + + True + False + + + FX Anim + True + True + True + Toggle keyframing for this chain entry + + + + False + True + 0 + + + + + True + False + + + True + False + <b>current control:</b> + True + + + False + False + 0 + + + + + True + False + P0 + 0 + + + True + False + 1 + + + + + True + True + False + Toggle keyframe animation for this parameter + + + + True + False + icon_keyframe.png + + + + + False + False + 2 + + + + + True + False + True + + + True + True + False + Apply this keyframe + + + + True + False + icon_apply.png + + + + + True + True + 0 + + + + + True + False + Start keyframing + + + + True + False + button_play.png + + + + + True + True + 1 + + + + + True + True + False + Reset + + + + True + False + icon_clearall.png + + + + + True + True + 2 + + + + + True + True + False + Clear selected parameter + + + + True + False + icon_clear.png + + + + + True + True + 3 + + + + + True + True + 3 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + 9 + + + None + True + True + False + half + True + 0.47999998927116394 + True + + + + + + + + + + 7 + True + True + False + True + True + kf_none + + + + 8 + 9 + + + + + + + 6 + True + True + False + True + True + kf_none + + + + 7 + 8 + + + + + + + 5 + True + True + False + True + True + kf_none + + + + 6 + 7 + + + + + + + 4 + True + True + False + True + True + kf_none + + + + 5 + 6 + + + + + + + 3 + True + True + False + True + True + kf_none + + + + 4 + 5 + + + + + + + 2 + True + True + False + True + True + kf_none + + + + 3 + 4 + + + + + + + 1 + True + True + False + True + True + kf_none + + + + 2 + 3 + + + + + + + 0 + True + True + False + True + True + kf_none + + + + 1 + 2 + + + + + + + True + True + 0 + + + + + True + False + 8 + + + + + + 8 + True + True + False + True + True + kf_none + + + + + + + + + 9 + True + True + False + True + True + kf_none + + + + 2 + 3 + + + + + + + 10 + True + True + False + True + True + kf_none + + + + 3 + 4 + + + + + + + 11 + True + True + False + True + True + kf_none + + + + 4 + 5 + + + + + + + 12 + True + True + False + True + True + kf_none + + + + 5 + 6 + + + + + + + 13 + True + True + False + True + True + kf_none + + + + 6 + 7 + + + + + + + 14 + True + True + False + True + True + kf_none + + + + 7 + 8 + + + + + + + 15 + True + True + False + True + True + kf_none + + + + 8 + 9 + + + + + + + True + False + 1 + + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + 0 + + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + Linear + True + True + False + True + True + + + + False + False + 0 + + + + + Spline + True + True + False + True + True + curve_typelinear + + + + False + False + 1 + + + + + Freehand + True + True + False + True + True + curve_typelinear + + + + False + False + 2 + + + + + + + True + False + <b>Curve drawing method</b> + True + + + + + False + True + 2 + + + + + True + False + 0 + + + True + False + 2 + 5 + + + + + + + + + True + False + startframe + 0 + + + + + + + + + True + True + False + False + adjustment21 + 1 + + + + 1 + 2 + + + + + + True + False + endframe + 0 + + + 2 + 3 + + + + + + + True + True + False + False + adjustment22 + 1 + + + + 3 + 4 + + + + + + True + False + 00:00:00:00 + 0 + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + False + 00:00:00:00 + 0 + 0 + 0.49000000953674316 + + + 3 + 4 + 1 + 2 + + + + + + + True + False + Update start/end + + + + True + False + icon_refresh.png + + + + + 4 + 5 + 1 + 2 + + + + + + + + + + + + True + False + <b>timeline</b> + True + + + + + False + True + 3 + + + + + 1 + + + + + True + False + <b>FX Anim</b> + True + + + 1 + False + + + + + True + False + 0 + + + True + False + 4 + + + True + False + 0 + + + True + False + + + True + False + vertical + + + True + False + + + True + False + + + Play and repeat sample grid + True + True + False + True + True + + + + False + False + 0 + + + + + True + True + True + Clear all sequencer slots + + + + True + False + + + True + False + icon_clearall.png + + + False + False + 0 + + + + + + + True + False + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Play and record this sequence to a new sample + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_record.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + Stop recording from this sequence + + + + True + False + icon_recordstop.png + + + + + False + False + 1 + + + + + True + False + 30 + + + True + False + 0.10000000149 + + + + + True + True + 2 + + + + + + + + + True + False + <b>SEQ record to new sample</b> + True + + + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + 0 + + + True + False + + + True + False + + + + + + + + + + True + True + 1 + + + + + True + False + Click an empty slot to place current selected sample. + SHIFT-Click a slot to remove the sample. + + + False + False + 2 + + + + + + + + + True + False + <b>Sample Grid</b> + True + + + + + + + + + 2 + + + + + True + False + <b>SEQ</b> + True + + + 2 + False + + + + + True + False + vertical + + + True + False + + + True + False + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_connect.png + + + False + False + 0 + + + + + True + False + Add Track + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_disconnect.png + + + False + False + 0 + + + + + True + False + Close Track + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + False + True + 0 + + + + + False + False + 0 + + + + + True + False + + + + + + + + + True + True + 1 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_gotostart.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_reverse.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_pause.png + + + + + False + False + 2 + + + + + True + True + False + + + + True + False + button_play.png + + + + + False + False + 3 + + + + + True + True + False + + + + True + False + button_skip.png + + + + + False + False + 4 + + + + + False + True + 0 + + + + + True + False + + + True + True + False + + + + True + False + button_gotoend.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_dec.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_inc.png + + + + + False + False + 2 + + + + + True + True + False + + + + True + False + button_prev.png + + + + + False + False + 3 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + + + + + True + False + <b>Sync controls</b> + True + + + + + True + True + 0 + + + + + True + True + False + sync start! + + + + True + False + sync.png + + + + + False + False + 1 + + + + + False + True + 2 + + + + + 3 + + + + + True + False + <b>MT</b> + True + + + 3 + False + + + + + True + True + + + True + False + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + True + False + vertical + + + True + False + 12 + + + True + False + + + True + True + False + New SRT Sequence + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_text.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + 25 + True + False + + + + + 0 + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 6 + 12 + + + True + False + + + True + False + True + + + True + True + False + Delete this SRT Sequence + + + + True + False + button_skull.png + + + + + True + True + 0 + + + + + True + True + False + Apply Text and Start/End position + + + + True + False + icon_apply.png + + + + + True + True + 1 + + + + + True + True + False + Load SRT file + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + True + True + 2 + + + + + True + True + False + Save SRT file + + + + True + False + icon_save.png + + + + + True + True + 3 + + + + + False + True + 0 + + + + + + + + + False + False + end + 1 + + + + + + + True + False + Select a SRT sequence or create new + True + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 12 + + + True + True + + + True + True + + + + + + + + + True + False + Edit subtitle + + + + + True + True + 3 + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + + + True + False + Start + + + False + False + 0 + + + + + True + False + + + 75 + True + True + False + False + adjustment23 + 1 + + + + False + True + 0 + + + + + True + False + 00:00:00:00 + 0 + + + False + False + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + End + + + False + False + 0 + + + + + True + False + + + 75 + True + True + False + False + adjustment24 + 1 + + + + False + True + 0 + + + + + True + False + 00:00:00:00 + 0 + + + False + False + 1 + + + + + True + True + 1 + + + + + + + True + True + 1 + + + + + + + + + True + False + Change frame start and frame end position + True + + + + + False + True + 5 + 1 + + + + + True + False + 0 + + + True + False + 6 + 12 + + + True + False + + + 100 + True + False + 0 + + + True + False + + + + + 0 + + + + + + + True + False + Font face + + + + + True + True + 0 + + + + + True + False + 0 + + + True + True + False + False + adjustment25 + 1 + + + + + + True + False + Size + + + + + False + False + 1 + + + + + True + False + 0 + + + True + False + vertical + + + True + False + + + True + False + <b>X</b> + True + + + False + False + 0 + + + + + True + True + False + False + adjustment26 + 1 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + <b>Y</b> + True + + + False + False + 0 + + + + + True + True + False + False + adjustment27 + 1 + + + + True + True + 1 + + + + + True + True + 1 + + + + + + + True + False + Position + + + + + False + False + 2 + + + + + + + + + True + False + Change font face, size and position + True + + + + + False + True + 5 + 2 + + + + + True + False + 0 + + + True + False + 0 + + + True + False + 5 + 12 + + + True + False + 0 + + + True + False + vertical + + + True + False + + + Outline + True + True + False + True + True + + + + False + False + 0 + + + + + Border + True + True + False + True + True + + + + False + False + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + True + False + Set this foreground color + + + + 24 + 24 + True + False + + + + + + + FG + True + True + False + Foreground color + True + True + True + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + True + False + Set this background color + + + + 24 + 24 + True + False + + + + + + + BG + True + True + False + Background color + True + True + textcolorfg + + + + + + True + True + 1 + + + + + True + False + 0 + + + True + True + False + Set this line color + + + + 24 + 24 + True + False + + + + + + + LC + True + True + False + Line color + True + True + textcolorfg + + + + + + True + True + 2 + + + + + False + True + 1 + + + + + True + False + 17 + 4 + 4 + + + True + False + 4 + 5 + + + + + + 24 + 24 + True + False + + + 1 + 2 + + + + + + 24 + 24 + True + False + + + 1 + 2 + 1 + 2 + + + + + + + 24 + 24 + True + False + + + 1 + 2 + 2 + 3 + + + + + + + 100 + True + True + adjustment28 + 0 + + + + 2 + 5 + + + + + + 100 + True + True + adjustment29 + 0 + + + + 2 + 5 + 1 + 2 + + + + + + + 100 + True + True + adjustment30 + 0 + + + + 2 + 5 + 2 + 3 + + + + + + + 100 + True + True + adjustment31 + 0 + + + + 2 + 5 + 3 + 4 + + + + + + + True + False + <b>R</b> + True + 0 + + + + + 4 + + + + + True + False + <b>G</b> + True + 0 + + + 1 + 2 + + + 4 + + + + + True + False + <b>B</b> + True + 0 + + + 2 + 3 + + + 4 + + + + + True + False + <b>A</b> + True + 0 + + + 3 + 4 + + + 4 + + + + + + + True + True + 2 + + + + + + + + + + + True + False + Change foreground,background and linecolor + True + + + + + + + False + True + 3 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + + + + + 4 + + + + + True + False + <b>SRT</b> + True + + + 4 + False + + + + + True + False + False + False + + + True + False + vertical + + + True + False + vertical + 2 + + + True + False + vertical + + + True + False + + + True + False + 00:00:00:00 + + + False + True + 0 + + + + + True + True + False + Enable/disable effectchain + True + True + + + + True + False + Effect chain enabled + + + + + False + True + end + 1 + + + + + False + False + 0 + + + + + False + True + 0 + + + + + False + True + 0 + + + + + True + True + + + True + False + vertical + + + True + False + 6 + + + True + False + vertical + + + True + False + 0 + + + True + False + 12 + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + 00:00:00:00 + 0 + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + + + Loops + True + True + False + True + True + + + + False + False + 0 + + + + + Frames + True + True + False + True + True + True + sample_mulloop + + + + False + False + 1 + + + + + + + + + True + True + 1 + + + + + + + + + + + + + True + False + <b>Timecode</b> + True + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + True + False + False + adjustment32 + 1 + + + + + + True + False + <b>Duration</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + + 0 + + + + + + + True + False + <b>Codec</b> + True + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + True + False + Start recording + + + + True + False + icon_record.png + + + + + False + True + 0 + + + + + True + True + False + Cancel recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 0 + + + + + Autoplay + True + True + False + Auto play sample after recording + True + True + + + False + False + 1 + + + + + False + True + 2 + + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 0.10000000149 + + + + + True + False + <b>Recording Progress</b> + True + + + + + False + True + 1 + + + + + + + True + False + <b>Record to Disk</b> + True + + + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 15 + 12 + 51 + + + True + False + + + True + True + Untitled + False + False + + + False + False + 0 + + + + + Change title + True + True + False + True + + + + False + True + 1 + + + + + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + vertical + + + True + False + 12 + + + True + False + + + True + False + vertical + + + True + False + Start position + False + 0 + + + False + False + 8 + 0 + + + + + True + False + End position + 0 + + + False + False + 1 + + + + + True + False + Playback speed + 0 + + + False + False + 8 + 2 + + + + + True + False + Slow motion multiplier + 0 + + + False + False + 3 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + False + False + adjustment33 + 1 + + + + False + False + 0 + + + + + True + True + False + False + adjustment34 + 1 + + + + False + False + 1 + + + + + True + True + False + False + adjustment35 + 1 + + + + False + False + 2 + + + + + True + True + False + False + adjustment36 + 1 + + + + False + False + 3 + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + + + True + False + True + + + + + False + False + 1 + + + + + 1 + + + + + True + False + <b>Properties</b> + True + + + 1 + False + + + + + True + False + vertical + + + True + True + + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Create sample from selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_new.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Save EditList + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_save.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Save Selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_saveas.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + Add Videofiles to EditList + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + False + False + 3 + + + + + False + False + 1 + + + + + True + False + 2 + 3 + + + True + False + 0000000000 + 12 + + + 1 + 2 + 1 + 2 + + + + + + True + False + Positon + 0 + + + + + + + + True + False + Total frames + 0 + + + 1 + 2 + + + + + + True + False + 000000000000 + 10 + 0 + + + 1 + 2 + + + + + + + True + False + 0:00:00:00 + 11 + 0 + + + 2 + 3 + + + + + + + True + False + 0:00:00:00 + 11 + 0 + + + 2 + 3 + 1 + 2 + + + + + + + False + True + 2 + + + + + True + False + 3 + 2 + 5 + + + True + False + <i>Starting position</i> + True + 0 + + + 1 + 2 + + + + + + True + False + <i>Duration:</i> + True + 0 + + + + + + + + True + False + <i>Ending position:</i> + True + 0 + + + 2 + 3 + + + + + + True + False + 10 + 0:00:00:00 + 10 + 0 + 0 + + + 1 + 2 + + + + + + True + False + 10 + 0:00:00:00 + 10 + 0 + + + 1 + 2 + 1 + 2 + + + + + + True + False + 10 + 0:00:00:00 + 10 + 0 + + + 1 + 2 + 2 + 3 + + + + + + False + True + 3 + + + + + True + False + 2 + 2 + + + True + True + False + False + adjustment37 + 1 + + + + 1 + 2 + 1 + 2 + + + + + True + True + False + False + adjustment38 + 1 + + + + 1 + 2 + + + + + Set start + True + True + False + Take current position as starting position + True + + + + + + + + + + Set end + True + True + False + Take current position as ending position + True + + + + 1 + 2 + + + + + + + False + True + 4 + + + + + True + False + + + True + True + False + Cut selection to buffer + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_cut.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Copy selection to buffer + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_copy.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Paste from buffer into editlist at current position + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_paste.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + Delete selection (without buffer) + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_trash.png + + + False + False + 0 + + + + + + + + + False + False + 3 + + + + + True + True + False + Crop to selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_crop.png + + + False + False + 0 + + + + + + + + + False + False + 4 + + + + + True + True + Paste at this position + False + False + adjustment39 + 1 + + + True + True + 5 + + + + + True + True + False + Paste buffer at position + + + + True + False + icon_paste.png + + + + + False + False + 6 + + + + + False + True + 5 + + + + + 2 + + + + + True + False + <b>EditList</b> + True + + + 2 + False + + + + + True + True + 1 + + + + + + + True + False + Sample + + + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + + + True + False + 0 + + + True + False + + + True + False + Frames: + + + False + False + 0 + + + + + True + True + False + False + adjustment40 + 1 + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + 00:00:00:00 + 10 + + + False + False + 0 + + + + + Effect chain enabled + True + True + False + True + True + True + + + + False + False + 1 + + + + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + 0 + + + True + False + 0:00:00 + 8 + 0 + + + + + True + False + <b>Timecode</b> + True + + + + + False + True + 2 + 0 + + + + + True + False + + + True + False + 0 + + + True + True + ● + False + False + adjustment41 + 1 + + + + + + True + False + <b>Duration</b> + True + + + + + True + True + 2 + 0 + + + + + True + False + 0 + + + 120 + True + False + + + + 0 + + + + + + + True + False + <b>Codec</b> + True + + + + + True + True + 2 + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + True + True + True + Start recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_record.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + True + True + Cancel recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 0 + + + + + True + True + False + True + + + True + False + Autoplay + + + + + False + False + 1 + + + + + False + True + 2 + + + + + False + False + 1 + + + + + True + True + False + + + True + False + vertical + + + True + False + 0 + + + True + False + vertical + + + True + False + <b>Camera Controls</b> + True + 0 + + + False + False + 0 + + + + + True + True + + + True + False + + + True + False + True + + + True + False + end + 6 + Brightness + + + 0 + 0 + + + + + True + False + end + 6 + Contrast + + + 0 + 1 + + + + + True + False + end + 6 + Hue + + + 0 + 2 + + + + + True + False + end + 6 + Saturation + + + 0 + 3 + + + + + True + False + end + 6 + Gamma + + + 0 + 4 + + + + + True + False + end + 6 + Gain + + + 0 + 5 + + + + + True + False + end + 6 + Red Balance + + + 0 + 6 + + + + + True + False + end + 6 + Blue Balance + + + 0 + 7 + + + + + True + False + end + 6 + Green Balance + + + 0 + 8 + + + + + True + False + end + 6 + Auto White Balance + + + 0 + 9 + + + + + True + False + end + 6 + Sharpness + + + 0 + 10 + + + + + True + False + end + 6 + Backlight Compensation + + + 0 + 11 + + + + + True + False + end + 6 + Auto Gain + + + 0 + 12 + + + + + True + False + end + 6 + Auto Hue + + + 0 + 13 + + + + + True + False + end + 6 + Temperature + + + 0 + 14 + + + + + True + False + end + 6 + Horizontal Flip + + + 0 + 15 + + + + + True + False + end + 6 + Vertical Flip + + + 0 + 16 + + + + + True + False + end + 6 + Exposure + + + 0 + 17 + + + + + True + False + end + 6 + Black Level + + + 0 + 18 + + + + + True + False + end + 6 + Whiteness + + + 0 + 19 + + + + + True + True + adjustment44 + 2 + 2 + + + + 1 + 0 + + + + + True + True + adjustment43 + 2 + 2 + + + + 1 + 1 + + + + + True + True + adjustment45 + 2 + 2 + + + + 1 + 2 + + + + + True + True + adjustment46 + 2 + 2 + + + + 1 + 3 + + + + + True + True + adjustment42 + 2 + 2 + + + + 1 + 4 + + + + + True + True + adjustment47 + 2 + 2 + + + + 1 + 5 + + + + + True + True + adjustment48 + 2 + 2 + + + + 1 + 6 + + + + + True + True + adjustment49 + 2 + 2 + + + + 1 + 7 + + + + + True + True + adjustment50 + 2 + 2 + + + + 1 + 8 + + + + + Enabled + True + True + False + True + + + + 1 + 9 + + + + + True + True + adjustment51 + 2 + 2 + + + + 1 + 10 + + + + + True + True + adjustment52 + 2 + 2 + + + + 1 + 11 + + + + + Enabled + True + True + False + True + + + + 1 + 12 + + + + + Enabled + True + True + False + True + + + + 1 + 13 + + + + + True + True + adjustment53 + 2 + 2 + + + + 1 + 14 + + + + + Enabled + True + True + False + True + + + + 1 + 15 + + + + + Enabled + True + True + False + True + + + + 1 + 16 + + + + + True + True + adjustment56 + 2 + 2 + + + + 1 + 17 + + + + + True + True + adjustment54 + 2 + 2 + + + + 1 + 18 + + + + + True + True + adjustment55 + 2 + 2 + + + + 1 + 19 + + + + + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + + + True + False + <b>Video Device</b> + True + + + False + + + + + True + False + True + + + 1 + + + + + True + False + <b>Solid Stream</b> + True + + + 1 + False + + + + + True + True + 2 + + + + + False + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment57 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p0</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment58 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p1</b> + True + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment59 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p2</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment60 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p3</b> + True + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment61 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p4</b> + True + + + + + True + True + 4 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + False + + + True + True + vertical + adjustment62 + True + 0 + 0 + + + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p5</b> + True + + + + + True + True + 5 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment63 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p6</b> + True + + + + + True + True + 6 + + + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment64 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p7</b> + True + + + + + True + True + 7 + + + + + True + False + vertical + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment65 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p8</b> + True + + + + + True + True + 0 + + + + + True + True + 8 + + + + + True + False + + + True + False + 0 + + + True + False + False + vertical + + + True + True + vertical + adjustment66 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p9</b> + True + + + + + True + True + 0 + + + + + True + True + 9 + + + + + True + False + + + True + False + 0 + + + True + False + vertical + + + True + False + True + vertical + adjustment67 + True + 0 + 0 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p10</b> + True + + + + + True + True + 0 + + + + + True + True + 10 + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 0 + + + True + False + 0.10000000149 + + + + + + + + + True + False + <b>Recording progress</b> + True + + + + + False + True + 4 + + + + + 1 + + + + + True + False + Stream + + + 1 + False + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 7 + 2 + True + + + True + False + Interlacing + 0 + + + 2 + 3 + + + + + + + True + False + Top First + 0 + + + 1 + 2 + 2 + 3 + + + + + + + True + False + Norm + 0 + 0 + + + 3 + 4 + + + + + + + True + False + PAL + 0 + 0 + + + 1 + 2 + 3 + 4 + + + + + + + True + False + Audio bits + 0 + + + 4 + 5 + + + + + + + True + False + 16 + 0 + + + 1 + 2 + 4 + 5 + + + + + + + True + False + Audio Channels + 0 + + + 5 + 6 + + + + + + + True + False + 2 + 0 + + + 1 + 2 + 5 + 6 + + + + + + + True + False + Audio rate + 0 + + + 6 + 7 + + + + + + + True + False + 44000 + 0 + + + 1 + 2 + 6 + 7 + + + + + + + True + False + Resolution + 0 + + + + + + + + True + False + 25 + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + False + 352x288 + 0 + + + 1 + 2 + + + + + + + True + False + FPS + 0 + + + 1 + 2 + + + + + + + + + + + 2 + + + + + True + False + Plain + + + 2 + False + + + + + 5 + + + + + True + False + <b>Sample</b> + True + + + 5 + False + + + + + True + False + vertical + + + True + False + + + True + False + 3 + 2 + + + True + False + 0 + 0 + Frame position + 0 + 0.5 + + + GTK_FILL + + + + + + True + False + 0 + 0 + Dup position + 0 + 0.5 + + + 1 + 2 + GTK_FILL + + + + + + True + False + 0 + 0 + Loop position + 0 + 0.5 + + + 2 + 3 + GTK_FILL + + + + + + True + True + 1 + + + + 1 + 2 + + + + + + True + True + 1 + + + + 1 + 2 + 1 + 2 + + + + + + True + True + 1 + + + 1 + 2 + 2 + 3 + + + + + + True + True + 0 + + + + + True + False + 3 + 3 + + + + + + + + + + + + + + + + + + True + False + 0 + 0 + VIMS message + 0 + 0.5 + + + GTK_FILL + + + + + + True + True + ● + + + 1 + 2 + + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_save.png + + + False + False + 0 + + + + + True + False + 0 + 0 + True + 0.5 + 0.5 + + + False + False + 1 + + + + + + + + + 2 + 3 + GTK_FILL + + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_clear.png + + + False + False + 0 + + + + + + + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + True + always + always + in + + + True + True + + + + + + + + True + True + 1 + + + + + True + False + 8 + + + + + + + + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_macroclear.png + + + False + False + 0 + + + + + + + + + 7 + 8 + GTK_FILL + + + + + + True + False + 0 + 0 + Bank + 0 + 0.5 + + + GTK_FILL + + + + + + True + True + 1 + + + + 1 + 2 + GTK_FILL + + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_launch.png + + + False + False + 0 + + + + + + + + + 6 + 7 + GTK_FILL + + 16 + + + + + True + True + False + + + + True + False + 0.5 + 0.5 + 0 + 0 + icon_clear.png + + + + + 2 + 3 + GTK_FILL + + 16 + + + + + False + True + 2 + + + + + 6 + + + + + True + False + <b>Event Record/Playback</b> + True + + + 6 + False + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + True + False + + + + + True + False + + + True + False + + + True + False + + + liveview on/off + True + True + False + True + True + + + + False + False + 0 + + + + + gray + True + True + False + True + True + + + + False + False + 1 + + + + + True + False + + + 1/8 + True + True + False + Very low quality preview + True + + + + False + False + 0 + + + + + 1/4 + True + True + False + Low quality preview + True + + + + False + False + 1 + + + + + 1/2 + True + True + False + Medium quality preview + True + + + + False + False + 2 + + + + + 1/1 + True + True + False + High quality preview + True + + + + False + False + 3 + + + + + True + False + 0 + none + + + Feedback + True + True + False + 2 + True + True + + + + + + True + True + 4 + + + + + False + True + 3 + 2 + + + + + False + True + 0 + + + + + True + False + + + Alpha Clear + True + True + False + True + Fills the alpha channel every frame period when enabled + True + True + + + + True + True + 0 + + + + + True + True + True + True + Alpha 255 + + + + True + False + icon_255.png + + + + + False + False + 1 + + + + + True + True + True + True + Enable or disable Alpha Transition + + + + True + False + Enable Chain Fader alpha method + icon_alpha.png + + + + + False + False + 2 + + + + + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + + + False + False + 0 + + + + + False + False + 0 + + + + + True + False + vertical + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + True + False + + + True + False + veejay-logo.png + + + + + + + True + True + 0 + + + + + True + False + + + True + False + vertical + + + True + False + 2 + 6 + True + + + True + False + Length: + 0 + + + + + + + + True + False + Sample + 7 + 0 + + + 1 + 2 + + + + + + True + False + 0:00:00:00 + 12 + 0 + + + 1 + 2 + + + + + + True + False + 00000 + 5 + 0 + + + 1 + 2 + 1 + 2 + + + + + + True + False + Time: + 0 + + + 2 + 3 + + + + + + True + False + Frame: + 0 + + + 2 + 3 + 1 + 2 + + + + + + True + False + 0:00:00:00 + 12 + 0 + + + 3 + 4 + + + + + + True + False + 00000000 + 12 + 0 + + + 3 + 4 + 1 + 2 + + + + + + True + False + M: + 0 + + + 4 + 5 + + + + + + True + False + 00:00:00:00 + 12 + 0 + + + 5 + 6 + + + + + + True + False + + + True + False + 0 + 0 + Loop: + 0.5 + 0.5 + + + False + False + 0 + + + + + True + False + 0 + 0 + 0 + 0.5 + 0.5 + + + False + False + 4 + 1 + + + + + True + False + 0 + 0 + 1 + 0.5 + 0.5 + + + False + False + 8 + 2 + + + + + 4 + 5 + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + False + hint + 0 + + + 5 + 6 + 1 + 2 + + + + + + True + True + 0 + + + + + False + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + + + + True + True + 0 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + True + + + True + True + False + + + + True + False + button_gotostart.png + + + + + True + True + 0 + + + + + True + True + False + + + + True + False + button_fbw.png + + + + + True + True + 1 + + + + + True + True + False + + + + True + False + button_reverse.png + + + + + True + True + 2 + + + + + True + True + False + + + + True + False + button_pause.png + + + + + True + True + 3 + + + + + True + True + False + + + + True + False + button_play.png + + + + + True + True + 4 + + + + + True + True + False + + + + True + False + button_ffw.png + + + + + True + True + 5 + + + + + True + True + False + + + + True + False + button_gotoend.png + + + + + True + True + 6 + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + + + True + False + True + + + True + True + False + + + + True + False + button_prev.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_skip.png + + + + + False + False + 1 + + + + + + + False + False + 0 + + + + + True + False + + + True + False + + + True + False + 12 + + + True + False + + + True + False + + + True + True + False + Change Playback Mode + + + + True + False + icon_playmode.png + + + + + False + False + 0 + + + + + [... + True + True + False + Mark current position as start of a new sample + True + + + + False + False + 1 + + + + + ...] + True + True + False + Mark current position as sample end and create new sample + True + + + + False + False + 2 + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Toggle Bezerk Mode + + + + True + False + icon_berserk.png + + + + + False + False + 0 + + + + + True + True + False + Take Background Mask(diff overlay) + + + + True + False + icon_mask.png + + + + + False + False + 1 + + + + + True + True + 1 + + + + + True + True + True + True + Enable Multicast frame sender + + + + True + False + multicast.ico + + + + + False + False + 2 + + + + + + + False + True + end + 0 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Normal Loop + True + True + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_loop.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Bounce + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_bounce.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + + + + True + True + False + True + Play once and then pause the video + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 3 + button_looponce.png + + + False + False + 0 + + + + + + + + + True + True + 3 + + + + + True + True + False + True + Play once and keep playing last frame + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 3 + icon_looponcenop.png + + + False + False + 0 + + + + + + + + + True + True + 4 + + + + + True + True + False + True + Random Frame + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_rand.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + + + + + True + True + 0 + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + + + 50 + True + True + adjustment68 + 0 + + + + True + True + 0 + + + + + 50 + True + True + adjustment69 + 0 + + + + True + True + 1 + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + True + + + True + False + vertical + + + True + False + vertical + + + True + False + + + True + False + + + True + True + Offline recording duration in frames + False + ● + 5 + False + False + adjustment70 + 1 + True + + + False + True + 0 + + + + + True + True + True + True + Start recording + + + + True + False + Start offline recorder + icon_record.png + + + + + False + False + 1 + + + + + True + True + True + True + Cancel offline recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + True + Auto play sample after recording has completed + True + True + + + True + False + 3 + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_back.png + + + + + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + Active bank: + + + False + False + 0 + + + + + True + True + False + False + adjustment71 + 1 + + + + True + True + 1 + + + + + + + + + True + False + 0 + + + + + + + + + False + True + 2 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_next.png + + + + + + + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + + + True + False + + + + + + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + True + False + <b>Samplebank</b> + True + + + False + + + + + True + False + vertical + + + True + False + 0 + + + True + False + + + True + False + vertical + + + True + True + + + True + True + + + + + + + + True + True + 1 + 0 + + + + + True + False + + + True + True + True + True + Create bundle + + + + True + False + icon_bundle.png + + + + + False + False + 0 + + + + + True + True + True + True + Clear Entry + + + + True + False + icon_clear.png + + + + + False + False + 1 + + + + + True + True + True + True + Cut entry + + + + True + False + icon_cut.png + + + + + False + False + 2 + + + + + True + True + True + True + Copy entry + + + + True + False + icon_copy.png + + + + + False + False + 3 + + + + + True + True + True + True + Paste entry + + + + True + False + icon_paste.png + + + + + False + False + 4 + + + + + True + True + True + True + Toggle rendering of FX chain on mixing sources + + + + True + False + icon_render.png + + + + + False + False + 5 + + + + + True + True + True + True + Clear Chain + + + + True + False + icon_clearall.png + + + + + False + False + 20 + 6 + + + + + True + True + True + True + Toggle keyframing for this chain entry + + + + True + False + icon_keyframe.png + + + + + False + False + 7 + + + + + + + + + + + + + + True + False + FX entry + + + True + True + 11 + + + + + True + False + 1 + + + True + True + 4 + 12 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + False + True + From original source to completed FX chain + True + fx_m1 + + + + True + False + icon_fxmnone.png + + + + + False + False + 0 + + + + + True + True + False + True + From selected FX entry (before FX) to completed FX chain + half + True + + + + True + False + icon_fxm1.png + + + + + False + False + 1 + + + + + True + True + False + True + From selected FX entry (after FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm2.png + + + + + False + False + 2 + + + + + True + True + False + True + From mixing source of selected FX entry (before FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm4.png + + + + + False + False + 3 + + + + + True + True + False + True + From mixing source of selected FX entry (after FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm3.png + + + + + False + False + 4 + + + + + False + True + 1 + + + + + True + False + vertical + + + True + False + vertical + + + True + False + + + True + True + True + True + Fade in FX Chain + + + + True + False + icon_fadein.png + + + + + False + False + 4 + 0 + + + + + True + True + True + True + Fade Out FX Chain + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_fadeout.png + + + False + False + 0 + + + + + + + + + False + False + 4 + 1 + + + + + False + False + 0 + + + + + False + True + 0 + + + + + 82 + True + True + vertical + adjustment72 + True + False + + + + True + True + 1 + + + + + + + + True + True + False + True + Switch to sample #B after completing fade. + True + + + + True + False + icon_follow.png + + + + + False + False + 3 + + + + + True + False + + + True + True + True + FX Chain fade duration in frames + ● + False + False + adjustment73 + 1 + + + + False + True + 0 + + + + + True + True + True + True + Return to previous sample + 0 + 0 + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_bounce.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + False + True + 4 + + + + + False + True + 2 + + + + + + + True + True + 0 + + + + + 1 + + + + + True + False + <b>FX Chain</b> + True + + + 1 + False + + + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Take Screenshot + + + + True + False + icon_screenshot.png + + + + + False + False + 0 + + + + + + + + True + False + localhost:3490 + + + + True + False + icon_connect.png + + + + + False + False + 2 + + + + + True + False + Disconnect + + + + True + False + icon_disconnect.png + + + + + False + False + 3 + + + + + True + True + False + Display Debug + + + + True + False + icon_bug.png + + + + + False + False + 4 + + + + + True + True + False + Enable jack + + + + True + False + icon_jack.png + + + + + False + False + 5 + + + + + True + True + False + Display OSD status + + + + True + False + icon_osd.png + + + + + False + False + 6 + + + + + True + True + False + Enable/Disable EDL Cache (see veejay console) + + + + True + False + icon_cache.png + + + + + False + False + 7 + + + + + Sync + True + True + False + Drop audio/video frames and keep in sync (by default enabled) + True + True + + + + False + False + 8 + + + + + True + False + + + True + False + 6 + shm in + + + False + False + 0 + + + + + True + False + + + 3490 + True + True + False + Create new input from veejay on port 3490 + True + + + + False + False + 0 + + + + + 4490 + True + True + False + Create new input from veejay on port 4490 + True + + + + False + False + 1 + + + + + 5490 + True + True + False + Create new input from veejay on port 5490 + True + + + + False + False + 2 + + + + + 6490 + True + True + False + Create new input from veejay on port 6490 + True + + + + False + False + 3 + + + + + 7490 + True + True + False + Create new input from veejay on port 7490 + True + + + + False + False + 4 + + + + + True + True + 1 + + + + + False + False + 9 + + + + + + + + + True + False + <b>Actions</b> + True + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + vertical + + + True + True + + + 150 + True + True + + + + + True + True + 0 + + + + + True + False + + + True + True + False + False + + + + True + True + 3 + 0 + + + + + True + True + False + Send VIMS to veejay + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_send.png + + + False + False + 0 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + + + _Clear + True + True + False + True + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_gotostart.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_gotoend.png + + + + + False + False + 2 + + + + + repeat + True + True + False + True + + + False + False + 3 + + + + + False + True + 2 + + + + + + + True + False + <b>VIMS messenger</b> + True + + + + + True + True + 1 + + + + + True + True + 0 + + + + + 2 + + + + + True + False + <b>Veejay</b> + True + + + 2 + False + + + + + True + False + vertical + + + True + False + vertical + + + True + False + 0 + + + True + False + + + True + False + + + True + False + vertical + + + True + True + False + Refresh Veejay's Working Directory + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + + + True + False + icon_open.png + + + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + + + + False + False + 0 + + + + + True + True + + + True + True + False + True + + + + + + + + True + True + 1 + + + + + + + + + True + True + 0 + + + + + True + False + Listing of Veejay's working directory. Doube click a row to add it as a Sample + + + False + False + 1 + + + + + True + True + 0 + + + + + 3 + + + + + True + False + <b>Media</b> + True + + + 3 + False + + + + + True + True + 0 + + + + + True + False + vertical + + + True + True + False + Add a video or image file as a new sample + + + + True + False + icon_open.png + + + + + False + False + 0 + + + + + True + True + False + Create a new stream (v4l, dv, network ...) + + + + True + False + icon_stream.png + + + + + False + False + 1 + + + + + True + True + False + Create a new solid colored stream + + + + True + False + icon_color.png + + + + + False + False + 2 + + + + + True + True + True + True + Create a new generator + + + + True + False + icon_generator.png + + + + + False + False + 3 + + + + + True + True + False + Open Samplelist + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_openlist.png + + + False + False + 0 + + + + + + + + + False + False + 4 + + + + + True + True + False + Save Samplelist (press [SHIFT] to Save as) + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_saveas.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + True + True + False + Copy sample to new or clone stream + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_copy.png + + + False + False + 0 + + + + + + + + + False + False + 6 + + + + + True + True + False + Delete selected slot + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_clear.png + + + False + False + 0 + + + + + + + + + False + False + 7 + + + + + True + True + False + Switch to property panel + + + + True + False + gtk-preferences + + + + + False + False + 8 + + + + + False + True + 1 + + + + + True + True + 2 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + + + True + False + + + Free Style + True + True + False + Randomize sample duration, free cut-off + True + True + + + False + True + 0 + + + + + True + True + False + Start / Stop randomizer + + + + 20 + 20 + True + False + button_rand.png + + + + + False + False + 1 + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Stop Event Record/Playback + True + True + + + + True + False + icon_macropause.png + + + + + False + True + 0 + + + + + True + True + False + Start recording events + True + macrostop + + + + True + False + icon_macrorec.png + + + + + False + True + 1 + + + + + True + True + False + Start playback of events + True + macrostop + + + + True + False + icon_macroplay.png + + + + + False + True + 2 + + + + + True + True + False + Clear recorded events + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_macroclear.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 3 + + + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + 0 + 12 + + + True + False + + + 24 + 24 + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + 24 + 24 + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + 150 + True + True + adjustment74 + 2 + + + + False + True + 2 + + + + + True + True + False + Fallback to default framerate + + + + True + False + icon_refresh.png + + + + + False + False + 3 + + + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + True + False + + + True + False + + + True + False + + + 400 + True + False + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + [hostname] + + + False + False + 12 + 1 + + + + + True + False + [port] + + + False + False + 4 + 2 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + 110 + True + False + cpumeter + + + False + False + 0 + + + + + 96 + True + False + cache filled + + + False + False + 1 + + + + + False + True + 0 + + + + + 84 + True + False + 0 + + + True + False + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + False + False + 2 + + + + + + + True + False + gtk-media-record + + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + + + + + + + + + Veejay Font + + + + + + + + + + + VJ20 (YUV 4:2:0 Planar) + + + VJ22 (YUV 4:2:2 Planar) + + + MJPEG + + + MJPEGB + + + HUFFYUV + + + DVVIDEO + + + YV16 (YCbCr 4:2:2 Planar) + + + I420 (YCbCr 4:2:0 Planar) + + + Quicktime-DV + + + Quicktime-MJPEG + + + MLZO + + + YUV (current) + + + + + + + + + + + VJ20 (YUV 4:2:0 Planar 0-255/0-255) + + + VJ22 (YUV 4:2:2 Planar 0-255/0-255) + + + MJPEG + + + DVVIDEO + + + MPEG4 + + + MSMPEG4V3 + + + YV16 (YCbCr 4:2:2 Planar, 16-235/16-240) + + + I420 (YCbCr 4:2:0 Planar, 16-235/16-240) + + + Quicktime-DV + + + Quicktime-MJPEG + + + MLZO + + + YUV (current) + + + + + False + VIMS Bundles + 600 + 548 + dialog + + + + + True + False + vertical + + + True + False + end + + + gtk-close + True + True + True + False + True + + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + vertical + + + True + False + + + True + False + 1 + 0 + 0 + + + True + False + vertical + True + + + True + True + False + New + + + + True + False + icon_new.png + + + + + False + False + 0 + + + + + True + True + False + Load Actionfile + + + + True + False + icon_open.png + + + + + False + False + 1 + + + + + True + True + False + Write Actionfile + + + + True + False + icon_saveas.png + + + + + False + False + 2 + + + + + True + True + False + Set/Change Key + + + + True + False + icon_keybind.png + + + + + False + False + 3 + + + + + True + True + False + Delete selected bundle + + + + True + False + icon_clear.png + + + + + False + False + 4 + + + + + True + True + False + Deatach Key from selected event + + + + True + False + icon_keydetach.png + + + + + False + False + 5 + + + + + + + False + True + 0 + + + + + True + True + + + True + True + + + True + True + + + + + + + + False + True + + + + + True + True + + + True + True + + + + + + + + True + True + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + vertical + + + True + True + + + True + True + + + + + True + True + 0 + + + + + True + False + + + True + False + True + + + True + True + False + Apply changes to this bundle + + + + True + False + icon_send.png + + + + + True + True + 0 + + + + + True + True + False + Clear text + + + + True + False + icon_clear.png + + + + + True + True + 1 + + + + + False + True + 0 + + + + + False + True + 1 + 1 + + + + + + + True + False + <b>Edit VIMS Bundle contents </b> + True + + + + + True + True + 1 + + + + + True + True + 2 + + + + + + vims_bundles_close + + + diff --git a/veejay-current/reloaded-gtk3/share/gveejay.reloaded.gladep b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.gladep new file mode 100644 index 00000000..183077ba --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.gladep @@ -0,0 +1,8 @@ + + + + + + + FALSE + diff --git a/veejay-current/reloaded-gtk3/share/gveejay.reloaded.xml b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.xml new file mode 100644 index 00000000..b0cb99e7 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/gveejay.reloaded.xml @@ -0,0 +1,18503 @@ + + + + + 1 + 0 + 0.10000000149 + 0.0099999997764800008 + 0 + 0.10000000149 + + + 255 + 0 + 0 + 0 + 0 + 96 + + + 255 + 0 + 0 + 0 + 0 + 86 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 10000 + 0 + 10 + 1 + 0 + 10 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 100 + 0 + 0 + 1 + 0 + 1 + + + 100 + 0 + 0 + 1 + 0 + 1 + + + 100 + 0 + 0 + 1 + 0 + 1 + + + 100 + 0 + 0 + 1 + 0 + 1 + + + 100 + 0 + 0 + 1 + 0 + 0 + + + 1000 + 0 + 0 + 1 + 0 + 1 + + + 1000 + 0 + 0 + 1 + 0 + 1 + + + 255 + 0 + 10 + 1 + 0 + 255 + + + 255 + 0 + 10 + 1 + 0 + 255 + + + 64 + 0 + 10 + 1 + 0 + 1 + + + 255 + 0 + 10 + 1 + 0 + 255 + + + 255 + 0 + 10 + 1 + 0 + 0 + + + 9999999 + 0 + 0 + 1 + 0 + 0 + + + 1000000000 + 0 + 0 + 1 + 0 + 0 + + + 1000000000 + 0 + 0 + 1 + 0 + 0 + + + 25 + -25 + 0 + 1 + 0 + 1 + + + 12 + 1 + 0 + 1 + 0 + 1 + + + 100000000 + 0 + 0 + 1 + 0 + 0 + + + 100000000 + 0 + 0 + 1 + 0 + 0 + + + 100000000 + 0 + 0 + 1 + 0 + 0 + + + 19 + 0 + 0 + 1 + 0 + 0 + + + 999999 + 0 + 0 + 1 + 0 + 50 + + + 9999999 + 0 + 0 + 1 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 255 + 0 + 0 + 0 + 0 + 96 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 1 + 0 + 0.10000000000000001 + 0.0099999997764800008 + 0 + 0 + + + 248 + 0 + 0 + 0 + 0 + 96 + + + 255 + 0 + 0 + 0 + 0 + 146 + + + 255 + 0 + 0 + 0 + 0 + 201 + + + 255 + 0 + 0 + 0 + 0 + 146 + + + 255 + 0 + 0 + 0 + 0 + 255 + + + 255 + 0 + 0 + 0 + 0 + 96 + + + 255 + 0 + 0 + 0 + 0 + 96 + + + 255 + 0 + 0 + 0 + 0 + 86 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 255 + 0 + 0 + 0 + 0 + 126 + + + 0 + 0 + 0 + 0 + 0 + 0 + + + 13 + 0 + 0 + 0 + 0 + 1 + + + 255 + 0 + 0 + 0 + 0 + 201 + + + 9999999 + 0 + 25 + 1 + 0 + 1500 + + + 100 + 0 + 0 + 1 + 0 + 0 + + + 255 + 0 + 10 + 1 + 0 + 0 + + + 1 + 0 + 0 + 0.050000000745099998 + 0 + 1 + + + 100 + 1 + 10 + 1 + 0 + 25 + + + 65535 + 1 + 0 + 1 + 0 + 4490 + + + 65535 + 1024 + 0 + 1 + 0 + 3490 + + + 4096 + 0 + 0 + 1 + 0 + 0 + + + 4096 + 0 + 0 + 1 + 0 + 0 + + + 800 + 1 + 0 + 1 + 0 + 176 + + + 255 + 0 + 0 + 0 + 0 + 255 + + + 800 + 1 + 0 + 1 + 0 + 144 + + + 100 + 1 + 0 + 1 + 0 + 1 + + + 1 + 0.019999999553000001 + 0 + 0.019999999553000001 + 0 + 0.019999999553000001 + + + 4096 + 0 + 0 + 1 + 0 + 2 + + + 4096 + 0 + 0 + 1 + 0 + 1 + + + 4096 + 0 + 0 + 1 + 0 + 1 + + + 4096 + 0 + 0 + 1 + 0 + 1 + + + 16 + 0 + 10 + 1 + 0 + 0 + + + 255 + 0 + 0 + 0 + 0 + 96 + + + + + + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + + + + + + + + Veejay Font + + + + + + + + + + VJ20 (YUV 4:2:0 Planar) + + + VJ22 (YUV 4:2:2 Planar) + + + MJPEG + + + MJPEGB + + + HUFFYUV + + + DVVIDEO + + + YV16 (YCbCr 4:2:2 Planar) + + + I420 (YCbCr 4:2:0 Planar) + + + Quicktime-DV + + + Quicktime-MJPEG + + + MLZO + + + YUV (current) + + + + + + + + + + VJ20 (YUV 4:2:0 Planar 0-255/0-255) + + + VJ22 (YUV 4:2:2 Planar 0-255/0-255) + + + MJPEG + + + DVVIDEO + + + MPEG4 + + + MSMPEG4V3 + + + YV16 (YCbCr 4:2:2 Planar, 16-235/16-240) + + + I420 (YCbCr 4:2:0 Planar, 16-235/16-240) + + + Quicktime-DV + + + Quicktime-MJPEG + + + MLZO + + + YUV (current) + + + + + + + + + menuitem8 + _GVeejay + + + + + sample1 + Sample + + + + + new_from_file1 + _New from file + + + + + + copy1 + _Copy + + + + + + delete1 + _Delete + + + + + + stream1 + Stream + + + + + new_source1 + _New + + + + + + new_y4m_source + _New Yuv4Mpeg + + + + + + new_color1 + _New Solid + + + + + + new_generator + _New Generator + + + + + + delete2 + _Delete + + + + + + item10 + _MIDI + + + + + midilearn + _learn MIDI + + + + + + midilearn + midievent + _MIDI enable + + + + + + clear_midi_layout1 + _Clear MIDI layout + + + + + + save1 + _Save + + + + + save_samplelist1 + Save samplelist + + + + + + save_actionfile1 + Save actionfile + + + + + + save_midi_layout1 + Save MIDI layout + + + + + + load1 + _Load + + + + + load_samplelist1 + Load samplelist + + + + + + append_samplelist1 + Append samplelist + + + + + + load_actionfile1 + Load actionfile + + + + + + load_midi_layout1 + Load MIDI layout + + + + + + load_calibration1 + Load Calibration + + + + + + gtk-quit + quit1 + + + + + + vims1 + _View + + + + + video_settings + Preferences + + + + + + image_calibration1 + Image Calibration + + + + + + vims_bundles1 + VIMS _Bundles + + + + + + help1 + _Help + + + + + + + + about1 + About Reloaded + + + + + + report_a_bug1 + Report a problem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + False + Reloaded + + + True + False + + + True + False + + + True + False + 0 + 0 + + + False + 0 + + + True + False + + + True + True + False + False + True + True + + + + True + True + 0 + + + + + + + + True + True + False + Open advanced properties dialog + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + + + True + False + gtk-preferences + + + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + + + True + False + <b>Video File</b> + True + + + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Open Veejay Liveset / Action file + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + + + True + False + bg_red.png + + + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Save Veejay Liveset / Actionfile + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + + + True + False + bg_yellow.png + + + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Cancel + + + + True + False + icon_disconnect.png + + + + + False + False + 2 + + + + + + + + + + + True + True + False + Play selected slot + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_send.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + + + + button119 + True + True + False + True + + + False + False + 7 + + + + + True + True + 1 + + + + + True + adjustment1 + 0 + False + + + + True + True + 2 + + + + + True + True + 0 + + + + + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + 1 + True + True + False + Create new input from veejay on port 3490 + True + + + + False + Image Calibration + + + + True + False + + + True + False + 0.039999999105930328 + 4 + Please select a source to calibrate + + + False + False + 0 + + + + + True + True + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + + + True + True + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + Calibrate Stream + + + False + False + 1 + + + + + + + + + True + False + <b>Select a Source</b> + True + + + + + + + True + False + Source + + + False + + + + + True + False + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View DarkFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + False + + + 352 + 288 + True + True + + + True + False + + + True + False + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + + + True + False + Dark Frame + + + 1 + False + + + + + True + False + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View LightFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + False + + + True + True + + + True + False + + + True + False + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + + + True + False + Light Frame + + + 2 + False + + + + + True + False + + + True + False + + + True + False + 0 + + + True + False + 0.97000002861022949 + 0 + 12 + + + View FlatFrame + True + True + False + True + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + True + False + Flat Frame + + + 3 + False + + + + + True + True + 1 + + + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + Frames + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment2 + 1 + + + False + True + 1 + + + + + + + + + True + False + <b>Duration</b> + True + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + False + 8 + 8 + 8 + + + True + False + + + True + False + Method + + + False + False + 0 + + + + + True + False + + + True + False + 0 + 0 + + + True + False + 0 + 0 + 0 + 0 + + + True + False + + + Median + True + True + False + True + True + + + False + False + 0 + + + + + Average + True + True + True + True + False + True + True + True + cali_method_median + + + False + False + 1 + + + + + + + + + True + False + True + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + 0 + 0.43999999761581421 + 12 + + + True + False + + + True + False + + + True + True + False + False + True + True + adjustment3 + 1 + + + True + True + 0 + + + + + True + False + Kernel Size + + + False + False + 1 + + + + + True + True + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 1 + + + + + + + + + True + False + <b>Combine</b> + True + + + + + True + True + 0 + + + + + False + 0 + + + True + False + 12 + + + True + False + + + Stream + True + True + False + True + True + + + False + False + 0 + + + + + Global + True + True + False + True + True + radiobutton6 + + + False + False + 1 + + + + + + + + + True + False + <b>Run configuration</b> + True + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + 0 + + + True + False + 0 + 0.0099999997764825821 + 133 + 132 + + + True + False + 58 + + + Reset + True + True + False + True + + + + False + False + 0 + + + + + Take Black Frames + True + True + False + True + + + + False + False + 1 + + + + + Save + True + False + True + False + True + + + + False + False + 2 + + + + + + + + + False + True + 8 + 2 + + + + + False + True + 2 + + + + + + + False + GVeejay Reloaded - New input stream + 400 + 400 + icon_stream.png + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + True + True + + + True + True + False + True + + + + + True + True + 0 + + + + + True + False + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + True + True + True + Close this window + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close + True + + + False + False + 1 + + + + + + + + + 3 + 4 + + + + + + + + + + False + False + 1 + + + + + + + + + True + False + <b>Generators</b> + True + + + + + + + False + Reloaded + veejay-icon.png + + + True + False + + + True + False + + + False + False + 0 + + + + + True + False + + + True + True + vjcontrols + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + True + False + Enable or disable selected FX + True + True + + + + + + + False + False + 0 + + + + + 36 + True + True + False + False + True + True + adjustment4 + 1 + + + + False + True + 1 + + + + + True + True + 15 + False + False + True + True + + + True + True + 2 + + + + + True + False + 0.10000000149011612 + 20 + + + True + True + 3 + + + + + False + True + 0 + + + + + 120 + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment5 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p0</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment6 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p1</b> + True + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment7 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p2</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment8 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p3</b> + True + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment9 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p4</b> + True + + + + + True + True + 4 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment10 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p5</b> + True + + + + + True + True + 5 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment11 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p6</b> + True + + + + + True + True + 6 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment12 + True + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p7</b> + True + + + + + True + True + 7 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment13 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p8</b> + True + + + + + True + True + 0 + + + + + True + True + 8 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment14 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p9</b> + True + + + + + True + True + 0 + + + + + True + True + 9 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment15 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p10</b> + True + + + + + True + True + 0 + + + + + True + True + 10 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment16 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p11</b> + True + + + + + True + True + 0 + + + + + True + True + 11 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment17 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p12</b> + True + + + + + True + True + 0 + + + + + True + True + 12 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment18 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p13</b> + True + + + + + True + True + 0 + + + + + True + True + 13 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment19 + True + 0 + 0 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p14</b> + True + + + + + True + True + 0 + + + + + True + True + 14 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + 0.94999998807907104 + 90 + + + True + True + 0 + + + + + True + True + adjustment20 + True + 0 + 0 + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + False + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p15</b> + True + + + + + True + True + 0 + + + + + True + True + 15 + + + + + True + True + 1 + + + + + True + True + + + True + False + + + True + False + + + Mixing effects + True + True + False + True + True + + + + False + False + 0 + + + + + Image effects + True + True + False + True + True + mixing_effects + + + + False + False + 1 + + + + + Alpha + True + True + False + True + True + mixing_effects + + + + False + False + 2 + + + + + + + + True + True + False + False + True + True + + + + True + True + 4 + + + + + False + True + 0 + + + + + True + False + False + False + + + True + True + automatic + + + True + True + + + + + + + True + False + video effects + 270 + + + False + + + + + True + True + automatic + automatic + + + True + True + + + + + + + True + False + image effects + 270 + + + 1 + False + + + + + True + True + automatic + automatic + + + True + True + + + + + + + True + False + alpha effects + 270 + + + 2 + False + + + + + True + True + 1 + + + + + + + True + False + <b>FX list</b> + True + + + False + + + + + True + True + automatic + + + True + False + + + True + False + + + True + True + + + True + True + 0 + + + + + True + False + + + + + + True + True + 1 + + + + + + + + + + + True + False + <b>mixing sources</b> + True + + + 1 + False + + + + + True + True + automatic + automatic + + + True + False + + + True + False + True + True + + + + + + + + + True + False + <b>RGB control</b> + True + + + 2 + False + + + + + True + True + 2 + + + + + + + True + False + <b>FX controls</b> + True + + + + + True + True + 0 + + + + + + + True + False + <b>FX</b> + True + + + False + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + FX Anim + True + True + True + Toggle keyframing for this chain entry + + + + False + True + 0 + + + + + True + False + + + True + False + <b>current control:</b> + True + + + False + False + 0 + + + + + True + False + 0 + P0 + + + True + False + 1 + + + + + True + True + False + Toggle keyframe animation for this parameter + + + + True + False + icon_keyframe.png + + + + + False + False + 2 + + + + + True + False + True + + + True + True + False + Apply this keyframe + + + + True + False + icon_apply.png + + + + + True + True + 0 + + + + + True + False + Start keyframing + + + + True + False + button_play.png + + + + + True + True + 1 + + + + + True + True + False + Reset + + + + True + False + icon_clearall.png + + + + + True + True + 2 + + + + + True + True + False + Clear selected parameter + + + + True + False + icon_clear.png + + + + + True + True + 3 + + + + + True + True + 3 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + 9 + + + None + True + True + False + half + True + 0.47999998927116394 + True + + + + + + + + + + 7 + True + True + False + True + True + kf_none + + + + 8 + 9 + + + + + + + 6 + True + True + False + True + True + kf_none + + + + 7 + 8 + + + + + + + 5 + True + True + False + True + True + kf_none + + + + 6 + 7 + + + + + + + 4 + True + True + False + True + True + kf_none + + + + 5 + 6 + + + + + + + 3 + True + True + False + True + True + kf_none + + + + 4 + 5 + + + + + + + 2 + True + True + False + True + True + kf_none + + + + 3 + 4 + + + + + + + 1 + True + True + False + True + True + kf_none + + + + 2 + 3 + + + + + + + 0 + True + True + False + True + True + kf_none + + + + 1 + 2 + + + + + + + True + True + 0 + + + + + True + False + 8 + + + + + + 8 + True + True + False + True + True + kf_none + + + + + + + + + 9 + True + True + False + True + True + kf_none + + + + 2 + 3 + + + + + + + 10 + True + True + False + True + True + kf_none + + + + 3 + 4 + + + + + + + 11 + True + True + False + True + True + kf_none + + + + 4 + 5 + + + + + + + 12 + True + True + False + True + True + kf_none + + + + 5 + 6 + + + + + + + 13 + True + True + False + True + True + kf_none + + + + 6 + 7 + + + + + + + 14 + True + True + False + True + True + kf_none + + + + 7 + 8 + + + + + + + 15 + True + True + False + True + True + kf_none + + + + 8 + 9 + + + + + + + True + False + 1 + + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + Linear + True + True + False + True + True + + + + False + False + 0 + + + + + Spline + True + True + False + True + True + curve_typelinear + + + + False + False + 1 + + + + + Freehand + True + True + False + True + True + curve_typelinear + + + + False + False + 2 + + + + + + + True + False + <b>Curve drawing method</b> + True + + + + + False + True + 2 + + + + + True + False + 0 + + + True + False + 2 + 5 + + + + + + + + + True + False + 0 + startframe + + + + + + + + + True + True + False + False + True + True + adjustment21 + 1 + + + + 1 + 2 + + + + + + True + False + 0 + endframe + + + 2 + 3 + + + + + + + True + True + False + False + True + True + adjustment22 + 1 + + + + 3 + 4 + + + + + + True + False + 0 + 00:00:00:00 + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + False + 0 + 0.49000000953674316 + 00:00:00:00 + 0 + + + 3 + 4 + 1 + 2 + + + + + + + True + False + Update start/end + + + + True + False + icon_refresh.png + + + + + 4 + 5 + 1 + 2 + + + + + + + + + + + + True + False + <b>timeline</b> + True + + + + + False + True + 3 + + + + + + + True + False + <b>FX Anim</b> + True + + + 1 + False + + + + + True + False + 0 + + + True + False + 4 + + + True + False + 0 + + + True + False + + + True + False + + + True + False + + + True + False + + + Play and repeat sample grid + True + True + False + True + True + + + + False + False + 0 + + + + + True + True + True + Clear all sequencer slots + + + + True + False + + + True + False + icon_clearall.png + + + False + False + 0 + + + + + + + True + False + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Play and record this sequence to a new sample + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_record.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + Stop recording from this sequence + + + + True + False + icon_recordstop.png + + + + + False + False + 1 + + + + + True + False + 30 + + + True + False + 0.10000000149 + + + + + True + True + 2 + + + + + + + + + True + False + <b>SEQ record to new sample</b> + True + + + + + True + True + 1 + + + + + False + False + 0 + + + + + True + False + 0 + + + True + False + + + True + False + + + + + + + + + + True + True + 1 + + + + + True + False + Click an empty slot to place current selected sample. + SHIFT-Click a slot to remove the sample. + + + False + False + 2 + + + + + + + + + True + False + <b>Sample Grid</b> + True + + + + + + + + + + + True + False + <b>SEQ</b> + True + + + 2 + False + + + + + True + False + + + True + False + + + True + False + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_connect.png + + + False + False + 0 + + + + + True + False + Add Track + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_disconnect.png + + + False + False + 0 + + + + + True + False + Close Track + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + False + True + 0 + + + + + False + False + 0 + + + + + True + False + + + + + + + + + True + True + 1 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + + + True + False + + + True + True + False + + + + True + False + button_gotostart.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_reverse.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_pause.png + + + + + False + False + 2 + + + + + True + True + False + + + + True + False + button_play.png + + + + + False + False + 3 + + + + + True + True + False + + + + True + False + button_skip.png + + + + + False + False + 4 + + + + + False + True + 0 + + + + + True + False + + + True + True + False + + + + True + False + button_gotoend.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_dec.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_inc.png + + + + + False + False + 2 + + + + + True + True + False + + + + True + False + button_prev.png + + + + + False + False + 3 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + + + + + True + False + <b>Sync controls</b> + True + + + + + True + True + 0 + + + + + True + True + False + sync start! + + + + True + False + sync.png + + + + + False + False + 1 + + + + + False + True + 2 + + + + + + + True + False + <b>MT</b> + True + + + 3 + False + + + + + True + True + automatic + automatic + + + True + False + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + 12 + + + True + False + + + True + True + False + New SRT Sequence + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_text.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + 25 + True + False + + + + False + False + False + True + True + + + model1 + + + + 0 + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 6 + 12 + + + True + False + + + True + False + True + + + True + True + False + Delete this SRT Sequence + + + + True + False + button_skull.png + + + + + True + True + 0 + + + + + True + True + False + Apply Text and Start/End position + + + + True + False + icon_apply.png + + + + + True + True + 1 + + + + + True + True + False + Load SRT file + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + True + True + 2 + + + + + True + True + False + Save SRT file + + + + True + False + icon_save.png + + + + + True + True + 3 + + + + + False + True + 0 + + + + + + + + + False + False + end + 1 + + + + + + + True + False + Select a SRT sequence or create new + True + + + + + True + True + 0 + + + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + True + + + True + True + + + + + + + + + True + False + Edit subtitle + + + + + True + True + 3 + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + + + True + False + Start + + + False + False + 0 + + + + + True + False + + + 75 + True + True + False + False + True + True + adjustment23 + 1 + + + + False + True + 0 + + + + + True + False + 0 + 00:00:00:00 + + + False + False + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + End + + + False + False + 0 + + + + + True + False + + + 75 + True + True + False + False + True + True + adjustment24 + 1 + + + + False + True + 0 + + + + + True + False + 0 + 00:00:00:00 + + + False + False + 1 + + + + + True + True + 1 + + + + + + + True + True + 1 + + + + + + + + + True + False + Change frame start and frame end position + True + + + + + False + True + 5 + 1 + + + + + True + False + 0 + + + True + False + 6 + 12 + + + True + False + + + 100 + True + False + 0 + + + True + False + + + + False + False + False + True + True + + + model2 + + + + 0 + + + + + + + True + False + Font face + + + + + True + True + 0 + + + + + True + False + 0 + + + True + True + False + False + True + True + adjustment25 + 1 + + + + + + True + False + Size + + + + + False + False + 1 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + <b>X</b> + True + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment26 + 1 + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + <b>Y</b> + True + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment27 + 1 + + + + True + True + 1 + + + + + True + True + 1 + + + + + + + True + False + Position + + + + + False + False + 2 + + + + + + + + + True + False + Change font face, size and position + True + + + + + False + True + 5 + 2 + + + + + True + False + 0 + + + True + False + 0 + + + True + False + 5 + 12 + + + True + False + 0 + + + True + False + + + True + False + + + Outline + True + True + False + True + True + + + + False + False + 0 + + + + + Border + True + True + False + True + True + + + + False + False + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + True + False + Set this foreground color + + + + 24 + 24 + True + False + + + + + + + FG + True + True + False + Foreground color + True + True + True + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + True + False + Set this background color + + + + 24 + 24 + True + False + + + + + + + BG + True + True + False + Background color + True + True + textcolorfg + + + + + + True + True + 1 + + + + + True + False + 0 + + + True + True + False + Set this line color + + + + 24 + 24 + True + False + + + + + + + LC + True + True + False + Line color + True + True + textcolorfg + + + + + + True + True + 2 + + + + + False + True + 1 + + + + + True + False + 17 + 4 + 4 + + + True + False + 4 + 5 + + + + + + 24 + 24 + True + False + + + 1 + 2 + + + + + + 24 + 24 + True + False + + + 1 + 2 + 1 + 2 + + + + + + + 24 + 24 + True + False + + + 1 + 2 + 2 + 3 + + + + + + + 100 + True + True + adjustment28 + 0 + + + + 2 + 5 + + + + + + 100 + True + True + adjustment29 + 0 + + + + 2 + 5 + 1 + 2 + + + + + + + 100 + True + True + adjustment30 + 0 + + + + 2 + 5 + 2 + 3 + + + + + + + 100 + True + True + adjustment31 + 0 + + + + 2 + 5 + 3 + 4 + + + + + + + True + False + 0 + <b>R</b> + True + + + + + 4 + + + + + True + False + 0 + <b>G</b> + True + + + 1 + 2 + + + 4 + + + + + True + False + 0 + <b>B</b> + True + + + 2 + 3 + + + 4 + + + + + True + False + 0 + <b>A</b> + True + + + 3 + 4 + + + 4 + + + + + + + True + True + 2 + + + + + + + + + + + True + False + Change foreground,background and linecolor + True + + + + + + + False + True + 3 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + + + + + + + True + False + <b>SRT</b> + True + + + 4 + False + + + + + True + False + False + False + + + True + False + + + True + False + 2 + + + True + False + + + True + False + + + True + False + 00:00:00:00 + + + False + True + 0 + + + + + True + True + False + Enable/disable effectchain + True + True + + + + True + False + Effect chain enabled + + + + + False + True + end + 1 + + + + + False + False + 0 + + + + + False + True + 0 + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + 6 + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + 0 + 00:00:00:00 + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + + + Loops + True + True + False + True + True + + + + False + False + 0 + + + + + Frames + True + True + False + True + True + True + sample_mulloop + + + + False + False + 1 + + + + + + + + + True + True + 1 + + + + + + + + + + + + + True + False + <b>Timecode</b> + True + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + True + False + False + True + True + adjustment32 + 1 + + + + + + True + False + <b>Duration</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + False + False + False + True + True + + + model3 + + + + 0 + + + + + + + True + False + <b>Codec</b> + True + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + True + False + Start recording + + + + True + False + icon_record.png + + + + + False + True + 0 + + + + + True + True + False + Cancel recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 0 + + + + + Autoplay + True + True + False + Auto play sample after recording + True + True + + + False + False + 1 + + + + + False + True + 2 + + + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + 0.10000000149 + + + + + True + False + <b>Recording Progress</b> + True + + + + + False + True + 1 + + + + + + + True + False + <b>Record to Disk</b> + True + + + False + + + + + True + False + + + True + False + 0 + + + True + False + 15 + 12 + 51 + + + True + False + + + True + True + Untitled + False + False + True + True + + + False + False + 0 + + + + + Change title + True + True + False + True + + + + False + True + 1 + + + + + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + 12 + + + True + False + + + True + False + + + True + False + 0 + Start position + False + + + False + False + 8 + 0 + + + + + True + False + 0 + End position + + + False + False + 1 + + + + + True + False + 0 + Playback speed + + + False + False + 8 + 2 + + + + + True + False + 0 + Slow motion multiplier + + + False + False + 3 + + + + + True + True + 0 + + + + + True + False + + + True + True + False + False + True + True + adjustment33 + 1 + + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment34 + 1 + + + + False + False + 1 + + + + + True + True + False + False + True + True + adjustment35 + 1 + + + + False + False + 2 + + + + + True + True + False + False + True + True + adjustment36 + 1 + + + + False + False + 3 + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + + + True + False + True + + + + + False + False + 1 + + + + + + + True + False + <b>Properties</b> + True + + + 1 + False + + + + + True + False + + + True + True + + + True + True + 0 + + + + + True + False + + + True + True + False + Create sample from selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_new.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Save EditList + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_save.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Save Selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_saveas.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + Add Videofiles to EditList + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + False + False + 3 + + + + + False + False + 1 + + + + + True + False + 2 + 3 + + + True + False + 0000000000 + 12 + + + 1 + 2 + 1 + 2 + + + + + + True + False + 0 + Positon + + + + + + + + True + False + 0 + Total frames + + + 1 + 2 + + + + + + True + False + 0 + 000000000000 + 10 + + + 1 + 2 + + + + + + + True + False + 0 + 0:00:00:00 + 11 + + + 2 + 3 + + + + + + + True + False + 0 + 0:00:00:00 + 11 + + + 2 + 3 + 1 + 2 + + + + + + + False + True + 2 + + + + + True + False + 3 + 2 + 5 + + + True + False + 0 + <i>Starting position</i> + True + + + 1 + 2 + + + + + + True + False + 0 + <i>Duration:</i> + True + + + + + + + + True + False + 0 + <i>Ending position:</i> + True + + + 2 + 3 + + + + + + True + False + 0 + 0 + 10 + 0:00:00:00 + 10 + + + 1 + 2 + + + + + + True + False + 0 + 10 + 0:00:00:00 + 10 + + + 1 + 2 + 1 + 2 + + + + + + True + False + 0 + 10 + 0:00:00:00 + 10 + + + 1 + 2 + 2 + 3 + + + + + + False + True + 3 + + + + + True + False + 2 + 2 + + + True + True + False + False + True + True + adjustment37 + 1 + + + + 1 + 2 + 1 + 2 + + + + + True + True + False + False + True + True + adjustment38 + 1 + + + + 1 + 2 + + + + + Set start + True + True + False + Take current position as starting position + True + + + + + + + + + + Set end + True + True + False + Take current position as ending position + True + + + + 1 + 2 + + + + + + + False + True + 4 + + + + + True + False + + + True + True + False + Cut selection to buffer + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_cut.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Copy selection to buffer + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_copy.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Paste from buffer into editlist at current position + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_paste.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + Delete selection (without buffer) + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_trash.png + + + False + False + 0 + + + + + + + + + False + False + 3 + + + + + True + True + False + Crop to selection + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_crop.png + + + False + False + 0 + + + + + + + + + False + False + 4 + + + + + True + True + Paste at this position + False + False + True + True + adjustment39 + 1 + + + True + True + 5 + + + + + True + True + False + Paste buffer at position + + + + True + False + icon_paste.png + + + + + False + False + 6 + + + + + False + True + 5 + + + + + + + True + False + <b>EditList</b> + True + + + 2 + False + + + + + True + True + 1 + + + + + + + True + False + Sample + + + False + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + 0 + + + True + False + + + True + False + Frames: + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment40 + 1 + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + False + 00:00:00:00 + 10 + + + False + False + 0 + + + + + Effect chain enabled + True + True + False + True + True + True + + + + False + False + 1 + + + + + + + True + True + 1 + + + + + + + False + True + 0 + + + + + True + False + + + True + False + 0 + + + True + False + 0 + 0:00:00 + 8 + + + + + True + False + <b>Timecode</b> + True + + + + + False + True + 2 + 0 + + + + + True + False + + + True + False + 0 + + + True + True + + False + False + True + True + adjustment41 + 1 + + + + + + True + False + <b>Duration</b> + True + + + + + True + True + 2 + 0 + + + + + True + False + 0 + + + 120 + True + False + + + False + False + False + True + True + + + model4 + + + + 0 + + + + + + + True + False + <b>Codec</b> + True + + + + + True + True + 2 + 1 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + True + True + True + Start recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_record.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + True + True + Cancel recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + 0 + + + + + True + True + False + True + + + True + False + Autoplay + + + + + False + False + 1 + + + + + False + True + 2 + + + + + False + False + 1 + + + + + True + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + 0 + <b>Camera Controls</b> + True + + + False + False + 0 + + + + + True + True + automatic + automatic + + + True + False + + + True + False + 21 + 2 + + + + + + + + + True + False + 0.89999997615814209 + 0 + Brightness + + + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Contrast + + + 1 + 2 + GTK_FILL + + + + + + True + True + adjustment42 + 2 + 2 + + + + 1 + 2 + 4 + 5 + GTK_FILL + + 4 + + + + + True + True + adjustment43 + 2 + 2 + + + + 1 + 2 + 1 + 2 + GTK_FILL + + 4 + + + + + True + True + adjustment44 + 2 + 2 + + + + 1 + 2 + + 4 + + + + + True + False + 0.89999997615814209 + Hue + + + 2 + 3 + GTK_FILL + + + + + + True + True + adjustment45 + 2 + 2 + + + + 1 + 2 + 2 + 3 + GTK_FILL + + 4 + + + + + True + False + 0.89999997615814209 + Gamma + + + 4 + 5 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Saturation + + + 3 + 4 + GTK_FILL + + + + + + True + True + adjustment46 + 2 + 2 + + + + 1 + 2 + 3 + 4 + GTK_FILL + + 4 + + + + + True + False + 0.89999997615814209 + Gain + + + 6 + 7 + GTK_FILL + + + + + + True + True + adjustment47 + 2 + 2 + + + + 1 + 2 + 6 + 7 + GTK_FILL + + 4 + + + + + True + False + 0.89999997615814209 + Red Balance + + + 7 + 8 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Blue Balance + + + 8 + 9 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Green Balance + + + 9 + 10 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Auto White Balance + + + 10 + 11 + GTK_FILL + + + + + + Enabled + True + True + False + True + + + + 1 + 2 + 10 + 11 + + + + + True + False + 0.89999997615814209 + Sharpness + + + 11 + 12 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Backlight Compensation + + + 12 + 13 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Auto Gain + + + 13 + 14 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Auto Hue + + + 14 + 15 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Temperature + + + 15 + 16 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Horizontal Flip + + + 16 + 17 + GTK_FILL + + + + + + True + True + adjustment48 + 2 + 2 + + + + 1 + 2 + 7 + 8 + GTK_FILL + + 4 + + + + + True + True + adjustment49 + 2 + 2 + + + + 1 + 2 + 8 + 9 + GTK_FILL + + 4 + + + + + True + True + adjustment50 + 2 + 2 + + + + 1 + 2 + 9 + 10 + GTK_FILL + + 4 + + + + + True + True + adjustment51 + 2 + 2 + + + + 1 + 2 + 11 + 12 + GTK_FILL + + 4 + + + + + True + True + adjustment52 + 2 + 2 + + + + 1 + 2 + 12 + 13 + GTK_FILL + + 4 + + + + + Enabled + True + True + False + True + + + + 1 + 2 + 13 + 14 + + + + + Enabled + True + True + False + True + + + + 1 + 2 + 14 + 15 + + + + + True + True + adjustment53 + 2 + 2 + + + + 1 + 2 + 15 + 16 + GTK_FILL + + 4 + + + + + Enabled + True + True + False + True + + + + 1 + 2 + 16 + 17 + + + + + True + False + 0.89999997615814209 + Exposure + + + 18 + 19 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Vertical Flip + + + 17 + 18 + GTK_FILL + + + + + + Enabled + True + True + False + True + + + + 1 + 2 + 17 + 18 + + + + + True + False + 0.89999997615814209 + Black Level + + + 19 + 20 + GTK_FILL + + + + + + True + False + 0.89999997615814209 + Whiteness + + + 20 + 21 + GTK_FILL + + + + + + True + True + adjustment54 + 2 + 2 + + + + 1 + 2 + 19 + 20 + GTK_FILL + + 4 + + + + + True + True + adjustment55 + 2 + 2 + + + + 1 + 2 + 20 + 21 + GTK_FILL + + 4 + + + + + True + True + adjustment56 + 2 + 2 + + + + 1 + 2 + 18 + 19 + GTK_FILL + + 4 + + + + + + + + + True + True + 1 + + + + + + + True + True + 0 + + + + + + + True + False + <b>Video Device</b> + True + + + False + + + + + True + False + + + + + True + False + <b>Solid Stream</b> + True + + + 1 + False + + + + + True + True + 2 + + + + + False + + + True + False + 0 + + + True + False + + + True + True + adjustment57 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p0</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment58 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p1</b> + True + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment59 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p2</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment60 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p3</b> + True + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment61 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p4</b> + True + + + + + True + True + 4 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + True + adjustment62 + True + 0 + 0 + + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p5</b> + True + + + + + True + True + 5 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment63 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + True + 1 + + + + + + + True + False + <b>p6</b> + True + + + + + True + True + 6 + + + + + True + False + 0 + + + True + False + + + True + True + adjustment64 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p7</b> + True + + + + + True + True + 7 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + True + adjustment65 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p8</b> + True + + + + + True + True + 0 + + + + + True + True + 8 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + True + adjustment66 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p9</b> + True + + + + + True + True + 0 + + + + + True + True + 9 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + True + adjustment67 + True + 0 + 0 + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + True + + + + True + False + button_mini_decrement.png + + + + + True + True + 0 + + + + + True + True + True + + + + True + False + button_mini_increment.png + + + + + True + True + 1 + + + + + + + False + False + 1 + + + + + + + True + False + <b>p10</b> + True + + + + + True + True + 0 + + + + + True + True + 10 + + + + + True + True + 3 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 0 + + + True + False + 0.10000000149 + + + + + + + + + True + False + <b>Recording progress</b> + True + + + + + False + True + 4 + + + + + + + True + False + Stream + + + 1 + False + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 7 + 2 + True + + + True + False + 0 + Interlacing + + + 2 + 3 + + + + + + + True + False + 0 + Top First + + + 1 + 2 + 2 + 3 + + + + + + + True + False + 0 + 0 + Norm + + + 3 + 4 + + + + + + + True + False + 0 + 0 + PAL + + + 1 + 2 + 3 + 4 + + + + + + + True + False + 0 + Audio bits + + + 4 + 5 + + + + + + + True + False + 0 + 16 + + + 1 + 2 + 4 + 5 + + + + + + + True + False + 0 + Audio Channels + + + 5 + 6 + + + + + + + True + False + 0 + 2 + + + 1 + 2 + 5 + 6 + + + + + + + True + False + 0 + Audio rate + + + 6 + 7 + + + + + + + True + False + 0 + 44000 + + + 1 + 2 + 6 + 7 + + + + + + + True + False + 0 + Resolution + + + + + + + + True + False + 0 + 25 + + + 1 + 2 + 1 + 2 + + + + + + + True + False + 0 + 352x288 + + + 1 + 2 + + + + + + + True + False + 0 + FPS + + + 1 + 2 + + + + + + + + + + + + + True + False + Plain + + + 2 + False + + + + + + + True + False + <b>Sample</b> + True + + + 5 + False + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + + + True + False + + + True + False + + + True + False + + + liveview on/off + True + True + False + True + True + + + + False + False + 0 + + + + + gray + True + True + False + True + True + + + + False + False + 1 + + + + + True + False + + + 1/8 + True + True + False + Very low quality preview + True + + + + False + False + 0 + + + + + 1/4 + True + True + False + Low quality preview + True + + + + False + False + 1 + + + + + 1/2 + True + True + False + Medium quality preview + True + + + + False + False + 2 + + + + + 1/1 + True + True + False + High quality preview + True + + + + False + False + 3 + + + + + True + False + 0 + none + + + True + False + 12 + + + True + False + + + Feedback + True + True + False + True + True + + + + GTK_FILL + + + + + + + + + + True + True + 4 + + + + + False + True + 3 + 2 + + + + + False + True + 0 + + + + + True + False + + + Alpha Clear + True + True + False + True + Fills the alpha channel every frame period when enabled + True + True + + + + True + True + 0 + + + + + True + True + True + True + Alpha 255 + + + + True + False + icon_255.png + + + + + False + False + 1 + + + + + True + True + True + True + Enable or disable Alpha Transition + + + + True + False + Enable Chain Fader alpha method + icon_alpha.png + + + + + False + False + 2 + + + + + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + + + False + False + 0 + + + + + False + False + 0 + + + + + True + False + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + veejay-logo.png + + + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + 2 + 6 + True + + + + + + True + False + 0 + Length: + + + + + + + + True + False + 0 + Sample + 7 + + + 1 + 2 + + + + + + True + False + 0 + 0:00:00:00 + 12 + + + 1 + 2 + + + + + + True + False + 0 + 00000 + 5 + + + 1 + 2 + 1 + 2 + + + + + + True + False + 0 + Time: + + + 2 + 3 + + + + + + True + False + 0 + Frame: + + + 2 + 3 + 1 + 2 + + + + + + True + False + 0 + 0:00:00:00 + 12 + + + 3 + 4 + + + + + + True + False + 0 + 00000000 + 12 + + + 3 + 4 + 1 + 2 + + + + + + True + False + 0 + M: + + + 4 + 5 + + + + + + True + False + 0 + 00:00:00:00 + 12 + + + 5 + 6 + + + + + + True + False + 0 + hint + + + 5 + 6 + 1 + 2 + + + + + + True + True + 0 + + + + + False + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + 0 + + + + + + True + True + 0 + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + True + + + True + True + False + + + + True + False + button_gotostart.png + + + + + True + True + 0 + + + + + True + True + False + + + + True + False + button_fbw.png + + + + + True + True + 1 + + + + + True + True + False + + + + True + False + button_reverse.png + + + + + True + True + 2 + + + + + True + True + False + + + + True + False + button_pause.png + + + + + True + True + 3 + + + + + True + True + False + + + + True + False + button_play.png + + + + + True + True + 4 + + + + + True + True + False + + + + True + False + button_ffw.png + + + + + True + True + 5 + + + + + True + True + False + + + + True + False + button_gotoend.png + + + + + True + True + 6 + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + + + True + False + True + + + True + True + False + + + + True + False + button_prev.png + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_skip.png + + + + + False + False + 1 + + + + + + + False + False + 0 + + + + + True + False + + + True + False + + + True + False + 12 + + + True + False + + + True + False + + + True + True + False + Change Playback Mode + + + + True + False + icon_playmode.png + + + + + False + False + 0 + + + + + [... + True + True + False + Mark current position as start of a new sample + True + + + + False + False + 1 + + + + + ...] + True + True + False + Mark current position as sample end and create new sample + True + + + + False + False + 2 + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Toggle Bezerk Mode + + + + True + False + icon_berserk.png + + + + + False + False + 0 + + + + + True + True + False + Take Background Mask(diff overlay) + + + + True + False + icon_mask.png + + + + + False + False + 1 + + + + + True + True + 1 + + + + + True + True + True + True + Enable Multicast frame sender + + + + True + False + multicast.ico + + + + + False + False + 2 + + + + + + + False + True + end + 0 + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Normal Loop + True + True + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_loop.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Bounce + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_bounce.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + + + + True + True + False + True + Play once and then pause the video + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 3 + button_looponce.png + + + False + False + 0 + + + + + + + + + True + True + 3 + + + + + True + True + False + True + Play once and keep playing last frame + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + 3 + icon_looponcenop.png + + + False + False + 0 + + + + + + + + + True + True + 4 + + + + + True + True + False + True + Random Frame + True + loop_normal + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + button_rand.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + + + + + True + True + 0 + + + + + + + + + + False + True + 0 + + + + + True + False + + + True + False + + + 50 + True + True + adjustment68 + 0 + + + + True + True + 0 + + + + + 50 + True + True + adjustment69 + 0 + + + + True + True + 1 + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + False + + + True + True + + + True + False + + + True + False + + + True + False + + + True + False + + + True + True + Offline recording duration in frames + False + + 5 + True + False + False + True + True + adjustment70 + 1 + True + + + False + True + 0 + + + + + True + True + True + True + Start recording + + + + True + False + Start offline recorder + icon_record.png + + + + + False + False + 1 + + + + + True + True + True + True + Cancel offline recording + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_recordstop.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + True + Auto play sample after recording has completed + True + True + + + True + False + 3 + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_back.png + + + + + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + Active bank: + + + False + False + 0 + + + + + True + True + False + False + True + True + adjustment71 + 1 + + + + True + True + 1 + + + + + + + + + True + False + 0 + + + + + + + + + False + True + 2 + + + + + True + False + 0 + + + True + False + + + True + True + False + + + + True + False + button_next.png + + + + + + + + + True + True + 3 + + + + + False + True + 0 + + + + + True + False + + + True + False + + + + + + + + + + + + True + True + 0 + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + True + False + <b>Samplebank</b> + True + + + False + + + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + True + automatic + + + True + True + + + + + True + True + 1 + 0 + + + + + True + False + + + True + True + True + True + Create bundle + + + + True + False + icon_bundle.png + + + + + False + False + 0 + + + + + True + True + True + True + Clear Entry + + + + True + False + icon_clear.png + + + + + False + False + 1 + + + + + True + True + True + True + Cut entry + + + + True + False + icon_cut.png + + + + + False + False + 2 + + + + + True + True + True + True + Copy entry + + + + True + False + icon_copy.png + + + + + False + False + 3 + + + + + True + True + True + True + Paste entry + + + + True + False + icon_paste.png + + + + + False + False + 4 + + + + + True + True + True + True + Toggle rendering of FX chain on mixing sources + + + + True + False + icon_render.png + + + + + False + False + 5 + + + + + True + True + True + True + Clear Chain + + + + True + False + icon_clearall.png + + + + + False + False + 20 + 6 + + + + + True + True + True + True + Toggle keyframing for this chain entry + + + + True + False + icon_keyframe.png + + + + + False + False + 7 + + + + + + + + + + + + + + True + False + FX entry + + + True + True + 11 + + + + + True + False + 1 + + + True + True + 4 + 12 + + + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + + + True + True + False + True + From original source to completed FX chain + True + fx_m1 + + + + True + False + icon_fxmnone.png + + + + + False + False + 0 + + + + + True + True + False + True + From selected FX entry (before FX) to completed FX chain + half + True + + + + True + False + icon_fxm1.png + + + + + False + False + 1 + + + + + True + True + False + True + From selected FX entry (after FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm2.png + + + + + False + False + 2 + + + + + True + True + False + True + From mixing source of selected FX entry (before FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm4.png + + + + + False + False + 3 + + + + + True + True + False + True + From mixing source of selected FX entry (after FX) to completed FX chain + True + fx_m1 + + + + True + False + icon_fxm3.png + + + + + False + False + 4 + + + + + False + True + 1 + + + + + True + False + + + True + False + + + True + False + + + True + True + True + True + Fade in FX Chain + + + + True + False + icon_fadein.png + + + + + False + False + 4 + 0 + + + + + True + True + True + True + Fade Out FX Chain + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_fadeout.png + + + False + False + 0 + + + + + + + + + False + False + 4 + 1 + + + + + False + False + 0 + + + + + False + True + 0 + + + + + 82 + True + True + adjustment72 + True + False + + + + True + True + 1 + + + + + + + + True + True + False + True + Switch to sample #B after completing fade. + True + + + + True + False + icon_follow.png + + + + + False + False + 3 + + + + + True + False + + + True + True + True + FX Chain fade duration in frames + + True + False + False + True + True + adjustment73 + 1 + + + + False + True + 0 + + + + + True + True + True + True + Return to previous sample + 0 + 0 + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_bounce.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + False + True + 4 + + + + + False + True + 2 + + + + + + + True + True + 0 + + + + + + + True + False + <b>FX Chain</b> + True + + + 1 + False + + + + + True + False + + + True + False + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Take Screenshot + + + + True + False + icon_screenshot.png + + + + + False + False + 0 + + + + + + + + True + False + localhost:3490 + + + + True + False + icon_connect.png + + + + + False + False + 2 + + + + + True + False + Disconnect + + + + True + False + icon_disconnect.png + + + + + False + False + 3 + + + + + True + True + False + Display Debug + + + + True + False + icon_bug.png + + + + + False + False + 4 + + + + + True + True + False + Enable jack + + + + True + False + icon_jack.png + + + + + False + False + 5 + + + + + True + True + False + Display OSD status + + + + True + False + icon_osd.png + + + + + False + False + 6 + + + + + True + True + False + Enable/Disable EDL Cache (see veejay console) + + + + True + False + icon_cache.png + + + + + False + False + 7 + + + + + Sync + True + True + False + Drop audio/video frames and keep in sync (by default enabled) + True + True + + + + False + False + 8 + + + + + True + False + + + True + False + 6 + shm in + + + False + False + 0 + + + + + True + False + + + 3490 + True + True + False + Create new input from veejay on port 3490 + True + + + + False + False + 0 + + + + + 4490 + True + True + False + Create new input from veejay on port 4490 + True + + + + False + False + 1 + + + + + 5490 + True + True + False + Create new input from veejay on port 5490 + True + + + + False + False + 2 + + + + + 6490 + True + True + False + Create new input from veejay on port 6490 + True + + + + False + False + 3 + + + + + 7490 + True + True + False + Create new input from veejay on port 7490 + True + + + + False + False + 4 + + + + + True + True + 1 + + + + + False + False + 9 + + + + + + + + + True + False + <b>Actions</b> + True + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + automatic + automatic + + + 150 + True + True + + + + + True + True + 0 + + + + + True + False + + + True + True + False + False + True + True + + + + True + True + 3 + 0 + + + + + True + True + False + Send VIMS to veejay + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_send.png + + + False + False + 0 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + True + False + + + _Clear + True + True + False + True + + + + False + False + 0 + + + + + True + True + False + + + + True + False + button_gotostart.png + + + + + False + False + 1 + + + + + True + True + False + + + + True + False + button_gotoend.png + + + + + False + False + 2 + + + + + repeat + True + True + False + True + + + False + False + 3 + + + + + False + True + 2 + + + + + + + True + False + <b>VIMS messenger</b> + True + + + + + True + True + 1 + + + + + True + True + 0 + + + + + + + True + False + <b>Veejay</b> + True + + + 2 + False + + + + + True + False + + + True + False + + + True + False + 0 + + + True + False + + + True + False + + + True + False + + + True + True + False + Refresh Veejay's Working Directory + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + + + True + False + icon_open.png + + + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + + + + False + False + 0 + + + + + True + True + + + True + True + False + True + + + + + True + True + 1 + + + + + + + + + True + True + 0 + + + + + True + False + Listing of Veejay's working directory. Doube click a row to add it as a Sample + + + False + False + 1 + + + + + True + True + 0 + + + + + + + True + False + <b>Media</b> + True + + + 3 + False + + + + + True + True + 0 + + + + + True + False + + + True + True + False + Add a video or image file as a new sample + + + + True + False + icon_open.png + + + + + False + False + 0 + + + + + True + True + False + Create a new stream (v4l, dv, network ...) + + + + True + False + icon_stream.png + + + + + False + False + 1 + + + + + True + True + False + Create a new solid colored stream + + + + True + False + icon_color.png + + + + + False + False + 2 + + + + + True + True + True + True + Create a new generator + + + + True + False + icon_generator.png + + + + + False + False + 3 + + + + + True + True + False + Open Samplelist + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_openlist.png + + + False + False + 0 + + + + + + + + + False + False + 4 + + + + + True + True + False + Save Samplelist (press [SHIFT] to Save as) + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_saveas.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + True + True + False + Copy sample to new or clone stream + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_copy.png + + + False + False + 0 + + + + + + + + + False + False + 6 + + + + + True + True + False + Delete selected slot + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_clear.png + + + False + False + 0 + + + + + + + + + False + False + 7 + + + + + True + True + False + Switch to property panel + + + + True + False + gtk-preferences + + + + + False + False + 8 + + + + + False + True + 1 + + + + + True + True + 2 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + True + False + + + True + False + + + Free Style + True + True + False + Randomize sample duration, free cut-off + True + True + + + False + True + 0 + + + + + True + True + False + Start / Stop randomizer + + + + 20 + 20 + True + False + button_rand.png + + + + + False + False + 1 + + + + + False + True + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + False + Pause event playback + True + True + + + + True + False + icon_macropause.png + + + + + False + True + 0 + + + + + True + True + False + Start recording events (keyboard and user interface) + True + macrostop + + + + True + False + icon_macrorec.png + + + + + False + True + 1 + + + + + True + True + False + Start playing recorded events + True + macrostop + + + + True + False + icon_macroplay.png + + + + + False + True + 2 + + + + + True + True + False + Clear recorded events + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_macroclear.png + + + False + False + 0 + + + + + True + False + True + + + False + False + 1 + + + + + + + + + False + False + 3 + + + + + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + 0 + 12 + + + True + False + + + 24 + 24 + True + True + False + + + + True + False + button_mini_decrement.png + + + + + False + False + 0 + + + + + 24 + 24 + True + True + False + + + + True + False + button_mini_increment.png + + + + + False + False + 1 + + + + + 150 + True + True + adjustment74 + 2 + + + + False + True + 2 + + + + + True + True + False + Fallback to default framerate + + + + True + False + icon_refresh.png + + + + + False + False + 3 + + + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 1 + + + + + True + True + 1 + + + + + True + False + + + True + False + + + True + False + + + 400 + True + False + False + + + True + True + 0 + + + + + True + True + 0 + + + + + True + False + [hostname] + + + False + False + 12 + 1 + + + + + True + False + [port] + + + False + False + 4 + 2 + + + + + True + True + 0 + + + + + True + False + + + True + False + + + 110 + True + False + cpumeter + + + False + False + 0 + + + + + 96 + True + False + cache filled + + + False + False + 1 + + + + + False + True + 0 + + + + + 84 + True + False + 0 + + + True + False + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + False + False + 2 + + + + + + + False + GVeejay Reloaded - New input stream + 400 + 400 + icon_stream.png + + + + 340 + True + False + 0 + + + True + False + 12 + + + True + False + + + True + True + True + + + True + True + + + True + True + Double click to active, single click column for changing settings + + + + + + + True + False + <b>Device</b> + True + + + + + True + True + 0 + + + + + True + True + + + True + False + 2 + 4 + 4 + + + + + + True + True + 200 + localhost + False + False + True + True + + + 2 + 3 + + + + + + True + False + 0 + Remote + + + 1 + 2 + + + + + + + Use multicast + True + True + False + True + True + + + + + + + + + True + False + 0 + Port Number + + + 1 + 2 + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment75 + 1 + + + 2 + 3 + 1 + 2 + + + + + + Try + True + True + False + True + + + + 3 + 4 + 1 + 2 + + + + + + + + + + + True + False + <b>Network</b> + True + + + + + False + True + 1 + + + + + True + + + True + False + 2 + 5 + 4 + + + + + + + + + + + + True + False + 0 + Filename + + + 1 + 2 + + + + + + + use YUV4MPEG + True + True + False + True + True + + + + + + + + + use FFmpeg + True + True + False + True + True + inputstream_filey4m + + + 1 + 2 + + + + + + + True + True + False + False + True + True + + + 2 + 4 + + + + + + Try + True + True + False + True + + + 4 + 5 + 1 + 2 + + + + + + + True + True + False + Load Actionfile + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + 4 + 5 + + + + + + + + + True + False + <b>File</b> + True + + + + + False + True + 2 + + + + + True + False + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + True + False + Close this window + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close + True + + + False + False + 1 + + + + + + + + + 3 + 4 + + + + + + + + + + False + False + 3 + + + + + + + + + True + False + <b>Stream types</b> + True + + + + + + + True + False + Reloaded - Connect to a veejay server + False + 356 + dialog + + + + + True + False + + + True + False + end + + + True + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_connect.png + + + False + False + 0 + + + + + True + False + _Connect + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + gtk-close + True + True + True + False + True + + + + False + False + 1 + + + + + False + False + end + 0 + + + + + True + False + 3 + + + True + False + veejay-logo-small.png + + + False + False + 0 + + + + + True + False + ver.3144 + + + False + False + 1 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 2 + 2 + + + True + False + 1 + Hostname/IP address + + + + + + + + + True + True + 255 + localhost + False + False + True + True + + + + + 1 + 2 + + + + + + True + False + Port + + + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment76 + 1 + + + 1 + 2 + 1 + 2 + + + + + + + + + + True + False + <b>Connection</b> + True + + + + + False + True + 2 + + + + + False + True + 8 + 1 + + + + + False + 0.10000000149 + + + False + False + end + 2 + + + + + + veejay_connection_close + + + + False + Preferences + False + dialog + True + + + + + True + False + + + True + False + end + + + gtk-close + True + True + True + False + True + + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + True + False + 2 + 20 + + + True + False + 2 + 4 + 5 + 2 + True + + + True + False + 0 + Width + + + + + + + + + True + False + 0 + Image format + + + 2 + 1 + 2 + + + + + + + True + False + 0 + Height + + + 2 + 3 + + + + + + + True + True + False + False + True + True + adjustment77 + 1 + + + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment78 + 1 + + + 3 + 4 + + + + + + + True + True + Type extension to select image format (jpeg, png, ...) + 12 + 5 + jpeg + False + False + True + True + + + 2 + 4 + 1 + 2 + + + + + + + + + False + True + 0 + + + + + + + + + True + False + <b>Screenshot Dimensions</b> + True + + + + + True + True + 2 + 2 + + + + + False + False + 0 + + + True + False + 20 + 12 + + + True + False + 3 + 4 + 5 + 2 + True + + + True + False + 0 + Width: + + + + + + + + + True + False + 0 + Height: + + + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment79 + 1 + + + + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment80 + 1 + + + + 1 + 2 + 1 + 2 + + + + + + + False + 0 + Frame delay + + + 2 + 3 + + + + + + + True + False + False + True + True + adjustment81 + 1 + + + 3 + 4 + + + + + + + Keep 4:3 aspect + True + False + True + True + True + + + 2 + 4 + 1 + 2 + + + + + + + True + False + 0 + FPS + + + 2 + 3 + + + + + + + True + False + + + True + True + adjustment82 + 2 + False + + + + True + True + 0 + + + + + 1 + 3 + 2 + 3 + + + + + + + True + False + 0 + + + 3 + 4 + 2 + 3 + + + + + + + + + + + True + False + <b>Video preview</b> + True + + + + + True + True + 3 + 3 + + + + + True + False + + + True + False + + + + + + True + False + 0 + + + True + False + 20 + 12 + + + True + False + + + True + False + 2 + 4 + 5 + 2 + True + + + True + False + 0 + Width: + + + + + + + + + True + False + 0 + Height: + + + 1 + 2 + + + + + + + True + False + 0 + X offset: + + + 2 + 3 + + + + + + + True + False + 0 + Y offset: + + + 2 + 3 + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment83 + 1 + + + + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment84 + 1 + + + + 1 + 2 + 1 + 2 + + + + + + + True + True + False + False + True + True + adjustment85 + 1 + + + 3 + 4 + + + + + + + True + True + False + False + True + True + adjustment86 + 1 + + + 3 + 4 + 1 + 2 + + + + + + + True + True + 8 + 0 + + + + + Keep 4:3 aspect + True + True + False + True + True + True + + + True + True + 2 + 1 + + + + + Fullscreen (CTRL-F = window) + True + True + False + True + True + + + + True + True + 2 + 2 + + + + + True + False + 10 + + + True + True + True + False + Apply changes to primary output settings + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-execute + + + False + False + 0 + + + + + True + False + Apply + True + + + False + False + 1 + + + + + + + + + False + False + 0 + + + + + True + True + False + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + gtk-close + + + False + False + 0 + + + + + True + False + Close SDL + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + True + True + 3 + + + + + + + + + True + False + <b>Primary Video Window (SDL)</b> + True + + + + + True + True + 2 + 1 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + 4 + + + True + False + 0 + vloopback output device + + + + + True + True + + False + False + True + True + adjustment87 + + + 1 + 2 + + + + + True + True + True + True + Disable vloopback output video + + + + True + False + icon_disconnect.png + + + + + 3 + 4 + + + + + True + True + True + True + Enable vloopback output video + + + + True + False + icon_connect.png + + + + + 2 + 3 + + + + + + + + + True + False + <b>Video loopback settings</b> + True + + + + + True + True + 2 + + + + + True + True + 0 + + + + + True + True + 3 + 4 + + + + + + button117 + + + + False + VIMS Bundles + 600 + 548 + dialog + True + + + + + True + False + + + True + False + end + + + gtk-close + True + True + True + False + True + + + + False + False + 0 + + + + + False + True + end + 0 + + + + + True + False + + + True + False + + + True + False + 1 + 0 + 0 + + + True + False + True + + + True + True + False + New + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_new.png + + + False + False + 0 + + + + + + + + + False + False + 0 + + + + + True + True + False + Load Actionfile + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_open.png + + + False + False + 0 + + + + + + + + + False + False + 1 + + + + + True + True + False + Write Actionfile + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_saveas.png + + + False + False + 0 + + + + + + + + + False + False + 2 + + + + + True + True + False + Set/Change Key + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_keybind.png + + + False + False + 0 + + + + + + + + + False + False + 3 + + + + + True + True + False + Delete selected bundle + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_clear.png + + + False + False + 0 + + + + + + + + + False + False + 4 + + + + + True + True + False + Deatach Key from selected event + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_keydetach.png + + + False + False + 0 + + + + + + + + + False + False + 5 + + + + + + + False + True + 0 + + + + + True + True + + + True + True + + + True + True + + + + + False + True + + + + + True + True + + + True + True + + + + + True + True + + + + + True + True + 1 + + + + + True + True + 0 + + + + + True + False + 0 + + + True + False + + + True + True + + + True + True + + + + + True + True + 0 + + + + + True + False + + + True + False + True + + + True + True + False + Apply changes to this bundle + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_send.png + + + False + False + 0 + + + + + + + + + True + True + 0 + + + + + True + True + False + Clear text + + + + True + False + 0 + 0 + + + True + False + 2 + + + True + False + icon_clear.png + + + False + False + 0 + + + + + + + + + True + True + 1 + + + + + False + True + 0 + + + + + False + True + 1 + 1 + + + + + + + True + False + <b>Edit VIMS message contents </b> + True + + + + + True + True + 1 + + + + + True + True + 2 + + + + + + vims_bundles_close + + + diff --git a/veejay-current/reloaded-gtk3/share/high_contrast.rc b/veejay-current/reloaded-gtk3/share/high_contrast.rc new file mode 100644 index 00000000..56e9763a --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/high_contrast.rc @@ -0,0 +1,118 @@ +# Edit these colors and fonts however you like. +style "default" +{ + engine "hcengine" {} + xthickness = 1 + ythickness = 1 + GtkWidget::shadow_type = GTK_SHADOW_ETCHED_OUT + #GtkWidget::interior_focus = 0 + #GtkWidget::focus_padding = 0 + #GtkWidget::default_border = {0, 0, 0, 0} + #GtkWidget::default_outside_border = {0, 0, 0, 0} + GtkWidget::default_spacing = 0 + GtkScale::stepper_size = 8 + GtkRange::through-width = 4 + GtkRange::trough_border = 0 + GtkRange::slider-width = 16 + GtkScale::slider-length = 10 + + font_name = "Sans 8" + + fg[NORMAL] = "#000000" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#000000" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#c0c0c0" + + bg[NORMAL] = "#ffffff" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#c0c0c0" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#00ff00" + bg[INSENSITIVE] = "#ffffff" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#050505" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#c0c0c0" + base[PRELIGHT] = "#00fff0" # achtergrond van lists, status bars + base[ACTIVE] = "#0000ff" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + +style "text" +{ + font_name = "Sans 8" + + fg[NORMAL] = "#ffffff" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#ffffff" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#ffffff" + + bg[NORMAL] = "#27282F" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#454f60" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + +style "buttons" +{ + + font_name = "Sans 8" + + fg[NORMAL] = "#888888" + fg[PRELIGHT] = "#888888" + fg[ACTIVE] = "#888888" + fg[SELECTED] = "#888888" + fg[INSENSITIVE] = "#888888" + + bg[NORMAL] = "#27282F" + bg[PRELIGHT] = "#aaacc1" + bg[ACTIVE] = "#454f60" + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + + +class "GtkButton" style "default" +class "GtkSpinButton" style "default" +class "GtkToggleButton" style "default" +class "GtkCheckBox" style "default" + +class "GtkLabel" style "default" + +class "GtkWidget" style "default" diff --git a/veejay-current/reloaded-gtk3/share/icon_255.png b/veejay-current/reloaded-gtk3/share/icon_255.png new file mode 100644 index 00000000..d10a9899 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_255.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_alpha.png b/veejay-current/reloaded-gtk3/share/icon_alpha.png new file mode 100644 index 00000000..aa8a7870 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_alpha.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_apply.png b/veejay-current/reloaded-gtk3/share/icon_apply.png new file mode 100644 index 00000000..cb075f1f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_apply.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_berserk.png b/veejay-current/reloaded-gtk3/share/icon_berserk.png new file mode 100644 index 00000000..6270ece0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_berserk.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_bezerk.png b/veejay-current/reloaded-gtk3/share/icon_bezerk.png new file mode 100644 index 00000000..6270ece0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_bezerk.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_bounce.png b/veejay-current/reloaded-gtk3/share/icon_bounce.png new file mode 100644 index 00000000..82bbce6a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_bounce.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_bug.png b/veejay-current/reloaded-gtk3/share/icon_bug.png new file mode 100644 index 00000000..a6582fe7 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_bug.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_bundle.png b/veejay-current/reloaded-gtk3/share/icon_bundle.png new file mode 100644 index 00000000..ffd2d178 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_bundle.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_cache.png b/veejay-current/reloaded-gtk3/share/icon_cache.png new file mode 100644 index 00000000..e4d90492 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_cache.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_clear.png b/veejay-current/reloaded-gtk3/share/icon_clear.png new file mode 100644 index 00000000..512b6623 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_clear.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_clearall.png b/veejay-current/reloaded-gtk3/share/icon_clearall.png new file mode 100644 index 00000000..709fdeb8 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_clearall.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_color.png b/veejay-current/reloaded-gtk3/share/icon_color.png new file mode 100644 index 00000000..291ccf01 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_color.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_connect.png b/veejay-current/reloaded-gtk3/share/icon_connect.png new file mode 100644 index 00000000..49cb2217 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_connect.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_copy.png b/veejay-current/reloaded-gtk3/share/icon_copy.png new file mode 100644 index 00000000..9d14bc7e Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_copy.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_crop.png b/veejay-current/reloaded-gtk3/share/icon_crop.png new file mode 100644 index 00000000..5b35f81a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_crop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_cut.png b/veejay-current/reloaded-gtk3/share/icon_cut.png new file mode 100644 index 00000000..05fe1a0c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_cut.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_disconnect.png b/veejay-current/reloaded-gtk3/share/icon_disconnect.png new file mode 100644 index 00000000..84217c10 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_disconnect.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fadein.png b/veejay-current/reloaded-gtk3/share/icon_fadein.png new file mode 100644 index 00000000..797fe2fe Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fadein.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fadeout.png b/veejay-current/reloaded-gtk3/share/icon_fadeout.png new file mode 100644 index 00000000..78f8946d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fadeout.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_follow.png b/veejay-current/reloaded-gtk3/share/icon_follow.png new file mode 100644 index 00000000..59fb755a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_follow.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fxm1.png b/veejay-current/reloaded-gtk3/share/icon_fxm1.png new file mode 100644 index 00000000..401cb5e7 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fxm1.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fxm2.png b/veejay-current/reloaded-gtk3/share/icon_fxm2.png new file mode 100644 index 00000000..3d4a17bc Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fxm2.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fxm3.png b/veejay-current/reloaded-gtk3/share/icon_fxm3.png new file mode 100644 index 00000000..f7ba618d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fxm3.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fxm4.png b/veejay-current/reloaded-gtk3/share/icon_fxm4.png new file mode 100644 index 00000000..024b3e26 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fxm4.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_fxmnone.png b/veejay-current/reloaded-gtk3/share/icon_fxmnone.png new file mode 100644 index 00000000..61072643 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_fxmnone.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_generator.png b/veejay-current/reloaded-gtk3/share/icon_generator.png new file mode 100644 index 00000000..f16f757f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_generator.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_jack.png b/veejay-current/reloaded-gtk3/share/icon_jack.png new file mode 100644 index 00000000..cf2fe3fb Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_jack.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_keybind.png b/veejay-current/reloaded-gtk3/share/icon_keybind.png new file mode 100644 index 00000000..fd7b0994 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_keybind.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_keydetach.png b/veejay-current/reloaded-gtk3/share/icon_keydetach.png new file mode 100644 index 00000000..c3ce1b77 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_keydetach.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_keyframe.png b/veejay-current/reloaded-gtk3/share/icon_keyframe.png new file mode 100644 index 00000000..498668a0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_keyframe.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_launch.png b/veejay-current/reloaded-gtk3/share/icon_launch.png new file mode 100644 index 00000000..49cb2217 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_launch.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_loop.png b/veejay-current/reloaded-gtk3/share/icon_loop.png new file mode 100644 index 00000000..aacf503f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_loop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_looponce.png b/veejay-current/reloaded-gtk3/share/icon_looponce.png new file mode 100644 index 00000000..08475a7d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_looponce.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_looponcenop.png b/veejay-current/reloaded-gtk3/share/icon_looponcenop.png new file mode 100644 index 00000000..011a7042 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_looponcenop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_macroclear.png b/veejay-current/reloaded-gtk3/share/icon_macroclear.png new file mode 100644 index 00000000..c1f61079 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_macroclear.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_macropause.png b/veejay-current/reloaded-gtk3/share/icon_macropause.png new file mode 100644 index 00000000..a06f6f7c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_macropause.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_macroplay.png b/veejay-current/reloaded-gtk3/share/icon_macroplay.png new file mode 100644 index 00000000..db42baa9 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_macroplay.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_macrorec.png b/veejay-current/reloaded-gtk3/share/icon_macrorec.png new file mode 100644 index 00000000..5e304b50 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_macrorec.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_mask.png b/veejay-current/reloaded-gtk3/share/icon_mask.png new file mode 100644 index 00000000..8b7fbec5 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_mask.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_minus.png b/veejay-current/reloaded-gtk3/share/icon_minus.png new file mode 100644 index 00000000..03059371 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_minus.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_new.png b/veejay-current/reloaded-gtk3/share/icon_new.png new file mode 100644 index 00000000..c553eb00 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_new.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_noloop.png b/veejay-current/reloaded-gtk3/share/icon_noloop.png new file mode 100644 index 00000000..fef7bfcf Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_noloop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_open.png b/veejay-current/reloaded-gtk3/share/icon_open.png new file mode 100644 index 00000000..4df40ebc Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_open.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_openlist.png b/veejay-current/reloaded-gtk3/share/icon_openlist.png new file mode 100644 index 00000000..a7487645 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_openlist.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_openstream.png b/veejay-current/reloaded-gtk3/share/icon_openstream.png new file mode 100644 index 00000000..3f0bc34d Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_openstream.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_osd.png b/veejay-current/reloaded-gtk3/share/icon_osd.png new file mode 100644 index 00000000..e195c9ad Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_osd.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_paste.png b/veejay-current/reloaded-gtk3/share/icon_paste.png new file mode 100644 index 00000000..337df33c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_paste.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_plarge.png b/veejay-current/reloaded-gtk3/share/icon_plarge.png new file mode 100644 index 00000000..f1116bfd Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_plarge.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_playmode.png b/veejay-current/reloaded-gtk3/share/icon_playmode.png new file mode 100644 index 00000000..efe2350f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_playmode.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_plus.png b/veejay-current/reloaded-gtk3/share/icon_plus.png new file mode 100644 index 00000000..830a8024 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_plus.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_psmall.png b/veejay-current/reloaded-gtk3/share/icon_psmall.png new file mode 100644 index 00000000..ec2e287a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_psmall.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_question.png b/veejay-current/reloaded-gtk3/share/icon_question.png new file mode 100644 index 00000000..dab7e54f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_question.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_record.png b/veejay-current/reloaded-gtk3/share/icon_record.png new file mode 100644 index 00000000..80d7747b Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_record.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_recordstop.png b/veejay-current/reloaded-gtk3/share/icon_recordstop.png new file mode 100644 index 00000000..924b1085 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_recordstop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_recstop.png b/veejay-current/reloaded-gtk3/share/icon_recstop.png new file mode 100644 index 00000000..c2e2d09c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_recstop.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_refresh.png b/veejay-current/reloaded-gtk3/share/icon_refresh.png new file mode 100644 index 00000000..5d141530 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_refresh.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_render.png b/veejay-current/reloaded-gtk3/share/icon_render.png new file mode 100644 index 00000000..d3dc9659 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_render.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_save.png b/veejay-current/reloaded-gtk3/share/icon_save.png new file mode 100644 index 00000000..cd1e9455 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_save.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_saveas.png b/veejay-current/reloaded-gtk3/share/icon_saveas.png new file mode 100644 index 00000000..514ef83c Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_saveas.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_screenshot.png b/veejay-current/reloaded-gtk3/share/icon_screenshot.png new file mode 100644 index 00000000..dba2ed23 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_screenshot.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_send.png b/veejay-current/reloaded-gtk3/share/icon_send.png new file mode 100644 index 00000000..3ccdfc88 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_send.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_skull.png b/veejay-current/reloaded-gtk3/share/icon_skull.png new file mode 100644 index 00000000..a9de432f Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_skull.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_stream.png b/veejay-current/reloaded-gtk3/share/icon_stream.png new file mode 100644 index 00000000..cdc841b0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_stream.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_trash.png b/veejay-current/reloaded-gtk3/share/icon_trash.png new file mode 100644 index 00000000..6b3933ce Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_trash.png differ diff --git a/veejay-current/reloaded-gtk3/share/icon_video.png b/veejay-current/reloaded-gtk3/share/icon_video.png new file mode 100644 index 00000000..cdc841b0 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/icon_video.png differ diff --git a/veejay-current/reloaded-gtk3/share/knob.png b/veejay-current/reloaded-gtk3/share/knob.png new file mode 100644 index 00000000..af1ac70a Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/knob.png differ diff --git a/veejay-current/reloaded-gtk3/share/multicast.ico b/veejay-current/reloaded-gtk3/share/multicast.ico new file mode 100644 index 00000000..aad528c8 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/multicast.ico differ diff --git a/veejay-current/reloaded-gtk3/share/reloaded_classic.glade b/veejay-current/reloaded-gtk3/share/reloaded_classic.glade new file mode 100644 index 00000000..c03d71a7 --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/reloaded_classic.glade @@ -0,0 +1,16508 @@ + + + + + + + Reloaded + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 900 + 640 + True + False + veejay-icon.png + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + + + + True + False + 0 + + + + True + False + 0 + + + + True + + + + True + _GVeejay + True + + + + + + + True + Sample + True + + + + True + button_loop.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + _New from file + True + + + + + True + icon_openlist.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Copy + True + + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Delete + True + + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + Stream + True + + + + True + icon_stream.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + _New + True + + + + + True + icon_openlist.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _New Solid + True + + + + + True + icon_color.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Delete + True + + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _MIDI + True + + + + True + icon_connect.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + _learn MIDI + True + True + + + + + + + True + _MIDI enable + True + True + midilearn + + + + + + + + + + + True + _Save + True + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Save samplelist + True + + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save actionfile + True + + + + + True + icon_openlist.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Save MIDI layout + True + + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Load + True + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + Load samplelist + True + + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Append samplelist + True + + + + + + + True + Load actionfile + True + + + + + True + icon_openlist.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Load MIDI layout + True + + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + + + + + + True + gtk-quit + True + + + + + + + + + + + True + + + + + + True + _View + True + + + + + + + True + Preferences + True + + + + + True + gtk-preferences + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + VIMS Console + True + + + + + True + gtk-dialog-info + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + VIMS _Bundles + True + + + + + True + icon_bundle.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Help + True + + + + + + + True + About Reloaded + True + + + + + True + icon_question.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Report a problem + True + + + + + True + icon_bug.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + 0 + True + True + + + + + + True + cpumeter + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 100 + True + cache filled + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + False + 0 + + + + localhost:3490 + True + GTK_RELIEF_HALF + True + + + + + True + icon_connect.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + Disconnect + True + GTK_RELIEF_HALF + True + + + + + True + icon_disconnect.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Toggle Bezerk Mode + True + GTK_RELIEF_HALF + True + False + False + + + + + True + icon_berserk.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + + True + Display Debug + True + GTK_RELIEF_HALF + True + False + False + + + + + True + icon_bug.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + + True + Change Playback Mode + True + GTK_RELIEF_HALF + True + + + + + True + icon_playmode.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + + True + Take Background Mask(diff overlay) + True + GTK_RELIEF_HALF + True + + + + + True + icon_mask.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + + True + Enable jack + True + GTK_RELIEF_HALF + True + False + False + + + + + True + icon_jack.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Take Screenshot + True + GTK_RELIEF_HALF + True + + + + + True + icon_screenshot.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Display OSD status + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_osd.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Enable/Disable EDL Cache (see veejay console) + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_cache.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Drop audio/video frames and keep in sync (by default enabled) + True + Sync + True + GTK_RELIEF_NORMAL + True + True + False + + + + 0 + False + False + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + True + False + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + Play once + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_looponce.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Normal Loop + True + GTK_RELIEF_HALF + True + True + False + True + loop_none + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_loop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Pingpong loop + True + GTK_RELIEF_HALF + True + False + False + True + loop_none + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_bounce.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Random Frame + True + GTK_RELIEF_HALF + True + False + False + True + loop_none + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_rand.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + True + <b>loop controls</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + Loops + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + False + True + + + + + + True + True + Frames + True + GTK_RELIEF_HALF + True + True + False + True + sample_mulloop + + + + 0 + True + True + + + + + + True + 00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 7 + False + 0 + + + 0 + True + False + + + + + + + + + + True + <b>units</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999999 1 10 10 + + + + + + + True + <b>duration</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + 120 + True + MJPEG +DVVIDEO +YUV +Quicktime-DV +Quicktime-MJPEG + False + True + True + + + + + + True + <b>codec</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + Start recording + True + GTK_RELIEF_HALF + True + + + + + True + icon_record.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + True + + + + + + True + Cancel recording + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_recordstop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + Auto play sample after recording + True + Autoplay + True + GTK_RELIEF_HALF + True + False + False + True + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + + + + True + <b>progress</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + <b>record</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + 3 + 2 + False + 0 + 0 + + + + True + End position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + Start position + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 1000000000 1 25 25 + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 1000000000 1 25 25 + + + + 1 + 2 + 1 + 2 + fill + + + + + + True + Playback speed + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 -25 25 1 5 5 + + + + 1 + 2 + 2 + 3 + + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + Slow motion multiplier + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 12 1 10 10 + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + Set title + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + True + True + True + 0 + Untitled + True + * + False + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + Enable/disable effectchain + True + GTK_RELIEF_HALF + True + True + False + True + + + + + True + Effect chain enabled + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + False + True + + + + + + True + <b>properties</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + False + 0 + + + + True + False + 0 + + + + True + True + True + False + False + True + False + False + False + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Create sample from selection + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_new.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save EditList + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Selection + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Add Videofiles to EditList + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + 2 + 3 + False + 0 + 0 + + + + True + 00000000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + Positon + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + Total frames + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + True + 000000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 11 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 11 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + True + 3 + 2 + False + 0 + 5 + + + + True + <i>Starting position</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + + + + + + + True + <i>Duration:</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + + True + <i>Ending position:</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 10 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 0 + 1 + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 10 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 1 + 2 + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 10 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + 1 + 2 + 2 + 3 + + + + + + 0 + False + True + + + + + + True + 2 + 2 + False + 0 + 0 + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + + 1 + 2 + 1 + 2 + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + + 1 + 2 + 0 + 1 + + + + + + True + Take current position as starting position + True + Set start + True + GTK_RELIEF_HALF + True + + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Take current position as ending position + True + Set end + True + GTK_RELIEF_HALF + True + + + + 0 + 1 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + Cut selection to buffer + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_cut.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Copy selection to buffer + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Paste from buffer into editlist at current position + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_paste.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete selection (without buffer) + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_trash.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Crop to selection + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_crop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Paste at this position + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100000000 1 10 10 + + + 0 + True + True + + + + + + True + Paste buffer at position + True + GTK_RELIEF_HALF + True + + + + + True + icon_paste.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + + + True + <b>EditList Operations</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 3 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + <b>EDL</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + False + True + + + + + + True + Sample + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 50 0 999999 1 10 10 + + + + + + + True + <b>Frames:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 10 + False + 0 + + + + + + True + <b>Timecode:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + + + True + <b>Ficticious length</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 8 + False + 0 + + + + + + True + <b>timecode</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 9999999 1 10 10 + + + + + + + True + <b>duration</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + 120 + True + MJPEG +DVVIDEO +YUV +Quicktime-DV +Quicktime-MJPEG + False + True + True + + + + + + True + <b>codec</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + Start recording + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_record.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Cancel recording + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_recordstop.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + False + False + True + + + + True + Autoplay + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + + PANGO_ELLIPSIZE_NONE + + + + + + True + <b>Recording progress</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + <b>record</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + True + Effect chain enabled + True + GTK_RELIEF_HALF + True + True + False + True + + + + + + False + True + + + + + + True + <b>properties</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + True + + + + False + True + + + + + + True + <b>solid</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + True + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 6 + 2 + False + 0 + 0 + + + + True + Brightness + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Contrast + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 4 + 5 + fill + fill + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 0 + 1 + fill + + + + + + True + Color + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 5 + 6 + fill + fill + + + + + + True + Hue + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + True + White + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + Saturation + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0 1 0.00999999977648 0.10000000149 0.10000000149 + + + + 1 + 2 + 3 + 4 + fill + fill + + + + + + + + True + Capture card settings + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + + True + <b>capture card controls</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + False + True + + + + + + True + <b>v4l</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + False + True + + + + + + True + Stream + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + 7 + 2 + False + 0 + 0 + + + + True + fps + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + 25 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Interlacing + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Top First + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + Norm + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + PAL + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 3 + 4 + fill + + + + + + + True + Audio bits + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 4 + 5 + fill + + + + + + + True + 16 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 4 + 5 + fill + + + + + + + True + Audio Channels + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 5 + 6 + fill + + + + + + + True + 2 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 5 + 6 + fill + + + + + + + True + Audio rate + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 6 + 7 + fill + + + + + + + True + 44000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 6 + 7 + fill + + + + + + + True + 352x288 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + Resolution + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + + + + + + False + True + + + + + + True + Plain + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + Enable or disable selected FX + True + + True + GTK_RELIEF_HALF + True + True + False + True + + + + 0 + False + False + + + + + + + + + + 36 + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 19 1 10 10 + + + + 0 + False + True + + + + + + True + True + True + True + 0 + + True + * + False + 15 + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p0</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 146 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p1</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 201 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p2</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 0 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p3</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p4</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 96 0 255 0 0 0 + + + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p5</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 86 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + True + + + + + + + + True + <b>p6</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + GTK_POS_BOTTOM + 0 + GTK_UPDATE_CONTINUOUS + True + 126 0 255 0 0 0 + + + + 0 + True + True + + + + + + True + 0.5 + 0.5 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + + 0 + False + False + + + + + + + + True + <b>p7</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + False + True + + + + + + True + <b>mixing sources</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + Mixing effects + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + False + False + + + + + + True + True + Image effects + True + GTK_RELIEF_HALF + True + False + False + True + mixing_effects + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + False + GTK_POS_RIGHT + False + False + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + False + True + + + + + + True + video effects + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 270 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + False + True + + + + + + True + image effects + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 270 + + + tab + + + + + 0 + True + True + + + + + False + True + + + + + + True + <b>FX list</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_NONE + + + + True + False + True + + + + + + + False + True + + + + + + True + <b>RGB control</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + + + True + <b>FX controls</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + True + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + 352 + 288 + True + veejay-logo.png + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + True + <b>preview</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + enable + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + False + False + + + + + + True + True + grayscale + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + True + False + + + + + + True + False + 0 + + + + True + Quality + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + Very low quality preview + True + 1/8 + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + Low quality preview + True + 1/4 + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + Medium quality preview + True + 1/2 + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + High quality preview + True + 1/1 + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + 0 + True + True + + + + + + + + True + <b>preview settings</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + 82 + True + True + False + GTK_POS_LEFT + 1 + GTK_UPDATE_CONTINUOUS + True + 0 0 255 1 10 0 + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + <b>effects chain</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + Create bundle + True + GTK_RELIEF_HALF + True + + + + + True + icon_bundle.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Clear Entry + True + GTK_RELIEF_HALF + True + + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Cut entry + True + GTK_RELIEF_HALF + True + + + + + True + icon_cut.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Copy entry + True + GTK_RELIEF_HALF + True + + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Paste entry + True + GTK_RELIEF_HALF + True + + + + + True + icon_paste.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Enable/Disable all keyframes + True + GTK_RELIEF_HALF + True + False + False + + + + + True + icon_keyframe.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + Clear Chain + True + GTK_RELIEF_HALF + True + + + + + True + icon_clearall.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Set fade duration + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1 0.0500000007451 0.10000000149 0.10000000149 + + + + 0 + True + True + + + + + + True + Fade In + True + GTK_RELIEF_HALF + True + + + + + True + icon_fadein.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Fade Out + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_fadeout.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + + True + <b>Auto chain fade</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 3 + 5 + False + 0 + 0 + + + + True + L: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + T: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + 0:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + 00000000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 3 + 4 + 1 + 2 + fill + + + + + + + True + F: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + 00000 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 5 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Sample + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 7 + False + 0 + + + 0 + 1 + 1 + 2 + shrink + shrink + + + + + + True + M: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 12 + False + 0 + + + 1 + 2 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 2 + 3 + fill + + + + + + + True + PM: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 2 + 3 + fill + + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 4 + 5 + 2 + 3 + fill + + + + + + + + + True + <b>status</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Pause event playback + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + + True + icon_macropause.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Start recording events (keyboard and user interface) + True + GTK_RELIEF_NORMAL + True + False + False + True + macrostop + + + + + True + icon_macrorec.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Start playing recorded events + True + GTK_RELIEF_NORMAL + True + False + False + True + macrostop + + + + + True + icon_macroplay.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Clear recorded events + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_macroclear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + + True + <b>keystroke recorder</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + 60 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 0 0 0 0 0 0 + + + + 0 + True + True + + + + + + 60 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 0 0 0 0 0 0 + + + + 0 + True + True + + + + + + + + + + True + <b>playback speed</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + 24 + 24 + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_decrement.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + 24 + 24 + True + True + GTK_RELIEF_HALF + True + + + + + True + button_mini_increment.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + 100 + True + True + True + GTK_POS_LEFT + 2 + GTK_UPDATE_CONTINUOUS + False + 25 1 100 1 10 0 + + + + 0 + True + True + + + + + + True + Fallback to default framerate + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_refresh.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + + True + <b>veejay framerate</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_gotostart.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_fbw.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_reverse.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_pause.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_play.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_ffw.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_gotoend.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + + + + + True + True + 0 + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_prev.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + button_skip.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Mark current position as start of a new sample + True + [... + True + GTK_RELIEF_HALF + True + + + + 0 + True + True + + + + + + True + Mark current position as sample end and create new sample + True + ...] + True + GTK_RELIEF_HALF + True + + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + True + True + True + GTK_POS_TOP + False + False + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + << + True + GTK_RELIEF_NONE + True + + + + 0 + True + True + + + + + + True + Active bank: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 10 + + + + 0 + False + True + + + + + + True + True + >> + True + GTK_RELIEF_NONE + True + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + + + + + + + + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Add a video or image file as a new sample + True + GTK_RELIEF_HALF + True + + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Create a new stream (v4l, dv, network ...) + True + GTK_RELIEF_HALF + True + + + + + True + icon_stream.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Create a new solid colored stream + True + GTK_RELIEF_HALF + True + + + + + True + icon_color.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + Open Samplelist + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_openlist.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Samplelist + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Copy sample to new + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_copy.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete selected slot + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Switch to property panel + True + GTK_RELIEF_HALF + True + + + + + True + gtk-preferences + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Randomize sample duration + True + Free Style + True + GTK_RELIEF_HALF + True + False + False + True + + + 0 + True + True + + + + + + True + Start / Stop randomizer + True + GTK_RELIEF_HALF + True + False + False + + + + + 20 + 20 + True + button_rand.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + True + <b>Sample randomizer</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + 0 + True + True + + + + + False + True + + + + + + True + <b>banks</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_NONE + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + Play and repeat sample grid + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + Play and record this sequence to a new sample + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_record.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Stop recording from this sequence + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_recordstop.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + + + + + + + + 0 + True + True + + + + + + True + Click an empty slot to place current selected sample. + SHIFT-Click a slot to remove the sample. + False + False + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + True + <b>Sample Grid</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + + + False + True + + + + + + True + <b>SEQ</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_connect.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Add Track + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_disconnect.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Close Track + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + 0 + False + True + + + + + 0 + False + False + + + + + + True + False + 0 + + + + + + + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotostart.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_reverse.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_pause.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_play.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_skip.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotoend.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_dec.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_inc.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_prev.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + 0 + False + True + + + + + 0 + True + True + + + + + + True + sync start! + True + GTK_RELIEF_NORMAL + True + + + + + True + sync.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + + True + <b>Sync controls</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + <b>MT</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + New SRT Sequence + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + button_text.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + 25 + True + 1 +2 +3 +4 +5 + False + True + True + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + 0 + + + + True + Delete this SRT Sequence + True + GTK_RELIEF_NORMAL + True + + + + + True + button_skull.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Apply Text and Start/End position + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_apply.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Load SRT file + True + GTK_RELIEF_NORMAL + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + + True + Save SRT file + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_save.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + 75 + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 0 + False + True + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + True + <b>start</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + 75 + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 0 + False + True + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + True + <b>end</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + 100 + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + Veejay Font + False + True + True + + + + + + + True + <b>face</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 100 1 10 10 + + + + + + + True + <b>Size</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + <b>X</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1000 1 10 10 + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + <b>Y</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 1000 1 10 10 + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + True + <b>Position</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + False + + + + + + + + True + <b>font</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + True + Outline + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + + True + True + Border + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + Set this foreground color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + + + + True + Foreground color + True + FG + True + GTK_RELIEF_NORMAL + True + True + False + True + + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + Set this background color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + + + + True + Background color + True + BG + True + GTK_RELIEF_NORMAL + True + False + False + True + textcolorfg + + + + label_item + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + Set this line color + True + GTK_RELIEF_NORMAL + True + + + + + 24 + 24 + True + + + + + + + + True + Line color + True + LC + True + GTK_RELIEF_NORMAL + True + False + False + True + textcolorfg + + + + label_item + + + + + 0 + True + True + + + + + 0 + False + True + + + + + + True + 0.5 + 0.5 + 1 + 1 + 17 + 0 + 4 + 4 + + + + True + 4 + 5 + False + 0 + 0 + + + + 24 + 24 + True + + + 1 + 2 + 0 + 1 + fill + + + + + + 24 + 24 + True + + + 1 + 2 + 1 + 2 + fill + fill + + + + + + 24 + 24 + True + + + 1 + 2 + 2 + 3 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 0 + 1 + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 1 + 2 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 255 0 255 1 10 0 + + + + 2 + 5 + 2 + 3 + fill + fill + + + + + + 100 + True + True + True + GTK_POS_RIGHT + 0 + GTK_UPDATE_CONTINUOUS + False + 0 0 255 1 10 0 + + + + 2 + 5 + 3 + 4 + fill + fill + + + + + + True + <b>R</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + 4 + fill + + + + + + + True + <b>G</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + 4 + fill + + + + + + + True + <b>B</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + 4 + fill + + + + + + + True + <b>A</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 3 + 4 + 4 + fill + + + + + + + + 0 + True + True + + + + + + + + True + <b>Color</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + + + True + <b>Text</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + + False + True + + + + + + True + <b>SRT</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + 150 + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + True + True + 0 + + True + * + False + + + + 3 + True + True + + + + + + True + Send VIMS to veejay + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + True + _Clear + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotostart.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + GTK_RELIEF_NORMAL + True + + + + + True + button_gotoend.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + repeat + True + GTK_RELIEF_NORMAL + True + False + False + + + 0 + False + False + + + + + 0 + False + True + + + + + + + + True + <b>VIMS messenger</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + False + True + + + + + + True + <b>VIMS</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + False + 0 + + + + True + <b>current control:</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + P0 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + True + False + + + + + + True + Toggle keyframing for this chain entry + True + GTK_RELIEF_HALF + True + False + False + + + + + True + icon_keyframe.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + True + True + 0 + + + + True + Apply this keyframe + True + GTK_RELIEF_HALF + True + + + + + True + icon_apply.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + Start keyframing + True + GTK_RELIEF_HALF + True + False + False + + + + + True + button_play.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + + True + Reset + True + GTK_RELIEF_HALF + True + + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + 1 + 8 + False + 0 + 0 + + + + True + True + 0 + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + 2 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + True + 3 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + True + 4 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 4 + 5 + 0 + 1 + fill + + + + + + + True + True + 5 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 5 + 6 + 0 + 1 + fill + + + + + + + True + True + 6 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 6 + 7 + 0 + 1 + fill + + + + + + + True + True + 7 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 7 + 8 + 0 + 1 + fill + + + + + + + True + True + 1 + True + GTK_RELIEF_HALF + True + False + False + True + kf_p0 + + + + 1 + 2 + 0 + 1 + fill + + + + + + 0 + True + True + + + + + + + + True + <b>animate FX</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 1 + 0 + 1 + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + Linear + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + False + False + + + + + + True + True + Spline + True + GTK_RELIEF_HALF + True + False + False + True + curve_typelinear + + + + 0 + False + False + + + + + + True + True + Freehand + True + GTK_RELIEF_HALF + True + False + False + True + curve_typelinear + + + + 0 + False + False + + + + + + + + True + <b>Curve drawing method</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 2 + 5 + False + 0 + 0 + + + + True + startframe + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 1 + 2 + 0 + 1 + + + + + + + True + endframe + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 100 1 10 10 + + + + 3 + 4 + 0 + 1 + + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 0 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + 00:00:00:00 + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.490000009537 + 0 + 0 + PANGO_ELLIPSIZE_NONE + 0 + False + 0 + + + 3 + 4 + 1 + 2 + fill + + + + + + + Update start/end + True + GTK_RELIEF_NORMAL + True + + + + + True + icon_refresh.png + 0.5 + 0.5 + 0 + 0 + + + + + 4 + 5 + 1 + 2 + fill + + + + + + + + + True + <b>timeline</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + False + True + + + + + + True + <b>FX anim</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + tab + + + + + 0 + True + True + + + + + + 32 + True + False + 0 + + + + + + + 0 + False + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + False + + + 0 + True + True + + + + + + True + [hostname] + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + [port] + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + + + + + True + Connect to Veejay + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ALWAYS + False + 356 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + Reloaded Launcher + + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + GTK_RELIEF_HALF + True + 0 + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_connect.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + _Connect + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_HALF + True + -7 + + + + + + 0 + False + False + GTK_PACK_END + + + + + + True + False + 3 + + + + 352 + 288 + True + veejay-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + True + True + + + + + + True + ver.3144 + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + True + True + 0 + + True + * + False + + + + 0 + True + True + + + + + + True + Open EditList/Videofile + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Open advanced properties dialog + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + gtk-preferences + 4 + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + + True + <b>Video File</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + Hostname/IP address + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + localhost + True + * + False + + + + + 0 + True + True + + + + + + True + Port + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 3490 1024 65535 1 4 4 + + + 0 + True + True + + + + + + + + True + <b>Connection settings</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + True + GTK_PROGRESS_LEFT_TO_RIGHT + 0 + 0.10000000149 + PANGO_ELLIPSIZE_NONE + + + 0 + False + False + GTK_PACK_END + + + + + + + + VIMS Bundles + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + 600 + 550 + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_HALF + True + -7 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + 1 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + + + + True + True + 0 + + + + True + New + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_new.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Load Actionfile + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Write Actionfile + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_saveas.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Set/Change Key + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_keybind.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Delete selected bundle + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Deatach Key from selected event + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_keydetach.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + 0 + False + True + + + + + + True + True + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + True + False + + + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + False + True + False + False + False + + + + + True + True + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + False + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + True + 0 + + + + True + Apply changes to this bundle + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + + True + Clear text + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_clear.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + True + True + + + + + 0 + False + True + + + + + 1 + False + True + + + + + + + + True + <b>Edit VIMS message contents </b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + GVeejay Reloaded - Preferences + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + True + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + True + + + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-close + True + GTK_RELIEF_HALF + True + -7 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + 2 + 4 + False + 2 + 5 + + + + True + Width + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Image format + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 2 + 1 + 2 + fill + + + + + + + True + Height + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 4096 1 10 10 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 4096 1 10 10 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + Type extension to select image format (jpeg, png, ...) + True + True + True + 12 + jpeg + True + * + False + 5 + + + 2 + 4 + 1 + 2 + fill + + + + + + 0 + False + True + + + + + + + + + + True + <b>Screenshot</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 2 + True + True + + + + + + False + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + 3 + 4 + False + 2 + 5 + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 176 1 800 1 10 10 + + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 144 1 800 1 10 10 + + + + 1 + 2 + 1 + 2 + fill + + + + + + + Frame delay + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 1 100 1 10 10 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + Keep 4:3 aspect + True + GTK_RELIEF_HALF + True + True + False + True + + + 2 + 4 + 1 + 2 + fill + + + + + + + True + FPS + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + False + 0 + + + + True + True + False + GTK_POS_TOP + 2 + GTK_UPDATE_CONTINUOUS + False + 0 0.019999999553 1 0.019999999553 0 0 + + + + 0 + True + True + + + + + 1 + 3 + 2 + 3 + fill + fill + + + + + + True + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 3 + 4 + 2 + 3 + fill + + + + + + + + + + + True + <b>Video preview</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 3 + True + True + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 1 + + + + True + True + Record video from Viewport + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + True + False + + + + + + True + Configure Viewport + True + GTK_RELIEF_NORMAL + True + + + 0 + False + False + + + + + + + + + + True + <b>Viewport settings</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 2 + True + True + + + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + 2 + 4 + False + 2 + 5 + + + + True + Width: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Height: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + X offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 0 + 1 + fill + + + + + + + True + Y offset: + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 2 + 3 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 2 0 4096 1 10 10 + + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + 3 + 4 + 0 + 1 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 0 4096 1 10 10 + + + 3 + 4 + 1 + 2 + fill + + + + + + 0 + True + True + + + + + + True + True + Keep 4:3 aspect + True + GTK_RELIEF_HALF + True + True + False + True + + + 0 + False + False + + + + + + True + True + Fullscreen (CTRL-F = window) + True + GTK_RELIEF_HALF + True + False + False + True + + + + 0 + False + False + + + + + + True + GTK_BUTTONBOX_START + 10 + + + + True + Apply changes to primary output settings + True + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-execute + 2 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Apply + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + + True + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-close + 2 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Close + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + + + 0 + True + True + + + + + + + + + + True + <b>Primary Video Window (SDL)</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 2 + True + True + + + + + 0 + True + True + + + + + 3 + True + True + + + + + + + + GVeejay Reloaded - New input stream + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + 400 + 400 + True + False + icon_stream.png + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + + 340 + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + True + True + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_NONE + GTK_CORNER_TOP_LEFT + + + + True + Double click to active, single click column for changing settings + True + True + False + False + True + False + False + False + + + + + + + + True + <b>Device</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + True + False + 0 + + + + True + 2 + 4 + False + 0 + 4 + + + + True + True + True + True + 200 + localhost + True + * + False + + + 2 + 3 + 0 + 1 + + + + + + + True + Remote + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + Use multicast + True + GTK_RELIEF_HALF + True + False + False + True + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Port Number + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 4490 1 65535 1 10 10 + + + 2 + 3 + 1 + 2 + + + + + + + True + True + Try + True + GTK_RELIEF_HALF + True + + + + 3 + 4 + 1 + 2 + + + + + + + + + True + <b>Network</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + False + 0 + + + + True + 2 + 5 + False + 0 + 4 + + + + True + Filename + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 1 + 2 + 0 + 1 + fill + + + + + + + True + True + use YUV4MPEG + True + GTK_RELIEF_HALF + True + False + False + True + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + True + use FFmpeg + True + GTK_RELIEF_HALF + True + False + False + True + inputstream_filey4m + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 2 + 4 + 0 + 1 + + + + + + + True + True + Try + True + GTK_RELIEF_HALF + True + + + 4 + 5 + 1 + 2 + fill + + + + + + + True + Load Actionfile + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_open.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 4 + 5 + 0 + 1 + fill + + + + + + + + + True + <b>File</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 0.0799999982119 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + veejay port + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + 3490 + True + * + False + + + 0 + False + True + + + + + + True + True + Create + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + + + + + + + True + <b>SHM</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + False + True + + + + + + True + True + False + 0 + + + + True + False + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + Single click to select, then fill in optional args and press create + True + True + False + False + True + False + False + False + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + 0 + 0.5 + GTK_SHADOW_NONE + + + + True + 0.5 + 0.5 + 1 + 0.0599999986589 + 0 + 0 + 12 + 0 + + + + True + False + 0 + + + + True + args: + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + True + True + True + True + 0 + + True + * + False + + + 0 + True + True + + + + + + True + True + Create + True + GTK_RELIEF_NORMAL + True + + + + 0 + False + False + + + + + + + + + 0 + False + True + + + + + 0 + False + True + + + + + + + + True + <b>Plugins</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + 0 + True + True + + + + + + True + 1 + 4 + False + 0 + 0 + + + + True + Close this window + True + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + gtk-close + 4 + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + Close + True + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + + + + + 3 + 4 + 0 + 1 + shrink + shrink + + + + + 0 + False + False + + + + + + + + + + True + <b>Stream types</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + + + + False + ladida + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + False + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + + + + True + False + 0 + + + + True + False + 0 + + + + True + 0 + 0 + GTK_SHADOW_NONE + + + + + + + 0 + True + True + + + + + + True + False + 0 + + + + True + Open Veejay Liveset / Action file + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + bg_red.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Save Veejay Liveset / Actionfile + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + True + bg_yellow.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + True + Cancel + True + GTK_RELIEF_HALF + True + + + + + True + icon_disconnect.png + 0.5 + 0.5 + 0 + 0 + + + + + 0 + False + False + + + + + + + + + + + + + + True + Play selected slot + True + GTK_RELIEF_HALF + True + + + + + True + 0.5 + 0.5 + 0 + 0 + 0 + 0 + 0 + 0 + + + + True + False + 2 + + + + True + icon_send.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + + + + 0 + False + False + + + + + + + + + + True + True + button119 + True + GTK_RELIEF_HALF + True + + + 0 + False + False + + + + + 0 + True + True + + + + + + True + False + GTK_POS_TOP + 0 + GTK_UPDATE_CONTINUOUS + False + 0.10000000149 0 1 0.00999999977648 0.10000000149 0 + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + diff --git a/veejay-current/reloaded-gtk3/share/smooth.rc b/veejay-current/reloaded-gtk3/share/smooth.rc new file mode 100644 index 00000000..2c7fe55b --- /dev/null +++ b/veejay-current/reloaded-gtk3/share/smooth.rc @@ -0,0 +1,118 @@ +# Edit these colors and fonts however you like. +style "default" +{ + engine "hcengine" {} + xthickness = 1 + ythickness = 1 + GtkWidget::shadow_type = GTK_SHADOW_ETCHED_OUT + #GtkWidget::interior_focus = 0 + #GtkWidget::focus_padding = 0 + #GtkWidget::default_border = {0, 0, 0, 0} + #GtkWidget::default_outside_border = {0, 0, 0, 0} + GtkWidget::default_spacing = 0 + GtkScale::stepper_size = 8 + GtkRange::through-width = 4 + GtkRange::trough_border = 0 + GtkRange::slider-width = 16 + GtkScale::slider-length = 10 + + font_name = "Trebuchet MS 8" + + fg[NORMAL] = "#000000" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#000000" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#c0c0c0" + + bg[NORMAL] = "#ffffff" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#c0c0c0" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#00ff00" + bg[INSENSITIVE] = "#ffffff" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#050505" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#c0c0c0" + base[PRELIGHT] = "#00fff0" # achtergrond van lists, status bars + base[ACTIVE] = "#0000ff" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + +style "text" +{ + font_name = "Sans 8" + + fg[NORMAL] = "#ffffff" # borders etc. + fg[PRELIGHT] = "#ffffff" + fg[ACTIVE] = "#ffffff" # ook borders, van sliders en notebook + fg[SELECTED] = "#ffffff" + fg[INSENSITIVE] = "#ffffff" + + bg[NORMAL] = "#27282F" # algemene achtergrond kleur + bg[PRELIGHT] = "#aaacc1" # achtergrond geselecteerd widget + bg[ACTIVE] = "#454f60" # niet actieve tabs, achtergrond sliders + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" # achtergrond kleur van niet actieve knopjes + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + +style "buttons" +{ + + font_name = "Sans 8" + + fg[NORMAL] = "#888888" + fg[PRELIGHT] = "#888888" + fg[ACTIVE] = "#888888" + fg[SELECTED] = "#888888" + fg[INSENSITIVE] = "#888888" + + bg[NORMAL] = "#27282F" + bg[PRELIGHT] = "#aaacc1" + bg[ACTIVE] = "#454f60" + bg[SELECTED] = "#5058a0" + bg[INSENSITIVE] = "#27282f" + + text[NORMAL] = "#d8d8d8" + text[PRELIGHT] = "#d8d8d8" + text[ACTIVE] = "#FF0000" + text[SELECTED] = "#FF0000" + text[INSENSITIVE] = "#404040" + + base[NORMAL] = "#37383f" + base[PRELIGHT] = "#aaacc1" + base[ACTIVE] = "#757f90" + base[SELECTED] = "#757ab3" + base[INSENSITIVE] = "#27282f" + +} + + + +class "GtkButton" style "default" +class "GtkSpinButton" style "default" +class "GtkToggleButton" style "default" +class "GtkCheckBox" style "default" + +class "GtkLabel" style "default" + +class "GtkWidget" style "default" diff --git a/veejay-current/reloaded-gtk3/share/sync.png b/veejay-current/reloaded-gtk3/share/sync.png new file mode 100644 index 00000000..471b269b Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/sync.png differ diff --git a/veejay-current/reloaded-gtk3/share/veejay-icon.png b/veejay-current/reloaded-gtk3/share/veejay-icon.png new file mode 100644 index 00000000..c925fd92 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/veejay-icon.png differ diff --git a/veejay-current/reloaded-gtk3/share/veejay-logo-small.png b/veejay-current/reloaded-gtk3/share/veejay-logo-small.png new file mode 100644 index 00000000..457745d1 Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/veejay-logo-small.png differ diff --git a/veejay-current/reloaded-gtk3/share/veejay-logo.png b/veejay-current/reloaded-gtk3/share/veejay-logo.png new file mode 100644 index 00000000..34f421dd Binary files /dev/null and b/veejay-current/reloaded-gtk3/share/veejay-logo.png differ diff --git a/veejay-current/reloaded-gtk3/src/Makefile.am b/veejay-current/reloaded-gtk3/src/Makefile.am new file mode 100644 index 00000000..22428938 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/Makefile.am @@ -0,0 +1,16 @@ +## Process this file with automake to produce Makefile.in +MAINTAINERCLEANFILES = Makefile.in +AM_CFLAGS=$(OP_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src \ + $(VEEJAY_CFLAGS) $(GTK_CFLAGS) \ + $(FFMPEG_CFLAGS) \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -DRELOADED_DATADIR=\""$(reloaded_datadir)"\" + +RELOADED_BIN=reloaded +reloaded_SOURCES = cellrendererspin.c gtktimeselection.c vj-midi.c curve.c utils.c tracksources.c gveejay.c keyboard.c sequence.c multitrack.c vj-api.c mjpeg_logging.c mpegconsts.c mpegtimecode.c yuv4mpeg.c yuv4mpeg_ratio.c gtk3curve.c ${reloaded_headers} + +bin_PROGRAMS = $(RELOADED_BIN) + +reloaded_LDFLAGS = $(VEEJAY_LIBS) $(GTK_LIBS) \ +$(ALSA_LIBS) $(LIBM_LIBS) $(DEBUGLIBS) -export-dynamic -lgmodule-2.0 -lgthread-2.0 diff --git a/veejay-current/reloaded-gtk3/src/callback.c b/veejay-current/reloaded-gtk3/src/callback.c new file mode 100644 index 00000000..1e7c0f20 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/callback.c @@ -0,0 +1,4837 @@ +/* gveejay - Linux VeeJay - GVeejay GTK+-2/Glade User Interface + * (C) 2002-2015 Niels Elburg + * (C) 2006 Matthijs van Henten + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include "callback.h" + +static int config_file_status = 0; +static gchar *config_file = NULL; +static int srt_locked_ = 0; +static int srt_seq_ = 0; + +static int bg_[4]; +static int fg_[4]; +static int ln_[4]; + +static int sample_calctime(); + +static void change_box_color_rgb( GtkWidget *box, int r, int g, int b,int a, int fill ); + +void text_defaults() +{ + bg_[0] = 255; bg_[1] = 255; bg_[2] = 255; bg_[3] = 0; + fg_[0] = 0; fg_[1] = 0; fg_[2] = 0; fg_[3] = 0; + ln_[0] = 200; ln_[1] = 255; ln_[1] = 255; ln_[3] = 0; + srt_seq_ = 0; +} + +void on_no_caching_clicked( GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_NO_CACHING ); +} + +void on_button_085_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims(VIMS_VIDEO_SKIP_SECOND); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_SKIP_SECOND ); +} +void on_button_086_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims(VIMS_VIDEO_PREV_SECOND ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_PREV_SECOND ); + +} +void on_button_080_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims(VIMS_VIDEO_PLAY_FORWARD); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_PLAY_FORWARD ); + +} +void on_button_081_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims(VIMS_VIDEO_PLAY_BACKWARD); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_PLAY_BACKWARD ); +} +void on_button_082_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VIDEO_PLAY_STOP ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_PLAY_STOP ); +} +void on_button_083_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VIDEO_SKIP_FRAME ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_SKIP_FRAME ); +} +void on_button_084_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VIDEO_PREV_FRAME ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_PREV_FRAME ); +} +void on_button_087_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VIDEO_GOTO_START ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_GOTO_START ); +} +void on_button_088_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VIDEO_GOTO_END); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_VIDEO_GOTO_END ); +} + +void on_videobar_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + gdouble slider_val = gtk_adjustment_get_value (a); + gint val = 0; + switch(info->status_tokens[PLAY_MODE]) + { + case MODE_PLAIN: + val = slider_val * info->status_tokens[TOTAL_FRAMES]; + break; + case MODE_SAMPLE: + val = slider_val * (info->status_tokens[SAMPLE_END] - info->status_tokens[SAMPLE_START]); + val += info->status_tokens[SAMPLE_START]; + break; + default: + return; + } + multi_vims( VIMS_VIDEO_SET_FRAME, "%d", val ); + + vj_midi_learning_vims_simple( info->midi, "videobar", VIMS_VIDEO_SET_FRAME ); + } +} + +void on_subrender_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + multi_vims( VIMS_SUB_RENDER,"%d",0); +} + +void on_button_001_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_SET_PLAIN_MODE ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_SET_PLAIN_MODE ); +} + +void on_feedbackbutton_toggled( GtkWidget *widget, gpointer data ) +{ + if(!info->status_lock) { + int val = is_button_toggled( "feedbackbutton" ) ? 1:0; + multi_vims( VIMS_FEEDBACK, "%d", val ); + } +} + +static int follow_return_id = 0; +static int follow_return_type = 0; + +void on_fx_followfade_toggled( GtkWidget *widget, gpointer data ) +{ + int val = is_button_toggled( "fx_followfade" ) ? 1:0; + follow_return_id = info->status_tokens[CURRENT_ID]; + follow_return_type = info->status_tokens[PLAY_MODE]; + multi_vims( VIMS_CHAIN_FOLLOW_FADE,"%d", val ); +} + +void on_button_return_clicked( GtkWidget *widget, gpointer data) +{ + multi_vims( (follow_return_type == 0 ? VIMS_SAMPLE_SELECT: VIMS_STREAM_SELECT),"%d", follow_return_id ); +} + +void on_button_252_clicked( GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_DEBUG_LEVEL ); + if(is_button_toggled( "button_252" )) + vims_verbosity = 1; + else + vims_verbosity = 0; + vj_msg(VEEJAY_MSG_INFO, "%s debug information", + vims_verbosity ? "Displaying" : "Not displaying" ); +} + +void on_button_251_clicked( GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_BEZERK ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_BEZERK ); + vj_msg(VEEJAY_MSG_INFO, "Bezerk mode toggled"); +} + +void on_entry_samplename_button_clicked( GtkWidget *widget, gpointer user_data ) +{ + gchar *title = get_text( "entry_samplename" ); + multi_vims( VIMS_SAMPLE_SET_DESCRIPTION, "%d %s", 0,title ); + + //@ dont reload sample, print info to samplebank + int i,j; + for( i= 0; i < NUM_BANKS; i ++ ) + { + for( j = 0; j < NUM_SAMPLES_PER_PAGE ; j ++ ) + { + if( (info->sample_banks[i]->slot[j]->sample_id == + info->status_tokens[CURRENT_ID]) ) + { + gtk_frame_set_label( GTK_FRAME( info->sample_banks[i]->gui_slot[j]->frame ) , title ); + return; + } + } + } +} + +void on_button_054_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *ext = get_text( "screenshotformat" ); + if(ext) + { + gchar filename[100]; + sprintf(filename, "frame-%d.%s", info->status_tokens[FRAME_NUM] + 1 , ext); + gint w = get_nums("screenshot_width"); + gint h = get_nums("screenshot_height"); + multi_vims( VIMS_SCREENSHOT,"%d %d %s",w,h,filename ); + vj_msg(VEEJAY_MSG_INFO, "Requested screenshot '%s' of frame %d", + filename, info->status_tokens[FRAME_NUM] + 1 ); + } +} +void on_button_200_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_EFFECT_SET_BG ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_EFFECT_SET_BG ); + vj_msg(VEEJAY_MSG_INFO, + "Requested background mask of frame %d", + info->status_tokens[FRAME_NUM] + 1 ); +} +void on_button_5_4_clicked(GtkWidget *widget, gpointer user_data) +{ + if( is_button_toggled("button_5_4") ) + { + single_vims( VIMS_AUDIO_ENABLE ); + vj_msg(VEEJAY_MSG_INFO, "Audio is enabled"); + vj_midi_learning_vims_simple(info->midi, NULL, VIMS_AUDIO_ENABLE ); + } + else + { + single_vims( VIMS_AUDIO_DISABLE ); + vj_msg(VEEJAY_MSG_INFO, "Audio is disabled"); + vj_midi_learning_vims_simple(info->midi, NULL, VIMS_AUDIO_DISABLE ); + } + +} +void on_button_samplestart_clicked(GtkWidget *widget, gpointer user_data) +{ + info->sample[0] = info->status_tokens[FRAME_NUM]; + vj_msg(VEEJAY_MSG_INFO, "New sample startings position is %d", + info->sample[0] ); +} +void on_button_sampleend_clicked(GtkWidget *widget, gpointer user_data) +{ + info->sample[1] = info->status_tokens[FRAME_NUM]; + multi_vims( VIMS_SAMPLE_NEW, "%d %d", info->sample[0],info->sample[1]); + vj_msg(VEEJAY_MSG_INFO, "New sample from EditList %d - %d", + info->sample[0], info->sample[1]); + gveejay_new_slot(MODE_SAMPLE); +} + +void on_button_veejay_clicked(GtkWidget *widget, gpointer user_data) +{ +#ifdef STRICT_CHECKING + //assert( info->watch.state == STATE_WAIT_FOR_USER ); +#endif + info->watch.state = STATE_CONNECT; +} +void on_button_sendvims_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *text = get_text("vimsmessage"); + if(strncasecmp( text, "600:;",5 ) == 0) + veejay_quit(); + vj_msg(VEEJAY_MSG_INFO, "User defined VIMS message sent '%s'",text ); + msg_vims( text ); +} +void on_vimsmessage_activate(GtkWidget *widget, gpointer user_data) +{ + msg_vims( get_text( "vimsmessage") ); + vj_midi_learning_vims( info->midi, NULL, get_text("vimsmessage"),0); + vj_msg(VEEJAY_MSG_INFO, "User defined VIMS message sent '%s'", get_text("vimsmessage")); +} + +void on_button_fadedur_value_changed(GtkWidget *widget, gpointer user_data) +{ + +} + +void on_toggle_fademethod_toggled(GtkWidget *w, gpointer user_data) +{ + if(info->status_lock) + return; + + multi_vims( VIMS_CHAIN_FADE_ALPHA,"%d %d",0, is_button_toggled("toggle_fademethod") ); +} + +/* 0 = normal chain fade + * 1 = source entry FX + * 2 = source mixing B + */ + +void on_fx_m2_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + multi_vims( VIMS_CHAIN_FADE_METHOD, "%d %d",0, 2 ); + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d", 0, info->uc.selected_chain_entry ); +} + +void on_fx_m1_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + multi_vims( VIMS_CHAIN_FADE_METHOD, "%d %d",0, 1); + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d",0, info->uc.selected_chain_entry); +} + +void on_fx_m3_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + multi_vims( VIMS_CHAIN_FADE_METHOD, "%d %d",0, 3); + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d", 0, info->uc.selected_chain_entry ); +} + +void on_fx_m4_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + multi_vims( VIMS_CHAIN_FADE_METHOD, "%d %d",0, 4); + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d", 0, info->uc.selected_chain_entry ); +} +void on_fx_mnone_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + multi_vims( VIMS_CHAIN_FADE_METHOD, "%d %d",0, 0); + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d", 0, -1); +} + +void on_button_fadeout_clicked(GtkWidget *w, gpointer user_data) +{ + gint num = (gint)get_numd( "button_fadedur"); + char *timenow = format_time( num, info->el.fps ); + int vims_id = is_button_toggled( "toggle_fademethod" ) ? VIMS_CHAIN_FADE_OUT: VIMS_CHAIN_FADE_IN; + multi_vims( vims_id, "0 %d", num ); + vj_midi_learning_vims_complex( info->midi, "button_fadedur", vims_id, 0, num ); + vj_msg(VEEJAY_MSG_INFO, "Fade out duration %s (frames %d)",timenow,num ); + if(timenow) free(timenow); +} + +void on_button_fadein_clicked(GtkWidget *w, gpointer user_data) +{ + gint num = (gint)get_numd( "button_fadedur"); + char *timenow = format_time( num, info->el.fps ); + int vims_id = is_button_toggled( "toggle_fademethod" ) ? VIMS_CHAIN_FADE_IN: VIMS_CHAIN_FADE_OUT; + multi_vims( vims_id, "0 %d", num ); + vj_midi_learning_vims_complex( info->midi, "button_fadedur",vims_id, 0,num ); + vj_msg(VEEJAY_MSG_INFO, "Fade in duration %s (frames %d)",timenow,num ); + if(timenow) free(timenow); +} + +void on_manualopacity_value_changed(GtkWidget *w, gpointer user_data) +{ + if(info->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gdouble val = gtk_adjustment_get_value (a); + int mode = is_button_toggled("toggle_fademethod"); + int value = ( mode == 1 ? 0xff - (int) val : (int) val ); + + multi_vims( VIMS_CHAIN_MANUAL_FADE, "0 %d", value ); + + vj_midi_learning_vims_complex( info->midi, "manualopacity", VIMS_CHAIN_FADE_IN, 0,1 ); + + vj_msg(VEEJAY_MSG_INFO, "FX Opacity set to %1.2f", val ); +} + +static void el_selection_update() +{ + gchar *text = format_selection_time(info->selection[0], info->selection[1]); + update_label_str( "label_el_selection", text ); + vj_msg( VEEJAY_MSG_INFO, "Updated EditList selection %d - %d Timecode: %s", + info->selection[0], info->selection[1], text ); + g_free(text); +} + +void on_button_el_selstart_value_changed(GtkWidget *w, gpointer user_data) +{ + info->selection[0] = get_nums("button_el_selstart"); + if( info->selection[0] > info->selection[1]) + update_spin_value( "button_el_selend", info->selection[0]); + char *text = format_time( info->selection[0], info->el.fps ); + update_label_str( "label_el_startpos", text); + free(text); + el_selection_update(); +} + +void on_button_el_selend_value_changed(GtkWidget *w, gpointer user_data) +{ + info->selection[1] = get_nums( "button_el_selend" ); + if(info->selection[1] < info->selection[0]) + update_spin_value( "button_el_selstart", info->selection[1]); + char *text = format_time( info->selection[1], info->el.fps); + update_label_str( "label_el_endpos", text); + free(text); + el_selection_update(); +} + +static gboolean verify_selection() +{ + if( (info->selection[1] - info->selection[0] ) <= 0) + { + vj_msg(VEEJAY_MSG_ERROR, "Invalid EditList selection %d - %d", + info->selection[0], info->selection[1]); + return FALSE; + } + return TRUE; +} + +void on_button_el_cut_clicked(GtkWidget *w, gpointer *user_data) +{ + if(verify_selection()) + { multi_vims( VIMS_EDITLIST_CUT, "%d %d", + info->selection[0], info->selection[1]); + char *time1 = format_time( info->selection[0], info->el.fps ); + char *time2 = format_time( info->selection[1], info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Cut %s - %s from EditList to buffer", + time1, time2 ); + free(time1); + free(time2); + info->uc.reload_hint[HINT_EL] = 1; + } +} +void on_button_el_del_clicked(GtkWidget *w, gpointer *user_data) +{ + if(verify_selection()) + { + multi_vims( VIMS_EDITLIST_DEL, "%d %d", + info->selection[0], info->selection[1]); + char *time1 = format_time( info->selection[0],info->el.fps ); + char *time2 = format_time( info->selection[1],info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Delete %s - %s from EditList", + time1, time2 ); + free(time1); + free(time2); + update_spin_value( "button_el_selstart", 0 ); + update_spin_value( "button_el_selend", 0); + } +} +void on_button_el_crop_clicked(GtkWidget *w, gpointer *user_data) +{ + if(verify_selection()) + { + multi_vims( VIMS_EDITLIST_CROP, "%d %d", + info->selection[0], info->selection[1]); + char *total = format_time( info->status_tokens[TOTAL_FRAMES],info->el.fps ); + char *time2 = format_time( info->selection[1],info->el.fps ); + char *time1 = format_time( info->selection[0],info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Delete 00:00:00 - %s and %s - %s from EditList", + time1, time2, total ); + free(time1); + free(time2); + free(total); + + } +} +void on_button_el_copy_clicked(GtkWidget *w, gpointer *user_data) +{ + if(verify_selection()) + { + multi_vims( VIMS_EDITLIST_COPY, "%d %d", + info->selection[0], info->selection[1] ); + char *time1 = format_time( info->selection[0],info->el.fps ); + char *time2 = format_time( info->selection[1],info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Copy %s - %s to buffer", + time1,time2); + free(time1); + free(time2); + } +} + +void on_button_el_newclip_clicked(GtkWidget *w, gpointer *user) +{ + if(verify_selection()) + { + multi_vims( VIMS_SAMPLE_NEW, "%d %d", + info->selection[0], info->selection[1] ); + vj_msg(VEEJAY_MSG_INFO, "New sample from EditList %d - %d" , + info->selection[0], info->selection[1] ); + gveejay_new_slot(MODE_SAMPLE); + } +} + +void on_button_el_pasteat_clicked(GtkWidget *w, gpointer *user_data) +{ + gint val = get_nums( "button_el_selpaste" ); + info->selection[2] = val; + multi_vims( VIMS_EDITLIST_PASTE_AT, "%d", + info->selection[2]); + char *time1 = format_time( info->selection[2],info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Paste contents from buffer to frame %d (timecode %s)", + info->selection[2], time1); + free(time1); + info->uc.reload_hint[HINT_EL] = 1; + +} +void on_button_el_save_clicked(GtkWidget *w, gpointer *user_data) +{ + gchar *filename = dialog_save_file( "Save EditList" ); + if(filename) + { + multi_vims( VIMS_EDITLIST_SAVE, "%s %d %d", + filename, 0, info->el.num_frames ); + vj_msg(VEEJAY_MSG_INFO, "Saved EditList to %s", filename); + g_free(filename); + } +} +void on_button_el_savesel_clicked(GtkWidget *w, gpointer *user_data) +{ + gchar *filename = dialog_save_file( "Save EditList Selection" ); + if(filename) + { + gint start = get_nums( "button_el_selstart" ); + gint end = get_nums( "button_el_selend" ); + multi_vims( VIMS_EDITLIST_SAVE, "%s %d %d", + filename, start, end ); + vj_msg(VEEJAY_MSG_INFO,"Save EditList selection to %s", filename); + g_free(filename); + } +} + +void on_button_el_add_clicked(GtkWidget *w, gpointer *user_data) +{ + gchar *filename = dialog_open_file( "Append videofile to EditList",0 ); + if(filename) + { + multi_vims( VIMS_EDITLIST_ADD, "%s", + filename ); + vj_msg(VEEJAY_MSG_INFO, "Try to add file '%s' to EditList", filename); + g_free(filename); + } +} +void on_button_el_addsample_clicked(GtkWidget *w, gpointer *user_data) +{ + gchar *filename = dialog_open_file( "Append videofile (and create sample)",0); + if( !filename ) + return; + + multi_vims( VIMS_EDITLIST_ADD_SAMPLE, "%d %s", 0, filename ); + g_free(filename); +} + +void on_button_el_delfile_clicked(GtkWidget *w, gpointer *user_data) +{ + int frame = _el_ref_start_frame( info->uc.selected_el_entry ); + int first_frame = frame; + int last_frame = _el_ref_end_frame( info->uc.selected_el_entry ); + multi_vims( VIMS_EDITLIST_DEL, "%d %d", first_frame, last_frame ); + char *time1 = format_time( first_frame,info->el.fps ); + char *time2 = format_time( last_frame,info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Delete %s - %s", + time1,time2); + free(time1); + free(time2); +} +void on_button_fx_clearchain_clicked(GtkWidget *w, gpointer user_data) +{ + multi_vims( VIMS_CHAIN_CLEAR, "%d",0); + info->uc.reload_hint[HINT_CHAIN] = 1; + info->uc.reload_hint[HINT_ENTRY] = 1; + vj_midi_learning_vims_msg( info->midi, NULL, VIMS_CHAIN_CLEAR,0 ); + vj_msg(VEEJAY_MSG_INFO, "Clear FX Chain"); +} + +void on_button_entry_toggle_clicked(GtkWidget *w, gpointer user_data) +{ + if(!info->status_lock) + { + gint val = is_button_toggled( "button_entry_toggle" ); + int vims_id = VIMS_CHAIN_ENTRY_SET_VIDEO_OFF; + if(val) + vims_id = VIMS_CHAIN_ENTRY_SET_VIDEO_ON; + multi_vims( vims_id,"%d %d", 0, info->uc.selected_chain_entry ); + + vj_midi_learning_vims_msg2( info->midi, NULL, vims_id, 0, info->uc.selected_chain_entry ); + vj_msg(VEEJAY_MSG_INFO, "Chain Entry %d is %s", + info->uc.selected_chain_entry, + (val ? "Enabled" : "Disabled" )); + info->uc.reload_hint[HINT_ENTRY] = 1; + } +} + +void on_button_fx_entry_value_changed(GtkWidget *w, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_CHAIN_SET_ENTRY, "%d", + (gint) gtk_spin_button_get_value( GTK_SPIN_BUTTON(w)) + ); + vj_midi_learning_vims_spin( info->midi, "button_fx_entry", VIMS_CHAIN_SET_ENTRY ); + } +} + +void on_button_fx_del_clicked(GtkWidget *w, gpointer user_data) +{ + multi_vims( VIMS_CHAIN_ENTRY_CLEAR, "%d %d", 0, + info->uc.selected_chain_entry ); + info->uc.reload_hint[HINT_ENTRY] = 1; + info->uc.reload_hint[HINT_CHAIN] = 1; + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_CHAIN_ENTRY_CLEAR, 0, info->uc.selected_chain_entry ); + vj_msg(VEEJAY_MSG_INFO, "Clear Effect from Entry %d", + info->uc.selected_chain_entry); +} + +static void gen_changed( int num, int value ) +{ + int i; + int values[16]; + + if(!info->status_lock && !info->parameter_lock) + { + info->parameter_lock = 1; + + for( i = 0; gen_names_[i].text != NULL; i ++ ) { + if( num == i ) { + values[num] = value; + } + else { + GtkWidget *w = glade_xml_get_widget_( info->main_window, gen_names_[i].text ); + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + values[i] = gtk_adjustment_get_value (a); + } + } + + char line[255]; + snprintf(line,sizeof(line), "%d:0 %d %d %d %d %d %d %d %d %d %d;", + VIMS_STREAM_SET_ARG, + values[0],values[1],values[2],values[3],values[4],values[5], + values[6],values[7],values[8],values[9]); + msg_vims(line); + + info->parameter_lock = 0; + } + +} + +static void genv_changed( int num, int value, const char *selected ) +{ + int i; + int values[16]; + + if(!info->status_lock && !info->parameter_lock) + { + info->parameter_lock = 1; + + for( i = 0; gen_names_[i].text != NULL; i ++ ) { + GtkWidget *w = glade_xml_get_widget_( info->main_window, gen_names_[i].text ); + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + if( num == i ) { + update_slider_value( gen_names_[i].text, (get_slider_val(gen_names_[i].text) + value), 0 );\ + values[i] = (gint) gtk_adjustment_get_value (a); + } + else { + values[i] = (gint) gtk_adjustment_get_value (a); + } + } + + char line[255]; + snprintf(line,sizeof(line), "%d:0 %d %d %d %d %d %d %d %d %d %d;", + VIMS_STREAM_SET_ARG, + values[0],values[1],values[2],values[3],values[4],values[5], + values[6],values[7],values[8],values[9]); + msg_vims(line); + + info->parameter_lock = 0; + } +} + +void on_slider_p0_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 0, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p1_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 1, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p2_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 2, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p3_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 3, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p4_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 4, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p5_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 5, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p6_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 6, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p7_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 7, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p8_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 8, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p9_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 9, (gint)gtk_adjustment_get_value (a) ); +} + +void on_slider_p10_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 10, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p11_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 11, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p12_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 12, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p13_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 13, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p14_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 14, (gint)gtk_adjustment_get_value (a) ); +} +void on_slider_p15_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + SLIDER_CHANGED( 15, (gint)gtk_adjustment_get_value (a) ); +} + +void on_inc_p0_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 0, 1 , "slider_p0" ); +} +void on_dec_p0_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 0, -1, "slider_p0"); +} +void on_inc_p1_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 1, 1 , "slider_p1" ); +} +void on_dec_p1_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 1, -1, "slider_p1"); + +} +void on_inc_p2_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 2, 1 , "slider_p2" ); +} +void on_dec_p2_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 2, -1, "slider_p2"); +} +void on_inc_p3_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 3, 1 , "slider_p3" ); +} + void on_dec_p3_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 3, -1, "slider_p3"); +} +void on_inc_p4_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(4, 1 , "slider_p4" ); +} +void on_dec_p4_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 4, -1, "slider_p4"); +} + +void on_inc_p5_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(5, 1 , "slider_p5" ); +} +void on_dec_p5_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 5, -1, "slider_p5"); +} + +void on_inc_p6_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(6, 1 , "slider_p6" ); +} +void on_dec_p6_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 6, -1, "slider_p6"); +} + +void on_inc_p7_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(7, 1 , "slider_p7" ); +} +void on_dec_p7_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 7, -1, "slider_p7"); +} +void on_inc_p8_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(8, 1 , "slider_p8" ); +} +void on_dec_p8_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 8, -1, "slider_p8"); +} +void on_inc_p9_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(9, 1 , "slider_p9" ); +} +void on_dec_p9_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 9, -1, "slider_p9"); +} +void on_inc_p10_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(10, 1 , "slider_p10" ); +} +void on_dec_p10_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 10, -1, "slider_p10"); +} +void on_inc_p11_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(11, 1 , "slider_p11" ); +} +void on_dec_p11_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 11, -1, "slider_p11"); +} +void on_inc_p12_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(12, 1 , "slider_p12" ); +} +void on_dec_p12_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 12, -1, "slider_p12"); +} +void on_inc_p13_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(13, 1 , "slider_p13" ); +} +void on_dec_p13_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 13, -1, "slider_p13"); +} +void on_inc_p14_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(14, 1 , "slider_p14" ); +} +void on_dec_p14_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 14, -1, "slider_p14"); +} +void on_inc_p15_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED(15, 1 , "slider_p15" ); +} +void on_dec_p15_clicked(GtkWidget *w, gpointer user_data) +{ + PARAM_CHANGED( 15, -1, "slider_p15"); +} + +void slider_g0_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 0, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g1_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 1, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g2_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 2, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g3_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 3, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g4_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 4, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g5_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 5, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g6_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 6, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g7_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 7, (gint)gtk_adjustment_get_value (a) ); +} + +void slider_g8_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 8, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g9_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 9, (gint)gtk_adjustment_get_value (a) ); +} +void slider_g10_value_changed(GtkWidget *w, gpointer user_data) +{ + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gen_changed( 10, (gint)gtk_adjustment_get_value (a) ); +} + +void on_inc_g0_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(0, 1 , "slider_g0" ); +} +void on_dec_g0_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(0, -1, "slider_g0"); +} + +void on_inc_g1_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(1, 1 , "slider_g1" ); +} +void on_dec_g1_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(1, -1, "slider_g1"); +} + +void on_inc_g2_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(2, 1 , "slider_g2" ); +} +void on_dec_g2_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(2, -1, "slider_g2"); +} +void on_inc_g3_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(3, 1 , "slider_g3" ); +} +void on_dec_g3_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(3, -1, "slider_g3"); +} +void on_inc_g4_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(4, 1 , "slider_g4" ); +} +void on_dec_g4_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(4, -1, "slider_g4"); +} +void on_inc_g5_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(5, 1 , "slider_g5" ); +} +void on_dec_g5_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(5, -1, "slider_g5"); +} +void on_inc_g6_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(6, 1 , "slider_g6" ); +} +void on_dec_g6_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(6, -1, "slider_g6"); +} +void on_inc_g7_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(7, 1 , "slider_g7" ); +} +void on_dec_g7_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(7, -1, "slider_g7"); +} +void on_inc_g8_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(8, 1 , "slider_g8" ); +} +void on_dec_g8_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(8, -1, "slider_g8"); +} +void on_inc_g9_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(9, 1 , "slider_g9" ); +} +void on_dec_g9_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(9, -1, "slider_g9"); +} +void on_inc_g10_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(10, 1 , "slider_g9" ); +} +void on_dec_g10_clicked(GtkWidget *w, gpointer user_data) +{ + genv_changed(10, -1, "slider_g9"); +} + + + + + +void on_button_stoplaunch_clicked(GtkWidget *widget, gpointer user_data) +{ + if( info->watch.state == STATE_PLAYING) + { + info->watch.state = STATE_DISCONNECT; + } +} + +void on_button_sample_play_clicked(GtkWidget *widget, gpointer user_data) +{ + if(info->selection_slot) + { + multi_vims( VIMS_SET_MODE_AND_GO , "%d %d" , + (info->selection_slot->sample_type == MODE_SAMPLE ? MODE_SAMPLE : MODE_STREAM), + info->selection_slot->sample_id ); + + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SET_MODE_AND_GO, + (info->selection_slot->sample_type == MODE_SAMPLE ? MODE_SAMPLE : MODE_STREAM ), + info->selection_slot->sample_id ); + } +} +void on_button_sample_del_clicked(GtkWidget *widget, gpointer user_data) +{ + if( info->selection_slot ) + remove_sample_from_slot(); +} +void on_button_samplelist_load_clicked(GtkWidget *widget, gpointer user_data) +{ + gint erase_all = 0; + if(info->status_tokens[TOTAL_SLOTS] > 0 ) + { + if(prompt_dialog("Load samplelist", + "Loading a samplelist will delete any existing samples" ) == GTK_RESPONSE_REJECT) + return; + else + erase_all = 1; + } + + gchar *filename = dialog_open_file( "Open samplelist",1); + if(filename) + { + if(erase_all) + { + info->uc.reload_hint[HINT_SLIST] = 2; /* with bank reset */ + single_vims( VIMS_SAMPLE_DEL_ALL ); + } + multi_vims( VIMS_SAMPLE_LOAD_SAMPLELIST, "%s", filename ); + + g_free(filename ); + } +} +static char samplelist_name[1024]; +static int has_samplelist_name = 0; + +void on_button_samplelist_save_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_save_file( "Save samplelist"); + if(filename) + { + multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s", filename ); + vj_msg(VEEJAY_MSG_INFO, "Saved samples to %s", filename); + strncpy( samplelist_name, filename,strlen(filename)); + has_samplelist_name = 1; + g_free(filename); + } +} + +gboolean on_button_samplelist_qsave_clicked(GtkWidget *widget, GdkEvent *event, gpointer user_data) +{ + //save as if shift click + if(event && ((GdkEventButton *) event)->state & GDK_SHIFT_MASK) { + has_samplelist_name = 0; + } + + if( has_samplelist_name == 0 ) { + gchar *filename = dialog_save_file( "Save samplelist"); + if(filename) + { + multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s", filename ); + vj_msg(VEEJAY_MSG_INFO, "Saved samples to %s", filename); + strncpy( samplelist_name, filename, strlen(filename)); + g_free(filename); + has_samplelist_name = 1; + } + } + else { + multi_vims( VIMS_SAMPLE_SAVE_SAMPLELIST, "%s" , samplelist_name ); + vj_msg(VEEJAY_MSG_INFO, "Quick saved samples to %s" , samplelist_name ); + } + return TRUE; +} + + +void on_spin_samplestart_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + gint value = (gint) gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) ); + char *time1 = format_time(value,info->el.fps); + multi_vims(VIMS_SAMPLE_SET_START, "%d %d",0, value ); + vj_msg(VEEJAY_MSG_INFO, "Set sample's starting position to %d (timecode %s)", + value, time1); + free(time1); + } +} + +void on_spin_sampleend_value_changed( GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + gint value = (gint) gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) ); + char *time1 = format_time(value,info->el.fps); + + multi_vims(VIMS_SAMPLE_SET_END, "%d %d", 0, value ); + vj_msg(VEEJAY_MSG_INFO, "Set sample's ending position to %d (timecode %s)", + value, time1); + free(time1); + + } +} + +void on_slow_slider_value_changed( GtkWidget *widget, gpointer user_data ) +{ + if(!info->status_lock) { + gint value = (gint) get_slider_val("slow_slider"); + multi_vims(VIMS_VIDEO_SET_SLOW, "%d", value ); + value ++; + vj_msg(VEEJAY_MSG_INFO, "Slow video to %2.2f fps", + info->el.fps / (float) value ); + vj_midi_learning_vims_simple(info->midi, "slow_slider",VIMS_VIDEO_SET_SLOW); + } +} + + +void on_speed_slider_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + gint value = (gint) get_slider_val( "speed_slider" ); + // value *= info->play_direction; + multi_vims( VIMS_VIDEO_SET_SPEED, "%d", value ); + vj_msg(VEEJAY_MSG_INFO, "Change video playback speed to %d", + value ); + vj_midi_learning_vims_simple( info->midi, "speed_slider", VIMS_VIDEO_SET_SPEED ); + } +} + +void on_spin_samplespeed_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + gint value = (gint) gtk_spin_button_get_value( GTK_SPIN_BUTTON(widget) ); + value *= info->play_direction; + multi_vims( VIMS_SAMPLE_SET_SPEED, "%d %d",0, value ); + vj_midi_learning_vims_complex( info->midi, "spin_samplespeed", VIMS_SAMPLE_SET_SPEED,0,2 ); + vj_msg(VEEJAY_MSG_INFO, "Change video playback speed to %d", + value ); + } +} + +void on_v4l_brightness_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_BRIGHTNESS, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0) ); + vj_midi_learning_vims_complex( info->midi, "v4l_brightness", VIMS_STREAM_SET_BRIGHTNESS, info->selected_slot->sample_id, + 1 ); + } +} + +void on_v4l_contrast_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_CONTRAST, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0 ) ); + vj_midi_learning_vims_complex( info->midi, "v4l_contrast", VIMS_STREAM_SET_CONTRAST, info->selected_slot->sample_id, + 1 ); + + } +} + +void on_v4l_hue_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_HUE, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0 ) ); + vj_midi_learning_vims_complex( info->midi, "v4l_hue", VIMS_STREAM_SET_HUE, info->selected_slot->sample_id, + 1 ); + + } +} + +void on_v4l_gamma_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_WHITE, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0 ) ); + vj_midi_learning_vims_complex( info->midi, "v4l_white", VIMS_STREAM_SET_WHITE, info->selected_slot->sample_id, + 1 ); + + } +} + +void on_v4l_color_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_COLOR, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0) ); + vj_midi_learning_vims_complex( info->midi, "v4l_color", VIMS_STREAM_SET_COLOR, info->selected_slot->sample_id, + 1 ); + + } +} +void on_v4l_saturation_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_SATURATION, "%d %d", + info->selected_slot->sample_id, + (gint) (gtk_adjustment_get_value (a) * 65535.0) ); + vj_midi_learning_vims_complex( info->midi, "v4l_saturation", VIMS_STREAM_SET_SATURATION, info->selected_slot->sample_id, + 1 ); + + } +} + +/* no midi support yet for the following v4l controls (FIXME) */ +void on_v4l_gain_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d gain", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_redbalance_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d red_balance", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_bluebalance_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d blue_balance", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_greenbalance_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d green_balance", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_sharpness_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d sharpness", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_backlightcompensation_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d bl_compensate", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_temperature_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d temperature", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_exposure_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d exposure", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_whiteness_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d whiteness", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_v4l_black_level_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( widget )); + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d black_level", + info->selected_slot->sample_id, + (int)(gtk_adjustment_get_value (a) * 65535.0) ); + } +} +void on_check_autogain_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d auto_gain", info->selected_slot->sample_id,is_button_toggled("check_autogain")); + } +} +void on_check_autohue_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d auto_hue", info->selected_slot->sample_id,is_button_toggled("check_autohue")); + } +} +void on_check_flip_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d fliph", info->selected_slot->sample_id,is_button_toggled("check_flip")); + } +} +void on_check_flipv_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d flipv", info->selected_slot->sample_id,is_button_toggled("check_flipv")); + } +} +void on_check_autowhitebalance_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_STREAM_SET_V4LCTRL, "%d %d auto_white", info->selected_slot->sample_id,is_button_toggled("chekc_autowhitebalance")); + } +} + +//~ NOT USED +//~ #ifndef HAVE_GTK2_6 +//~ static gchar *my_gtk_combo_box_get_active_text(GtkComboBox *combo ) +//~ { + //~ GtkTreeIter _iter = { 0 }; + //~ gchar *_format = NULL; + //~ GtkTreeModel *_model=NULL; + //~ g_return_val_if_fail( GTK_IS_COMBO_BOX(combo),NULL); + //~ _model = gtk_combo_box_get_model(combo); +//~ g_return_val_if_fail( GTK_IS_LIST_STORE(_model),NULL); + //~ if(gtk_combo_box_get_active_iter(combo,&_iter)) + //~ gtk_tree_model_get(_model, &_iter,0,&_format,-1); + //~ return _format; +//~ } +//~ #define gtk_combo_box_get_active_text( combo ) my_gtk_combo_box_get_active_text(combo) +//~ #endif + +void on_button_seq_clearall_clicked( GtkWidget *w, gpointer data ) +{ + multi_vims( VIMS_SEQUENCE_DEL, "-1"); + int slot; + for (slot = 0; slot < info->sequencer_col * info->sequencer_row ; slot++) + { + gtk_label_set_text(GTK_LABEL(info->sequencer_view->gui_slot[slot]->image), + NULL ); + } + vj_msg(VEEJAY_MSG_INFO, "Sequencer cleared"); +} + +void on_seq_rec_stop_clicked( GtkWidget *w, gpointer data ) +{ + single_vims( VIMS_SAMPLE_REC_STOP ); +} + +void on_rec_seq_start_clicked( GtkWidget *w, gpointer data ) +{ + GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT( glade_xml_get_widget_(info->main_window,"combo_samplecodec")); + gchar *gformat = (gchar*)gtk_combo_box_text_get_active_text(combo) ; + gchar *format = gformat; + if(format != NULL && strlen(format) > 2) + { + multi_vims( VIMS_RECORD_DATAFORMAT,"%s", + format ); + } + else + { + format = NULL; + } + + multi_vims( VIMS_SAMPLE_REC_START, + "%d %d", + 0, + 0 ); + + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SAMPLE_REC_START, 0, 0 ); +} + +void on_stream_recordstart_clicked(GtkWidget *widget, gpointer user_data) +{ + + gint nframes = get_nums( "spin_streamduration"); + gint autoplay = is_button_toggled("button_stream_autoplay"); + GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT( glade_xml_get_widget_(info->main_window,"combo_streamcodec")); + gchar *gformat = (gchar*)gtk_combo_box_text_get_active_text(combo) ; + gchar *format = gformat; + if(format != NULL && strlen(format) > 2) + { + multi_vims( VIMS_RECORD_DATAFORMAT,"%s", + format ); + } + else + { + format = NULL; + } + + multi_vims( VIMS_STREAM_REC_START, + "%d %d", + nframes, + autoplay ); + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_STREAM_REC_START, nframes, autoplay ); + + char *time1 = format_time( nframes,info->el.fps ); + if(format) + vj_msg(VEEJAY_MSG_INFO, "Record in %s, duration: %s",format, time1); + else + vj_msg(VEEJAY_MSG_INFO, "Recording in default format (MJPEG) , duration: %s", time1); + + free(time1); + g_free(format); +} + +void on_stream_recordstop_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_STREAM_REC_STOP ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_STREAM_REC_STOP ); + vj_msg(VEEJAY_MSG_INFO, "Stream record stop"); +} + +void on_spin_streamduration_value_changed(GtkWidget *widget , gpointer user_data) +{ + gint n_frames = get_nums( "spin_streamduration" ); + char *time = format_time(n_frames,info->el.fps); + update_label_str( "label_streamrecord_duration", time ); + free(time); +} + +void on_new_avformat_stream_clicked(GtkWidget *wid, gpointer data) +{ + char *url = get_text("inputstream_filename"); + multi_vims(VIMS_STREAM_NEW_AVFORMAT, "%s", url); + gveejay_new_slot(MODE_STREAM); +} + +void on_new_shm_stream_clicked(GtkWidget *wid, gpointer data) +{ + char *port = get_text("shm_text_port"); + multi_vims( VIMS_STREAM_NEW_SHARED, "%s", port ); + gveejay_new_slot(MODE_STREAM); +} + +void on_shm_3490_clicked(GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_STREAM_NEW_SHARED, "%d", 3490 ); + gveejay_new_slot(MODE_STREAM); +} + +void on_shm_4490_clicked(GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_STREAM_NEW_SHARED, "%d", 4490 ); + gveejay_new_slot(MODE_STREAM); +} +void on_shm_5490_clicked(GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_STREAM_NEW_SHARED, "%d", 5490 ); + gveejay_new_slot(MODE_STREAM); +} +void on_shm_6490_clicked(GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_STREAM_NEW_SHARED, "%d", 6490 ); + gveejay_new_slot(MODE_STREAM); +} +void on_shm_7490_clicked(GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_STREAM_NEW_SHARED, "%d", 7490 ); + gveejay_new_slot(MODE_STREAM); +} + +void on_button_sample_recordstart_clicked(GtkWidget *widget, gpointer user_data) +{ + + gint autoplay = is_button_toggled("button_sample_autoplay"); + GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT( glade_xml_get_widget_(info->main_window,"combo_samplecodec")); + + gchar *format = (gchar*) gtk_combo_box_text_get_active_text(combo); + gint n_frames = 0; + + gint dur_val = get_nums( "spin_sampleduration" ); + if( is_button_toggled( "sample_mulloop" ) ) + { + int base = sample_calctime(); + n_frames = base * dur_val; + } + else + { + n_frames = dur_val; + } + + if(format != NULL) + { + multi_vims( VIMS_RECORD_DATAFORMAT,"%s", + format ); + } + + multi_vims( VIMS_SAMPLE_REC_START, + "%d %d", + n_frames, + autoplay ); + + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SAMPLE_REC_START, n_frames, autoplay ); + + char *time1 = format_time(n_frames,info->el.fps); + if( autoplay ) { + vj_msg(VEEJAY_MSG_INFO, "Recording %s from current sample, autoplaying new sample when finished.",time1); + } else { + vj_msg(VEEJAY_MSG_INFO,"Recording %s from current sample",time1); + } + free(time1); + g_free(format); +} + +void on_button_sample_recordstop_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_SAMPLE_REC_STOP ); + vj_midi_learning_vims_simple( info->midi, NULL, VIMS_SAMPLE_REC_STOP ); + vj_msg(VEEJAY_MSG_INFO, "Sample record stop"); +} + +static int sample_calctime() +{ + int n_frames = info->status_tokens[SAMPLE_END] - info->status_tokens[SAMPLE_START]; + if( info->status_tokens[SAMPLE_LOOP] == 2 ) + n_frames *= 2; + if( info->status_tokens[FRAME_DUP] > 0 ) + n_frames *= info->status_tokens[FRAME_DUP]; + return n_frames; +} + +void on_spin_sampleduration_value_changed(GtkWidget *widget , gpointer user_data) +{ + // get num and display label_samplerecord_duration + gint n_frames = sample_calctime(); + if( is_button_toggled( "sample_mulloop" )) + n_frames *= get_nums( "spin_sampleduration" ); + else + n_frames = get_nums( "spin_sampleduration" ); + char *time = format_time( n_frames,info->el.fps ); + update_label_str( "label_samplerecord_duration", time ); + free(time); +} + +void on_sample_mulloop_clicked(GtkWidget *w, gpointer user_data) +{ + gint n_frames = sample_calctime(); + if( is_button_toggled( "sample_mulloop" )) + n_frames *= get_nums( "spin_sampleduration"); + char *time = format_time( n_frames,info->el.fps ); + update_label_str( "label_samplerecord_duration", time ); + free(time); +} + +void on_sample_mulframes_clicked(GtkWidget *w, gpointer user_data) +{ + gint n_frames = get_nums( "spin_sampleduration" ); + char *time = format_time( n_frames,info->el.fps ); + update_label_str( "label_samplerecord_duration", time ); + free(time); +} + +void on_spin_mudplay_value_changed(GtkWidget *widget, gpointer user_data) +{ +} +void on_check_samplefx_clicked(GtkWidget *widget , gpointer user_data) +{ + if(!info->status_lock) + { + int vims_id = VIMS_SAMPLE_CHAIN_DISABLE; + + if( is_button_toggled( "check_samplefx" ) ) + vims_id = VIMS_SAMPLE_CHAIN_ENABLE; + multi_vims( vims_id, "%d", 0 ); + + vj_midi_learning_vims_msg( info->midi, NULL, vims_id, 0 ); + } +} +void on_check_streamfx_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + int vims_id = VIMS_STREAM_CHAIN_DISABLE; + if( is_button_toggled( "check_streamfx")) + vims_id = VIMS_STREAM_CHAIN_ENABLE; + multi_vims( vims_id, "%d", 0 ); + vj_midi_learning_vims_msg( info->midi, NULL, vims_id, 0 ); + } +} + +void on_loop_none_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_SAMPLE_SET_LOOPTYPE, + "%d %d", 0, 0 ); + vj_midi_learning_vims_msg2(info->midi,NULL,VIMS_SAMPLE_SET_LOOPTYPE,0,0 ); + } +} + +void on_loop_normal_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_SAMPLE_SET_LOOPTYPE, + "%d %d", 0, 1 ); + vj_midi_learning_vims_msg2(info->midi,NULL,VIMS_SAMPLE_SET_LOOPTYPE,0,1 ); + } +} +void on_loop_random_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims( VIMS_SAMPLE_SET_LOOPTYPE, + "%d %d", 0,3 ); + vj_midi_learning_vims_msg2(info->midi,NULL,VIMS_SAMPLE_SET_LOOPTYPE,0,3 ); + + } +} + +void on_loop_pingpong_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { multi_vims( VIMS_SAMPLE_SET_LOOPTYPE, + "%d %d", 0,2 ); + vj_midi_learning_vims_msg2(info->midi,NULL,VIMS_SAMPLE_SET_LOOPTYPE,0,2 ); + + } +} + +void on_loop_oncenop_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + multi_vims(VIMS_SAMPLE_SET_LOOPTYPE,"%d %d",0,4); + vj_midi_learning_vims_msg2(info->midi,NULL,VIMS_SAMPLE_SET_LOOPTYPE,0,4); + } +} + +/* +void on_check_marker_bind_clicked(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + timeline_set_bind( info->tl, is_button_toggled("check_marker_bind")); +}*/ + +void on_button_clearmarker_clicked(GtkWidget *widget, gpointer user_data) +{ + multi_vims( VIMS_SAMPLE_CLEAR_MARKER, "%d", 0 ); + vj_midi_learning_vims_msg( info->midi, NULL, VIMS_SAMPLE_CLEAR_MARKER, 0 ); + char *dur = format_time( 0,info->el.fps ); + update_label_str( "label_markerduration", dur ); + free(dur); +} + + +void on_check_audio_mute_clicked(GtkWidget *widget, gpointer user_data) +{ +} +void on_button_samplelist_open_clicked(GtkWidget *widget, gpointer user_data) +{ + if(info->status_tokens[TOTAL_SLOTS] > 0 ) + { + vj_msg(VEEJAY_MSG_WARNING, "Any existing samples will be deleted."); + } + + gchar *filename = dialog_open_file( "Open samplelist",1); + if(filename) + { + single_vims( VIMS_SAMPLE_DEL_ALL ); + multi_vims( VIMS_SAMPLE_LOAD_SAMPLELIST, "%s", filename ); + info->uc.reload_hint[HINT_SLIST] = 2; + g_free(filename ); + } +} +void on_button_samplelist_append_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Append a samplelist",1); + if(filename) + { + multi_vims( VIMS_SAMPLE_LOAD_SAMPLELIST, "%s", filename ); + g_free(filename ); + } +} +void on_veejay_expander_activate(GtkWidget *exp, gpointer user_data) +{ +} +void on_veejay_ctrl_expander_activate(GtkWidget *exp, gpointer user_data) +{ + gint width= 0; + gint height = 0; + + GtkWindow *window = GTK_WINDOW( glade_xml_get_widget_( info->main_window, "gveejay_window")); + + gtk_window_get_size( window, &width, &height ); + + if(!gtk_expander_get_expanded(GTK_EXPANDER(exp))) + { + gtk_widget_set_size_request( + glade_xml_get_widget_(info->main_window, "veejaypanel" ), + width, + 400 ); + + gtk_window_resize( window, width, 600 ); + + } + else + { + gtk_widget_set_size_request( + glade_xml_get_widget_(info->main_window, "veejaypanel" ), + width, + 0 ); + gtk_window_resize( window, width, 100 ); + } +} + +void on_button_el_takestart_clicked(GtkWidget *widget, gpointer user_data) +{ + update_spin_value( "button_el_selstart", + info->status_tokens[FRAME_NUM] ); + vj_msg(VEEJAY_MSG_INFO, "Set current frame %d as editlist starting position", + info->status_tokens[FRAME_NUM]); +} +void on_button_el_takeend_clicked(GtkWidget *widget, gpointer user_data) +{ + update_spin_value ("button_el_selend", + info->status_tokens[FRAME_NUM] ); + vj_msg(VEEJAY_MSG_INFO, "Set current frame %d as editlist ending position", + info->status_tokens[FRAME_NUM]); +} +void on_button_el_paste_clicked(GtkWidget *widget, gpointer user_data) +{ + multi_vims( VIMS_EDITLIST_PASTE_AT, "%d", + info->status_tokens[FRAME_NUM] ); + char *time1 = format_time( info->status_tokens[FRAME_NUM],info->el.fps ); + vj_msg(VEEJAY_MSG_INFO, "Paste contents of buffer at Frame %d (Tiemcode %s)", + info->status_tokens[FRAME_NUM], time1); + free(time1); +} +void on_new_colorstream_clicked(GtkWidget *widget, gpointer user_data) +{ + GdkColor current_color; + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "colorselection" ); + gtk_color_selection_get_current_color( + GTK_COLOR_SELECTION( colorsel ), + ¤t_color ); + + // scale to 0 - 255 + gint red = current_color.red / 255.0; + gint green = current_color.green / 255.0; + gint blue = current_color.blue / 255.0; + multi_vims( VIMS_STREAM_NEW_COLOR, "%d %d %d", + red,green,blue ); + gveejay_new_slot(MODE_STREAM); +} + +#define atom_aspect_ratio(name,type) {\ +info->uc.priout_lock=1;\ +gint value = (type == 0 ? resize_primary_ratio_x() : resize_primary_ratio_y() );\ +update_spin_value(name, value);\ +info->uc.priout_lock=0;\ +} +void on_priout_width_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock && !info->uc.priout_lock) + if( is_button_toggled( "priout_ratio" )) + atom_aspect_ratio( "priout_height", 1 ); +} +void on_priout_height_value_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock && !info->uc.priout_lock) + if( is_button_toggled( "priout_ratio" )) + atom_aspect_ratio( "priout_width", 0 ); +} +void on_priout_apply_clicked(GtkWidget *widget, gpointer user_data) +{ + gint width = get_nums( "priout_width" ); + gint height = get_nums( "priout_height" ); + gint x = get_nums("priout_x" ); + gint y = get_nums("priout_y" ); + + if( width > 0 && height > 0 ) + { + multi_vims( VIMS_RESIZE_SDL_SCREEN, "%d %d %d %d", + width,height,x , y ); + vj_msg(VEEJAY_MSG_INFO, "Resize Video Window to %dx%d", width,height); + } + +} + + +void on_vims_take_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_BUNDLE_CAPTURE ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + vj_msg(VEEJAY_MSG_INFO, "Create a new bundle from FX Chain. See View -> VIMS Bundles"); +} +void on_button_key_detach_clicked(GtkWidget *widget, gpointer user) +{ +#ifdef HAVE_SDL + int key_val = info->uc.pressed_key; + int key_mod = info->uc.pressed_mod; + + if( key_val > 0 ) + { + multi_vims( + VIMS_BUNDLE_ATTACH_KEY, + "1 %d %d %s", + key_val, key_mod, "dummy" ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + char *strmod = sdlmod_by_id( key_mod ); + char *strkey = sdlkey_by_id( key_val); + if(key_mod) + vj_msg(VEEJAY_MSG_INFO, "Key binding %s + %s released",strmod,strkey); + else + vj_msg(VEEJAY_MSG_INFO, "Key binding %s released", strkey ); + } +#endif +} + +void on_vims_key_clicked( GtkWidget *widget, gpointer user_data) +{ +#ifdef HAVE_SDL + char which_vims[128]; + sprintf(which_vims, "Press a key to bind VIMS %03d", + info->uc.selected_vims_entry ); + + int n = prompt_keydialog( + which_vims, + "Key combination" ); + + if( n == GTK_RESPONSE_ACCEPT ) + { + int event_id = info->uc.selected_vims_entry; + int key_val = info->uc.pressed_key; + int mod = info->uc.pressed_mod; + char *buf = info->uc.selected_vims_args; + + if( event_id > 0 && key_val > 0 ) + { + multi_vims( + VIMS_BUNDLE_ATTACH_KEY, + "%d %d %d %s", + event_id, key_val, mod, buf ? buf : "dummy" ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + char *strmod = sdlmod_by_id( mod ); + if(strmod) + vj_msg(VEEJAY_MSG_INFO, "VIMS %d attached to key combination %s + %s", + event_id, strmod, sdlkey_by_id( key_val)); + else + vj_msg(VEEJAY_MSG_INFO, "VIMS %d attached to key %s", + event_id, sdlkey_by_id(key_val) ); + } + } +#endif +} + + +void on_button_vimsupdate_clicked(GtkWidget *widget, gpointer user_data) +{ + if(count_textview_buffer( "vimsview" ) > 0 ) + { + gchar *buf = get_textview_buffer( "vimsview" ); + + if( info->uc.selected_vims_type == 0 ) + { + multi_vims( VIMS_BUNDLE_ADD, "%d %s", + info->uc.selected_vims_entry, buf ); + } + else + { + multi_vims( + VIMS_BUNDLE_ATTACH_KEY, + "2 %d %d %s", + info->uc.selected_vims_accel[1], + info->uc.selected_vims_accel[0], + info->uc.selected_vims_args ); + } + info->uc.reload_hint[HINT_BUNDLES] = 1; + } + +} + +void on_vims_clear_clicked(GtkWidget *widget, gpointer user_data) +{ + clear_textview_buffer( "vimsview" ); +} + +void on_vims_delete_clicked(GtkWidget *widget, gpointer user_data) +{ + if( info->uc.selected_vims_entry >= VIMS_BUNDLE_START && + info->uc.selected_vims_entry < VIMS_BUNDLE_END ) + { + multi_vims( VIMS_BUNDLE_DEL, "%d", info->uc.selected_vims_entry ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + vj_msg(VEEJAY_MSG_INFO, "Delete bundle %d from VIMS event list", + info->uc.selected_vims_entry ); + } + else + { + vj_msg(VEEJAY_MSG_ERROR, "VIMS %d is not a bundle.", info->uc.selected_vims_entry ); + } +} + +void on_button_saveactionfile_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_save_file( "Save Bundles"); + if(filename) + { + multi_vims( VIMS_BUNDLE_SAVE, "%d %s",0, filename ); + vj_msg(VEEJAY_MSG_INFO, "Save Bundles and Keybindings to %s", filename ); + g_free(filename); + } +} + +void on_button_loadconfigfile_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Load liveset / configfile",2); + + if(!filename) + return; + + if( info->run_state == RUN_STATE_REMOTE ) + { + multi_vims( VIMS_BUNDLE_FILE, "%s", filename ); + } + else + { + if(config_file) + g_free(config_file); + config_file = g_strdup( filename ); + config_file_status = 1; + vj_msg(VEEJAY_MSG_INFO, "You can launch Veejay now"); + } + + g_free(filename); +} + +void on_button_saveconfigfile_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_save_file( "Save liveset / configfile"); + if(filename) + { + multi_vims( VIMS_BUNDLE_SAVE, "%d %s", 1, filename ); + g_free(filename); + } +} + + +void on_button_newbundle_clicked(GtkWidget *widget, gpointer user_data) +{ + if(count_textview_buffer( "vimsview" ) > 0 ) + { + gchar *buf = get_textview_buffer( "vimsview" ); + multi_vims( VIMS_BUNDLE_ADD, "%d %s", 0, buf ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + vj_msg(VEEJAY_MSG_INFO, "If your VIMS document was valid,you'll find it in the list."); + } + else + { + vj_msg(VEEJAY_MSG_ERROR, "VIMS document is empty, type text first."); + } +} + +void on_button_openactionfile_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Load Bundles",2 ); + if(filename) + { + multi_vims( VIMS_BUNDLE_FILE, "%s", filename ); + g_free( filename ); + info->uc.reload_hint[HINT_BUNDLES] = 1; + vj_msg(VEEJAY_MSG_INFO ,"Tried to load '%s'",filename); + } +} + +static void load_server_files(char *buf, int len) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "server_files"); + GtkTreeIter iter; + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + GtkListStore *store = GTK_LIST_STORE(model); +#ifdef STRICT_CHECKING + assert(tree != NULL ); +#endif + int i = 0; + int idx = 0; + char *ptr = buf; + while( i < len ) { + int filelen = 0; + char name[1024]; + char header[5]; + memset(header,0,sizeof(header)); + memset(name, 0,sizeof(name)); + strncpy(header,ptr, 4 ); + if(sscanf(header,"%04d", &filelen)==1) { + strncpy( name, ptr+4, filelen); + gchar *filename = _utf8str( name ); + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, 0,filename,-1); + gtk_tree_view_set_model(GTK_TREE_VIEW(tree), + GTK_TREE_MODEL(store)); + idx ++; + ptr += filelen; + } + ptr += 4; + i+=4; + i+=filelen; + } +} + +void on_button_browse_clicked(GtkWidget *widget, gpointer user_data) +{ + // open file browser for launcher +/* gchar *filename = dialog_open_file( "Open Videofile or EditList",0 ); + if(filename) + { + put_text( "entry_filename", filename ); + g_free(filename); + }*/ + single_vims(VIMS_WORKINGDIR); + + gint len = 0; + gchar *test = recv_vims( 8, &len ); + + if(!test || len <= 0 ) { + return ; + } + + reset_tree( "server_files"); + + load_server_files( test,len); +free(test); +} + +void on_button_offline_start_clicked(GtkWidget *widget, gpointer user_data) +{ + int stream_id = 0; + if( info->selection_slot ) { + stream_id = info->selection_slot->sample_type != 0 ? info->selection_slot->sample_id : 0; + } + else if (info->selected_slot ) { + stream_id = info->selected_slot->sample_type != 0 ? info->selected_slot->sample_id : 0; + } + + if( stream_id > 0 ) { + multi_vims( VIMS_STREAM_OFFLINE_REC_START, "%d %d %d", stream_id, get_nums("spin_offlineduration1" ), is_button_toggled("button_offline_autoplay1")); + } + else { + vj_msg(VEEJAY_MSG_INFO, "You can only use this recorder on streams, not samples!"); + } +} +void on_button_offline_stop_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_STREAM_OFFLINE_REC_STOP ); +} + +void on_button_clipcopy_clicked(GtkWidget *widget, gpointer user_data) +{ + if(info->selection_slot ) + { + if( info->selection_slot->sample_type != 0 ) { + multi_vims( VIMS_STREAM_NEW_CLONE, "%d", info->selection_slot->sample_id ); + gveejay_new_slot(MODE_STREAM); + } + else { + multi_vims( VIMS_SAMPLE_COPY, "%d", info->selection_slot->sample_id ); + gveejay_new_slot(MODE_SAMPLE); + } + } + else if (info->selected_slot ) + { + if( info->selected_slot->sample_type != 0 ) { + multi_vims( VIMS_STREAM_NEW_CLONE, "%d", info->selected_slot->sample_id ); + gveejay_new_slot(MODE_STREAM); + } + else { + multi_vims( VIMS_SAMPLE_COPY, "%d", info->selected_slot->sample_id ); + gveejay_new_slot(MODE_SAMPLE); + } + } +} + +void on_check_priout_fullscreen_clicked( + GtkWidget *widget, gpointer user_data) +{ + gint on = 0; + if(is_button_toggled( "check_priout_fullscreen" ) ) + on = 1; + multi_vims ( VIMS_FULLSCREEN, "%d", on ); +} + + +void on_inputstream_button_clicked(GtkWidget *widget, gpointer user_data) +{ + gint mcast = is_button_toggled( "inputstream_networktype" ); + gchar *remote_ = get_text( "inputstream_remote" ); + gint port = get_nums( "inputstream_portnum" ); + + gsize bw = 0; + gsize br = 0; + + if(!remote_) + { + error_dialog("Error", "Not a valid hostname. Try 'localhost' or '127.0.0.1'"); + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputstream_window" ); + gtk_widget_hide( dialog ); + return; + } + + gchar *remote = g_locale_from_utf8( + remote_ , -1, &br, &bw, NULL ); + + if( !remote || strlen(remote) <= 1 ) + { + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputstream_window" ); + gtk_widget_hide( dialog ); + error_dialog("Error", "Not a valid hostname. Try 'localhost' or '127.0.0.1'"); + return; + } + + remote[strlen(remote)] = '\0'; + + if(bw == 0 || br == 0 || port <= 0 ) + { + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputstream_window" ); + gtk_widget_hide( dialog ); + error_dialog("Error", "You must enter a valid remote address and/or port number"); + return; + } + + + if(mcast) + multi_vims( VIMS_STREAM_NEW_MCAST,"%d %s", port, remote ); + else + multi_vims( VIMS_STREAM_NEW_UNICAST, "%d %s", port, remote ); + + gveejay_new_slot( MODE_STREAM ); + + if(remote) g_free(remote); + + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputstream_window" ); + gtk_widget_hide( dialog ); + +} + +void on_inputstream_filebrowse_clicked(GtkWidget *w, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Select Action File",2 ); + if(filename) + { + put_text( "inputstream_filename", filename ); + g_free(filename); + } +} + +void on_y4m_new_clicked(GtkWidget *w, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Select YUV4MPEG input (fifo) file",3); + if(!filename) + return; + + multi_vims( VIMS_STREAM_NEW_Y4M, "%s", filename ); + gveejay_new_slot(MODE_STREAM); +} + +void on_samplerand_toggled(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + int arg = is_button_toggled( "freestyle" ); + int start = is_button_toggled( "samplerand" ); + + int vims_id = VIMS_SAMPLE_RAND_START; + if( start == 0 ) + vims_id = VIMS_SAMPLE_RAND_STOP; + + if( vims_id == VIMS_SAMPLE_RAND_START ) + { + multi_vims( vims_id,"%d", arg ); + vj_midi_learning_vims_msg( info->midi,NULL, vims_id, arg ); + } + else + { + single_vims( vims_id ); + vj_midi_learning_vims_simple(info->midi, NULL, vims_id ); + } + + vj_msg(VEEJAY_MSG_INFO, "You should restart the sample randomizer now."); + + } +} + + + +/* + * Handler to open the veejay_connection-dialog via menu + */ +void on_openConnection_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + if(!info->status_lock) + { + GtkWidget *veejay_conncection_window = glade_xml_get_widget_(info->main_window, "veejay_connection"); + gtk_widget_show(veejay_conncection_window); + } +} + + +/* + * Handler to close the veejay_connection-dialog + */ +void on_veejay_connection_close (GtkDialog *dialog, + gpointer user_data) +{ + if( info->watch.state == STATE_PLAYING) + { + info->watch.state = STATE_DISCONNECT; + + GtkWidget *w = glade_xml_get_widget_(info->main_window, "veejay_connection" ); + gtk_widget_show( w ); + } + else + gveejay_quit(NULL,NULL); +} + + +/* + * Handler to show the video_settings-dialog via menu + * + * TODO : if info locked, output message + */ +void on_video_settings_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + if(!info->status_lock) + { + GtkWidget *veejay_settings_window = glade_xml_get_widget_(info->main_window, "video_options"); + gtk_widget_show(veejay_settings_window); + } +} + + +/* + * Handler to show the image calibration dialog via menu + */ +void on_image_calibration_activate (GtkMenuItem *menuitem, + gpointer data) +{ + GtkWidget *win = glade_xml_get_widget_(info->main_window,"calibration_window" ); + gtk_widget_show(win); + cali_onoff = 1; +} + +/* + * Handler to close the video_settings-dialog + */ +void on_video_options_close (GtkDialog *dialog, + gpointer user_data) +{ + if(!info->status_lock) + { + GtkWidget *veejay_settings_window = glade_xml_get_widget_(info->main_window, "video_options"); + gtk_widget_hide(veejay_settings_window); + } +} + + +/* + * Handler to apply the settings of the video_settings-dialog + */ +void on_video_options_apply_clicked (GtkButton *button, + gpointer user_data) +{ + gint width = get_nums( "priout_width" ); + gint height = get_nums( "priout_height" ); + gint x = get_nums("priout_x" ); + gint y = get_nums("priout_y" ); + + if( width > 0 && height > 0 ) + { + multi_vims( VIMS_RESIZE_SDL_SCREEN, "%d %d %d %d", + width,height,x , y ); + vj_msg(VEEJAY_MSG_INFO, "Resize Video Window to %dx%d", width,height); + } +} + +void on_cali_save_button_clicked( GtkButton *button, gpointer user_data) +{ + gchar *filename = dialog_save_file( "Save calibration to file"); + if( filename ) { + multi_vims( VIMS_V4L_CALI, "%s", filename ); + } +} + +void on_load_calibration_activate( GtkMenuItem *menuitem, + gpointer user_data) +{ + gchar *filename = dialog_open_file("Select calibration file to load",0); + if(filename) + { + multi_vims( VIMS_STREAM_NEW_CALI, "%s", filename ); + vj_msg(VEEJAY_MSG_INFO ,"Loaded calibration file %s",filename); + g_free(filename); + gveejay_new_slot( MODE_STREAM ); + } +} + +void on_cali_take_button_clicked( GtkButton *button, gpointer data ) +{ + gint method = 0; + gint kernel = 0; + + if( info->uc.cali_stage == 1 ) + method = 1; + + if( info->uc.cali_duration > 0 ) { + error_dialog( "Error", "Already taking calibration images"); + return; + } + + if( is_button_toggled( "cali_method_median" )) + { + kernel = get_nums( "cali_kernelsize_spin"); + } + gint duration=get_nums( "cali_duration_spin" ); + + if( cali_stream_id <= 0 ) { + if(info->status_tokens[STREAM_TYPE] == STREAM_VIDEO4LINUX ) + cali_stream_id = + info->status_tokens[CURRENT_ID]; + } + + if( cali_stream_id <= 0 ) { + error_dialog( "Error", "No source selected to calibrate. Play a Live stream or double click one in the List"); + + return; + } + + multi_vims( VIMS_V4L_BLACKFRAME, "%d %d %d %d", + cali_stream_id, + duration, + kernel, + method ); + + info->uc.cali_duration = duration; + + //@ substract duration in status pipe + +} + +void on_cali_darkframe_clicked( GtkButton *button, gpointer data ) +{ + get_and_draw_frame( 0, "image_darkframe" ); +} + +void on_cali_lightframe_clicked( GtkButton *button, gpointer data ) +{ + get_and_draw_frame( 1, "image_lightframe" ); +} + +void on_cali_flatframe_clicked( GtkButton *button, gpointer data ) +{ + get_and_draw_frame( 2, "image_flatframe" ); +} + +void on_cali_image_clicked( GtkButton *button, gpointer data ) +{ + +// get_and_draw_frame( 0, "image_darkframe" ); +// get_and_draw_frame( 1, "image_lightframe"); +// get_and_draw_frame( 2, "image_flatframe"); + +} + +void on_cali_reset_button_clicked( GtkButton *button, gpointer data ) +{ + if( cali_stream_id <= 0 ) { + if(info->status_tokens[STREAM_TYPE] == STREAM_VIDEO4LINUX ) + cali_stream_id = + info->status_tokens[CURRENT_ID]; + } + + if( cali_stream_id <= 0 ) { + error_dialog( "Error", "No source selected to calibrate. Play a Live stream or double click one in the List"); + + return; + } + + info->uc.cali_stage = 0; + update_label_str("current_step_label","Please take an image with the cap on the lens."); + + multi_vims( VIMS_V4L_BLACKFRAME, "%d 0 0 0", cali_stream_id ); + + reset_cali_images(0, "image_darkframe"); + reset_cali_images(1, "image_lightframe"); + reset_cali_images(2, "image_flatframe"); + + GtkWidget *tb = glade_xml_get_widget_( info->main_window, "cali_take_button"); + gtk_button_set_label( GTK_BUTTON(tb), "Take Black Frames"); + + disable_widget( "cali_save_button" ); + +} + +/* + * Handler to show the VIMS_Bundles-dialog + */ +void on_vims_bundles_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + GtkWidget *vims_bundles_window = glade_xml_get_widget_(info->main_window, "vims_bundles"); + GtkWidget *mainw = glade_xml_get_widget_(info->main_window,"gveejay_window" ); + gtk_window_set_transient_for (GTK_WINDOW(vims_bundles_window),GTK_WINDOW (mainw)); + gtk_widget_show(vims_bundles_window); +} + + +/* + * Handler to close the VIMS_Bundles-dialog + */ +void on_vims_bundles_close (GtkDialog *dialog, + gpointer user_data) +{ + GtkWidget *vims_bundles_window = glade_xml_get_widget_(info->main_window, "vims_bundles"); + gtk_widget_hide(vims_bundles_window); +} + +/* Menu entries */ +void on_quit_activate( GtkWidget *w, gpointer user_data ) +{ + gveejay_quit(NULL,NULL); +} + +/* depending on the state, we either load an action file or a sample list !*/ +void on_open2_activate( GtkWidget *w, gpointer user_data) +{ + gchar *filename = NULL; + switch( info->watch.state ) + { + case STATE_STOPPED: + filename = dialog_open_file( "Open Action file / Liveset",2 ); + if(filename) + { + if(config_file) + g_free(config_file); + config_file = g_strdup( filename ); + config_file_status = 1; + g_free(filename); + } + break; + case STATE_PLAYING: + filename = dialog_open_file( "Open Samplelist ",1); + if(filename) + { + single_vims( VIMS_SAMPLE_DEL_ALL ); + multi_vims( VIMS_SAMPLE_LOAD_SAMPLELIST, "%s", filename); + info->uc.reload_hint[HINT_SLIST] = 2; + g_free(filename); + } + break; + default: + vj_msg(VEEJAY_MSG_INFO, "Invalid state !"); + break; + } +} + +void on_save1_activate( GtkWidget *w, gpointer user_data ) +{ + if(info->watch.state == STATE_PLAYING) + on_button_samplelist_save_clicked( NULL, NULL ); + else + vj_msg(VEEJAY_MSG_ERROR, "Nothing to save (start or connect to veejay first)"); +} + +/* + * Help menu handlers + */ +void on_about_activate(GtkWidget *widget, gpointer user_data) +{ + about_dialog(); +} + +void on_report_a_bug_activate(GtkWidget *w, gpointer user_data ) +{ + reportbug(); +} + +void on_donate_activate( GtkWidget *w, gpointer user_data ) { + donatenow(); +} + +void on_new_input_stream1_activate(GtkWidget *widget, gpointer user_data) +{ + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputdialog" ); + gtk_dialog_run( GTK_DIALOG( dialog )); + gtk_widget_hide( dialog ); +} + +void on_istream_cancel_clicked(GtkWidget *widget, gpointer user_data) +{ + GtkWidget *dialog = glade_xml_get_widget_( info->main_window, "inputdialog" ); + gtk_widget_hide( dialog ); +} + +void on_curve_togglerun_toggled(GtkWidget *widget , gpointer user_data) +{ +} + +void on_stream_length_value_changed( GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + multi_vims( VIMS_STREAM_SET_LENGTH, "%d", get_nums("stream_length") ); +} + +int on_curve_buttontime_clicked() +{ + return 1; +} + + +void on_framerate_inc_clicked( GtkWidget *w, gpointer data ) +{ + double cur = get_slider_val( "framerate" ); + cur += 1.0; + update_slider_value( "framerate", (int) cur, 0 ); +} + +void on_framerate_dec_clicked( GtkWidget *w, gpointer data ) +{ + double cur = get_slider_val( "framerate" ); + cur -= 1.0; + update_slider_value( "framerate", (int) cur, 0 ); +} + + +void on_frameratenormal_clicked( GtkWidget *w, gpointer data ) +{ + update_slider_value( "framerate", (int) info->el.fps,0 ); +} + +void on_framerate_value_changed( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gdouble slider_val = gtk_adjustment_get_value (a); + int value = (int)(100.0 * slider_val); + multi_vims( VIMS_FRAMERATE, "%d", value ); + vj_midi_learning_vims_simple( info->midi, "framerate", VIMS_FRAMERATE ); +} + +void on_sync_correction_clicked( GtkWidget *w, gpointer data ) +{ + int status = is_button_toggled( "sync_correction" ); + + multi_vims( VIMS_SYNC_CORRECTION, "%d", status ); + vj_midi_learning_vims_msg( info->midi, NULL, VIMS_SYNC_CORRECTION, status ); +} + +void on_curve_clear_parameter_clicked( GtkWidget *widget, gpointer user_data ) +{ + if( info->uc.selected_parameter_id == -1 ) + return; + multi_vims( VIMS_SAMPLE_KF_CLEAR, "%d %d", info->uc.selected_chain_entry, info->uc.selected_parameter_id ); + reset_curve( info->curve ); +} + +void on_curve_buttonstore_clicked(GtkWidget *widget, gpointer user_data ) +{ + int i = info->uc.selected_chain_entry; + int j = info->uc.selected_parameter_id; + + if( j == -1 ) { + vj_msg(VEEJAY_MSG_INFO,"No parameter selected for animation"); + return; + } + + int id = info->uc.entry_tokens[ENTRY_FXID]; + + int end = get_nums( "curve_spinend" ); + int start = get_nums( "curve_spinstart" ); + int status = is_button_toggled( "curve_toggleentry_param" ); + const int length = end - start + 1; + + + if( (length) <= 0 || id <= 0 ) + { + if( id <= 0 ) + vj_msg(VEEJAY_MSG_INFO, "No FX set on entry %d",i); + else + vj_msg(VEEJAY_MSG_INFO, "Length of animation is 0"); + return; + } + + int type = 0; + if( is_button_toggled( "curve_typelinear" ) ) { + type = GTK3_CURVE_TYPE_LINEAR; + } else if ( is_button_toggled( "curve_typespline" ) ) { + type = GTK3_CURVE_TYPE_SPLINE; + } else if ( is_button_toggled( "curve_typefreehand" ) ) { + type = GTK3_CURVE_TYPE_FREE; + } + + int min=0,max=0; + float *data = (float*) vj_calloc( sizeof(float) * length ); + + _effect_get_minmax( id, &min, &max,j ); + + get_points_from_curve( info->curve, length, data ); + + char header[64]; + + int msg_len = 27 + (4*length); /*K00000000 */ + + snprintf(header,sizeof(header), "K%08dkey%02d%02d%08d%08d%02d%02d",msg_len,i,j,start,end,type,status ); + + int hdr_len = strlen(header); + + unsigned char *buf = (unsigned char*) vj_calloc( sizeof(unsigned char) * msg_len + 9 ); + strncpy( (char*) buf, header, hdr_len); + + unsigned char *ptr = buf + hdr_len; + int k; + int diff = max - min; + for( k = 0 ; k < length ; k++ ) { + // pval = ((Input - InputLow) / (InputHigh - InputLow)) * (OutputHigh - OutputLow) + OutputLow; + // with InputLow==0 and InputHigh==1 in gtkcurve range + int pval = ((data[k]) * ((float)diff)) + min; + ptr[0] = pval & 0xff; + ptr[1] = (pval >> 8) & 0xff; + ptr[2] = (pval >> 16) & 0xff; + ptr[3] = (pval >> 24) & 0xff; + + ptr += 4; + veejay_msg( VEEJAY_MSG_DEBUG, "(%d/%d) FX set value %d on frame %d",k,length,pval, start+k ); + } + + vj_client_send_buf( info->client, V_CMD, buf, msg_len + 9 ); + + vj_msg( VEEJAY_MSG_INFO, "Saved new animation for parameter %d on entry %d, start at frame %d and end at frame %d",j,i,start,end ); + + free(buf); + free(data); + + + info->uc.reload_hint[HINT_KF] = 1; +} + +void on_curve_buttonclear_clicked(GtkWidget *widget, gpointer user_data) +{ + gint id = info->status_tokens[ENTRY_FXID]; + if( id < 0 ) + id = 0; + int i = info->uc.selected_chain_entry; + vj_kf_refresh(); + + multi_vims( VIMS_SAMPLE_KF_RESET, "%d", i ); +} + +void on_curve_typelinear_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + if( is_button_toggled("curve_typelinear")) + { + sample_slot_t *s = info->selected_slot; + if(!s) + return; + set_points_in_curve( GTK3_CURVE_TYPE_LINEAR, info->curve ); + } +} +void on_curve_typespline_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + if( is_button_toggled("curve_typespline")) + { + sample_slot_t *s = info->selected_slot; + if(!s) + return; + set_points_in_curve( GTK3_CURVE_TYPE_SPLINE, info->curve ); + } +} +void on_curve_typefreehand_toggled(GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + if( is_button_toggled("curve_typefreehand")) + { + sample_slot_t *s = info->selected_slot; + if(!s) + return; + set_points_in_curve( GTK3_CURVE_TYPE_FREE, info->curve ); + } + +} +void on_curve_toggleentry_param_toggled( GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + int i = info->uc.selected_chain_entry; + if( i == -1 ) { + vj_msg(VEEJAY_MSG_INFO,"No FX entry selected for animation"); + return; + } + + int j = info->uc.selected_parameter_id; + if( j == -1) { + vj_msg(VEEJAY_MSG_INFO,"No FX anim parameter selected"); + return; + } + int k = is_button_toggled( "curve_toggleentry_param" ); + + multi_vims( VIMS_SAMPLE_KF_STATUS_PARAM, "0 %d %d %d", i, j,k ); + + vj_msg(VEEJAY_MSG_INFO, "%s FX parameter %d", (k==0 ? "Disabled" : "Enabled"), i ); +} + +void curve_toggleentry_toggled( GtkWidget *widget, gpointer user_data) +{ + if(info->status_lock) + return; + + int selected_chain_entry = info->uc.selected_chain_entry; + if( selected_chain_entry == -1 ) { + vj_msg(VEEJAY_MSG_INFO,"No parameter selected for animation"); + return; + } + + int active = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ); + int curve_type = 0; + if( is_button_toggled("curve_typespline")) { + curve_type = 1; + } else if ( is_button_toggled("curve_typefreehand")) { + curve_type = 2; + } else if (is_button_toggled("curve_typelinear")) { + curve_type = 0; + } + + multi_vims( VIMS_SAMPLE_KF_STATUS, "%d %d %d", + selected_chain_entry, active, curve_type ); + + //update anim mode + GtkTreeView *view = GTK_TREE_VIEW(glade_xml_get_widget_(info->main_window, "tree_chain")); + GtkTreeModel *model = gtk_tree_view_get_model( view ); + GtkTreeIter iter; + + GtkTreePath *path = gtk_tree_path_new_from_indices(selected_chain_entry, -1); + if(gtk_tree_model_get_iter(model, &iter, path)) + { + GdkPixbuf *kf_toggle = update_pixmap_entry( active ); + gtk_list_store_set (GTK_LIST_STORE( model ), &iter, FXC_KF, kf_toggle, -1); + } + gtk_tree_path_free(path); +} + + +void curve_chain_toggleentry_toggled( GtkWidget *widget, gpointer user_data) +{ + curve_toggleentry_toggled( widget, user_data); + + GtkWidget *siamese = glade_xml_get_widget_( info->main_window, "curve_panel_toggleentry"); + if(siamese) + { + guint signal_id=g_signal_lookup("toggled", GTK_TYPE_TOGGLE_BUTTON); + gulong handler_id=handler_id=g_signal_handler_find( (gpointer)siamese, G_SIGNAL_MATCH_ID, signal_id, 0, NULL, NULL, NULL ); + + if (handler_id) + g_signal_handler_block((gpointer)siamese, handler_id); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(siamese), + gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) )) ; + + if (handler_id) + g_signal_handler_unblock((gpointer)siamese, handler_id); + } +} + +void curve_panel_toggleentry_toggled( GtkWidget *widget, gpointer user_data) +{ + curve_toggleentry_toggled( widget, user_data); + + GtkWidget *siamese = glade_xml_get_widget_( info->main_window, "curve_chain_toggleentry"); + if(siamese) + { + guint signal_id=g_signal_lookup("toggled", GTK_TYPE_TOGGLE_BUTTON); + gulong handler_id=handler_id=g_signal_handler_find( (gpointer)siamese, G_SIGNAL_MATCH_ID, signal_id, 0, NULL, NULL, NULL ); + + if (handler_id) + g_signal_handler_block((gpointer)siamese, handler_id); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(siamese), + gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) )) ; + + if (handler_id) + g_signal_handler_unblock((gpointer)siamese, handler_id); + } +} + +void on_kf_none_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + { + info->uc.selected_parameter_id = -1; + + disable_widget( "fxanimcontrols" ); + disable_widget( "curve_container" ); + + if(info->status_lock) + return; + + vj_kf_reset(); + } +} + +void on_kf_p0_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 0 ); +} +void on_kf_p1_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 1 ); +} +void on_kf_p2_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 2 ); +} +void on_kf_p3_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 3 ); +} +void on_kf_p4_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 4 ); +} +void on_kf_p5_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 5 ); +} +void on_kf_p6_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 6 ); +} +void on_kf_p7_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 7 ); +} +void on_kf_p8_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 8 ); +} +void on_kf_p9_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 9 ); +} +void on_kf_p10_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 10 ); +} + +void on_kf_p11_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 11 ); +} + +void on_kf_p12_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 12 ); +} + + +void on_kf_p13_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 13 ); +} + + +void on_kf_p14_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 14 ); +} + +void on_kf_p15_toggled( GtkToggleButton *widget, gpointer user_data) +{ + if(gtk_toggle_button_get_active( widget )) + KF_CHANGED( 15 ); +} + +void on_button_videobook_clicked(GtkWidget *widget, gpointer user_data) +{ + GtkWidget *n = glade_xml_get_widget_( info->main_window, "videobook" ); + // set page 1 from notebook panels + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK(n) ); + if(page == 1 ) + gtk_notebook_prev_page(GTK_NOTEBOOK(n) ); + if(info->selected_slot) + { + /* Only if we are not playing it */ + if(info->status_tokens[STREAM_TYPE] != + info->selected_slot->sample_type && + info->status_tokens[CURRENT_ID] != + info->selected_slot->sample_id ) + multi_vims( VIMS_SET_MODE_AND_GO, "%d %d", + (info->selected_slot->sample_type == MODE_SAMPLE ? MODE_SAMPLE : MODE_STREAM ), + info->selected_slot->sample_id ); + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SET_MODE_AND_GO, + info->selected_slot->sample_type == MODE_SAMPLE ? MODE_SAMPLE: MODE_STREAM, + info->selected_slot->sample_id ); + } +} + +void on_samplepage_clicked(GtkWidget *widget, gpointer user_data) +{ + GtkWidget *m = glade_xml_get_widget_(info->main_window , "notebook18"); + gtk_notebook_set_current_page( GTK_NOTEBOOK(m), 5 ); + + GtkWidget *n = glade_xml_get_widget_( info->main_window, "panels" ); + + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK(n) ); + + gint page_needed = 2; + + switch( info->status_tokens[PLAY_MODE] ) + { + case MODE_SAMPLE: + page_needed =0 ; break; + case MODE_STREAM: + page_needed = 1; break; + case MODE_PLAIN: + page_needed = 2; break; + default: + break; + } + + if( page_needed != page ) + gtk_notebook_set_current_page( + GTK_NOTEBOOK(n), + page_needed ); +} + +void on_timeline_cleared(GtkWidget *widget, gpointer user_data) +{ + multi_vims( VIMS_SAMPLE_CLEAR_MARKER, "%d", 0 ); + vj_midi_learning_vims_msg( info->midi, NULL, VIMS_SAMPLE_CLEAR_MARKER, 0 ); +} + +void on_timeline_bind_toggled( GtkWidget *widget, gpointer user_data) +{ +// gboolean toggled = timeline_get_bind( TIMELINE_SELECTION(widget)) ; +// set_toggle_button( "check_marker_bind", (toggled ? 1 :0) ); +} + +void on_timeline_value_changed( GtkWidget *widget, gpointer user_data ) +{ + if(!info->status_lock) + { + gdouble pos = timeline_get_pos( TIMELINE_SELECTION(widget) ); + multi_vims( VIMS_VIDEO_SET_FRAME, "%d", (gint)pos ); + } +} + +void on_timeline_out_point_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + + gdouble pos1 = timeline_get_in_point( TIMELINE_SELECTION(widget) ); + gdouble pos2 = timeline_get_out_point( TIMELINE_SELECTION(widget) ); + pos1 *= info->status_tokens[TOTAL_FRAMES]; + pos2 *= info->status_tokens[TOTAL_FRAMES]; + if(pos2 > pos1 ) + { + multi_vims( VIMS_SAMPLE_SET_MARKER , "%d %d %d", 0,(gint) pos1, (gint) pos2 ); + char *dur = format_time( pos2 - pos1,info->el.fps ); + update_label_str( "label_markerduration", dur ); + free(dur); + } + else + vj_msg(VEEJAY_MSG_INFO, "Set Out point after In point !"); + + + } +} + +void on_timeline_in_point_changed(GtkWidget *widget, gpointer user_data) +{ + if(!info->status_lock) + { + gdouble pos1 = timeline_get_in_point( TIMELINE_SELECTION(widget) ); + gdouble pos2 = timeline_get_out_point( TIMELINE_SELECTION(widget) ); + pos1 *= info->status_tokens[TOTAL_FRAMES]; + pos2 *= info->status_tokens[TOTAL_FRAMES]; + if(pos1 < pos2 ) + { + multi_vims( VIMS_SAMPLE_SET_MARKER , "%d %d %d", 0, (gint) pos1, (gint) pos2 ); + char *dur = format_time( pos2 - pos1,info->el.fps ); + update_label_str( "label_markerduration", dur ); + free(dur); + } + else + vj_msg(VEEJAY_MSG_INFO,"Set In Point before Out Point !"); + } +} + +void on_sampleadd_clicked(GtkWidget *widget, gpointer user_data) +{ + gchar *filename = dialog_open_file( "Add videofile as new sample",0 ); + if(filename) + { + multi_vims( VIMS_EDITLIST_ADD_SAMPLE, "%d %s", 0, filename ); + + g_free(filename); + } +} + +void on_streamnew_clicked(GtkWidget *widget, gpointer user_data) +{ + // inputstream_window + GtkWidget *w = glade_xml_get_widget_(info->main_window, "inputstream_window"); + scan_devices( "tree_v4ldevices" ); + gtk_widget_show(w); + +} + +void on_generatornew_clicked(GtkWidget *widget, gpointer user_data) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window, "generator_window"); + scan_generators( "generators" ); + gtk_widget_show(w); +} + +void on_inputstream_close_clicked(GtkWidget *w, gpointer user_data) +{ + GtkWidget *wid = glade_xml_get_widget_(info->main_window, "inputstream_window"); + gtk_widget_hide(wid); +} + +void on_generators_close_clicked(GtkWidget *w, gpointer user_data) +{ + GtkWidget *wid = glade_xml_get_widget_(info->main_window, "generator_window"); + gtk_widget_hide(wid); +} + +void on_button_sdlclose_clicked(GtkWidget *w, gpointer user_data) +{ + multi_vims( VIMS_RESIZE_SDL_SCREEN, "%d %d %d %d", + 0,0,0,0 ); + +} + + +void on_quicklaunch_clicked(GtkWidget *widget, gpointer user_data) +{ +/* if( info->watch.state == STATE_STOPPED ) + { + vj_fork_or_connect_veejay( config_file ); + } +*/ +} + +static void _update_vs() +{ + if( info->config.norm == 0 ) + { + update_spin_value( "vs_size0", 720 ); + update_spin_value( "vs_size1", 576 ); + gtk_spin_button_set_value ( + GTK_SPIN_BUTTON( glade_xml_get_widget_( info->main_window, "vs_fps" ) ), 25.0 ); + } + else + { + update_spin_value( "vs_size0", 720 ); + update_spin_value( "vs_size1", 480 ); + gtk_spin_button_set_value ( + GTK_SPIN_BUTTON( glade_xml_get_widget_( info->main_window, "vs_fps" ) ), 29.97 ); + } + set_toggle_button( "vs_custom", 0 ); +} + +void on_vs_pal_toggled( GtkWidget *w, gpointer user_data ) +{ + info->config.norm = is_button_toggled( "vs_pal" ) ? 0 : 1; + _update_vs(); +} +void on_vs_ntsc_toggled( GtkWidget *w , gpointer user_data) +{ + info->config.norm = is_button_toggled( "vs_ntsc" ) ? 1 :0; + _update_vs(); +} +void on_vs_custom_toggled( GtkWidget *w, gpointer user_data) +{ + if(is_button_toggled( "vs_custom" )) + enable_widget( "vs_frame"); + else + disable_widget( "vs_frame"); +} + +static void _rgroup_audio(void) +{ + if(is_button_toggled( "vs_noaudio")) + info->config.audio_rate = 0; + else + { + if(is_button_toggled("vs_audio44") ) + info->config.audio_rate = 48000; + else + info->config.audio_rate = 44000; + } +} + +void on_vs_audio48_toggled(GtkWidget *w, gpointer user_data) +{ + _rgroup_audio(); +} + +void on_vs_audio44_toggled(GtkWidget *w, gpointer user_data) +{ + _rgroup_audio(); +} +void on_vs_noaudio_toggled(GtkWidget *w, gpointer user_data) +{ + _rgroup_audio(); +} +void on_vs_avsync_toggled(GtkWidget *w, gpointer user_data) +{ + info->config.sync = is_button_toggled( "vs_avsync" ); +} +void on_vs_avtimer_toggled(GtkWidget *w, gpointer user_data) +{ + info->config.timer = is_button_toggled( "vs_avtimer" ); +} +void on_vs_deinter_toggled(GtkWidget *w, gpointer user_data) +{ + info->config.deinter = is_button_toggled( "vs_deinter" ); +} +void on_vs_yuv420_toggled( GtkWidget *w , gpointer user_data) +{ + if( is_button_toggled( "vs_yuv420" )) + info->config.pixel_format = 0; +} +void on_vs_yuv422_toggled( GtkWidget *w, gpointer user_data) +{ + if( is_button_toggled("vs_yuv422") ) + info->config.pixel_format = 1; +} +void on_vs_sample0_toggled( GtkWidget *w , gpointer user_data) +{ + if( is_button_toggled("vs_sample0")) + info->config.sampling = 1; +} +void on_vs_sample1_toggled( GtkWidget *w, gpointer user_data) +{ + if( is_button_toggled("vs_sample1")) + info->config.sampling = 0; +} +void on_vs_size0_value_changed(GtkWidget *w, gpointer user_data) +{ + info->config.w = get_nums( "vs_size0"); +} +void on_vs_size1_value_changed(GtkWidget *w, gpointer user_data) +{ + info->config.h = get_nums( "vs_size1"); +} +void on_vs_fps_value_changed(GtkWidget *w, gpointer user_data) +{ + info->config.fps = get_numd( "vs_fps"); +} +void on_vs_close_clicked( GtkWidget *w, gpointer user_data) +{ + GtkWidget *vs = glade_xml_get_widget_(info->main_window, "vs"); + gtk_widget_hide(vs); +} + +void on_vs_mcastosc_toggle_toggled( GtkWidget *w, gpointer user_data) +{ + info->config.osc = is_button_toggled( "vs_mcastosc_toggle" ); + if(info->config.osc) + { + if(info->config.mcast_osc) + g_free( info->config.mcast_osc ); + info->config.mcast_osc = get_text( "vs_mcastvims" ); + } + +} +void on_vs_mcastvims_toggle_toggled(GtkWidget *w, gpointer user_data) +{ + info->config.vims = is_button_toggled( "vs_mcastvims_toggle" ); + if(info->config.vims) + { + if(info->config.mcast_vims) + g_free( info->config.mcast_vims ); + info->config.mcast_vims = get_text( "vs_mcastvims" ); + } +} + +void on_vs_mcastosc_changed( GtkWidget *w, gpointer user_data) +{ +// if(info->config.mcast_osc) +// g_free(info->config.mcast_osc); +// info->config.mcast_osc = get_text( "vs_mcastosc" ); +} +void on_vs_mcastvims_changed( GtkWidget *w, gpointer user_data) +{ +// if(info->config.mcast_vims) +// g_free(info->config.mcast_vims); +// info->config.mcast_vims = get_text( "vs_mcastvims" ); +} + +void on_inputstream_window_delete_event(GtkWidget *w, gpointer user_data) +{ + GtkWidget *vs = glade_xml_get_widget_(info->main_window, "inputstream_window"); + gtk_widget_hide(vs); +} + +void on_generator_window_delete_event(GtkWidget *w, gpointer user_data) +{ + GtkWidget *vs = glade_xml_get_widget_(info->main_window, "generator_window"); + gtk_widget_hide(vs); +} + +void on_calibration_window_delete_event(GtkWidget *w,gpointer data) +{ + GtkWidget *win = glade_xml_get_widget_(info->main_window, "calibration_window"); + cali_onoff = 0; + gtk_widget_hide(win); +} + + +void on_vs_delete_event( GtkWidget *w, gpointer user_data) +{ + GtkWidget *vs = glade_xml_get_widget_(info->main_window, "vs"); + gtk_widget_hide(vs); +} +void on_configure1_activate( GtkWidget *w, gpointer user_data) +{ + GtkWidget *vs = glade_xml_get_widget_(info->main_window, "vs"); +/* load options from config */ + + update_spin_value( "vs_size0", info->config.w ); + update_spin_value( "vs_size1", info->config.h ); + update_spin_value( "vs_fps", info->config.fps ); + + set_toggle_button( "vs_avsync", info->config.sync ); + set_toggle_button( "vs_avtimer", info->config.timer ); + set_toggle_button( "vs_deinter", info->config.deinter ); + if(info->config.pixel_format == 0) + set_toggle_button( "vs_yuv420", 1 ); + else + set_toggle_button( "vs_yuv422", 1 ); + + if(info->config.sampling == 1 ) + set_toggle_button( "vs_sample0", 1 ); + else + set_toggle_button( "vs_sample1", 1 ); + if(info->config.norm == 0 && info->config.w == 720 && info->config.h == 576 ) + set_toggle_button( "vs_pal", 1 ); + else + { + if(info->config.norm == 1 && info->config.w == 720 && info->config.h == 480 ) + set_toggle_button( "vs_ntsc", 1 ); + else + set_toggle_button( "vs_custom", 1 ); + } + + if( is_button_toggled( "vs_custom" )) + enable_widget( "vs_frame" ); + else + disable_widget( "vs_frame" ); + + if( info->config.audio_rate == 0 ) + set_toggle_button( "vs_noaudio" , 1 ); + else + { + if( info->config.audio_rate == 44000 ) + set_toggle_button( "vs_audio44" , 1 ); + else + set_toggle_button( "vs_audio48", 1 ); + } + + /* set osc , vims mcast */ + if(info->config.mcast_osc) + put_text( "vs_mcastosc", info->config.mcast_osc ); + if(info->config.mcast_vims) + put_text( "vs_mcastvims", info->config.mcast_vims ); + set_toggle_button( "vs_mcastosc_toggle", info->config.osc ); + set_toggle_button( "vs_mcastvims_toggle", info->config.vims ); + + gtk_widget_show(vs); +} + +void on_quit_veejay1_activate( GtkWidget *w, gpointer user_data) +{ + veejay_quit(); +} + +void on_curve_spinend_value_changed(GtkWidget *w, gpointer user_data) +{ + int end_pos = get_nums( "curve_spinend" ); + char *end_time = format_time( + end_pos,info->el.fps ); + update_label_str( "curve_endtime", end_time ); + free(end_time); + + vj_msg(VEEJAY_MSG_INFO, "Click the FX store button to save the new values"); +} + +void on_curve_spinstart_value_changed(GtkWidget *w, gpointer user_data) +{ + int start_pos = get_nums( "curve_spinstart" ); + + char *start_time = format_time( + start_pos,info->el.fps ); + update_label_str( "curve_endtime", start_time ); + free(start_time); + + vj_msg(VEEJAY_MSG_INFO, "Click the FX store button to save the new values"); +} + +void on_veejayevent_enter_notify_event(GtkWidget *w, gpointer user_data) +{ + info->key_now = TRUE; +} +void on_veejayevent_leave_notify_event(GtkWidget *w , gpointer user_data) +{ + info->key_now = FALSE; +} + +void on_spin_framedelay_value_changed(GtkWidget *w, gpointer user_data) +{ + if( info->status_lock ) + return; + + multi_vims(VIMS_VIDEO_SET_SLOW, "%d", get_nums("spin_framedelay")); + + vj_midi_learning_vims_spin( info->midi, "spin_framedelay", VIMS_VIDEO_SET_SLOW ); +} + +void on_alpha_effects_toggled(GtkWidget *w, gpointer user_data) +{ + GtkWidget *n = glade_xml_get_widget_( info->main_window, "effectspanel" ); + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK(n) ); + if(page != 2) + gtk_notebook_set_current_page(GTK_NOTEBOOK(n), 2); +} + +void on_toggle_alpha255_toggled(GtkWidget *w, gpointer user_data) +{ + multi_vims( VIMS_ALPHA_COMPOSITE,"%d %d", is_button_toggled( "alphacomposite"), is_button_toggled("toggle_alpha255") ? 255: 0 ); +} + +void on_alphacomposite_toggled(GtkWidget *widget, gpointer user_data) +{ + int alpha_value = 0; + if (is_button_toggled( "toggle_alpha255")) + alpha_value = 255; + + multi_vims( VIMS_ALPHA_COMPOSITE,"%d %d", is_button_toggled( "alphacomposite" ), alpha_value ); +} + + +void on_mixing_effects_toggled(GtkWidget *w, gpointer user_data) +{ + GtkWidget *n = glade_xml_get_widget_( info->main_window, "effectspanel" ); + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK(n) ); + if(page != 0 ) + gtk_notebook_set_current_page(GTK_NOTEBOOK(n), 0 ); +} + +void on_image_effects_toggled(GtkWidget *w, gpointer user_data) +{ + GtkWidget *n = glade_xml_get_widget_( info->main_window, "effectspanel" ); + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK(n) ); + if(page != 1) + gtk_notebook_set_current_page(GTK_NOTEBOOK(n),1); +} + +void on_filter_effects_activate(GtkWidget *widget, gpointer user_data) +{ +} + +void on_filter_effects_changed( GtkWidget *w, effectlist_data *user_data) +{ + if(user_data != NULL) { + gchar* fx_txt = get_text("filter_effects"); + int filterlen = strlen(fx_txt); + + if(filterlen) { + vj_msg(VEEJAY_MSG_INFO, "filtering effects '%s'", fx_txt); + user_data->filter_string = g_new0(gchar, filterlen+1); + if(user_data->filter_string != NULL) { + strcpy(user_data->filter_string, fx_txt); + gtk_tree_model_filter_refilter (user_data->stores[0].filtered); + gtk_tree_model_filter_refilter (user_data->stores[1].filtered); + gtk_tree_model_filter_refilter (user_data->stores[2].filtered); + g_free(user_data->filter_string); + } + user_data->filter_string = NULL; + } else { + vj_msg(VEEJAY_MSG_DEBUG, ""); // FIXME why debug ? check vj-msg.h and "void vj_msg( " from vj-api.c:2340 + // filter with "user_data->filter_string = NULL" to remove the filter + gtk_tree_model_filter_refilter (user_data->stores[0].filtered); + gtk_tree_model_filter_refilter (user_data->stores[1].filtered); + gtk_tree_model_filter_refilter (user_data->stores[2].filtered); + } + } +} + +void on_console1_activate(GtkWidget *w, gpointer user_data) +{ + GtkWidget *n = glade_xml_get_widget_( info->main_window, "panels" ); + gint page = gtk_notebook_get_current_page( GTK_NOTEBOOK( n ) ); + + if( page == MODE_PLAIN ) + gtk_notebook_set_current_page( GTK_NOTEBOOK(n), + info->status_tokens[PLAY_MODE] ); + else + gtk_notebook_set_current_page( GTK_NOTEBOOK(n), + MODE_PLAIN ); +} + +gboolean on_entry_hostname_focus_in_event( GtkWidget *w, gpointer user_data) +{ + update_label_str( "runlabel", "Connect"); + return FALSE; +} + +gboolean on_entry_hostname_focus_out_event( GtkWidget *w, gpointer user_data) +{ +// update_label_str( "runlabel", "Run" ); + return FALSE; +} + + +gboolean on_entry_filename_focus_in_event( GtkWidget *w, gpointer user_data) +{ +// update_label_str( "runlabel", "Run" ); + return FALSE; +} + +void on_previewbw_toggled( GtkWidget *w , gpointer user_data) +{ + single_vims( VIMS_PREVIEW_BW ); + vj_msg(VEEJAY_MSG_INFO,"Changed preview to greyscale"); +} + +void on_previewtoggle_toggled(GtkWidget *w, gpointer user_data) +{ + int enabled = is_button_toggled("previewtoggle"); + multitrack_toggle_preview( info->mt, -1, enabled,glade_xml_get_widget_(info->main_window, "imageA") ); + vj_msg(VEEJAY_MSG_INFO,"Live view is %s", (enabled ? "enabled" : "disabled" )); +} + +void on_previewspeed_value_changed( GtkWidget *widget, gpointer user_data) +{ +} + +void on_previewscale_value_changed( GtkWidget *widget, gpointer user_data) +{ +} + +void on_preview_width_value_changed( GtkWidget *w, gpointer user_data) +{ +} +void on_preview_height_value_changed( GtkWidget *w, gpointer user_data) +{ +} + +void on_mt_new_activate( GtkWidget *w, gpointer user_data) +{ + multitrack_add_track( info->mt ); +} + +void on_mt_delete_activate( GtkWidget *w, gpointer user_data) +{ + multitrack_close_track( info->mt ); +} + + + +void on_mt_sync_start_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_start( info->mt ); +} + +void on_mt_sync_stop_clicked( GtkWidget *w , gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_PLAY_STOP,0 ); +} +void on_mt_sync_play_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_PLAY_FORWARD,0 ); +} +void on_mt_sync_backward_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_PLAY_BACKWARD,0); +} +void on_mt_sync_gotostart_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_GOTO_START,0 ); +} +void on_mt_sync_gotoend_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_GOTO_END,0 ); +} +void on_mt_sync_decspeed_clicked( GtkWidget *w, gpointer user_data) +{ + int n = info->status_tokens[SAMPLE_SPEED]; + if( n < 0 ) n += 1; + if( n > 0 ) n -= 1; + multitrack_sync_simple_cmd2( info->mt, VIMS_VIDEO_SET_SPEED, n ); + +} +void on_mt_sync_incspeed_clicked( GtkWidget *w, gpointer user_data) +{ + int n = info->status_tokens[SAMPLE_SPEED]; + if( n < 0 ) n -= 1; + if( n > 0 ) n += 1; + multitrack_sync_simple_cmd2( info->mt, VIMS_VIDEO_SET_SPEED, n ); +} +void on_mt_sync_prev_clicked( GtkWidget *w , gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_PREV_FRAME ,0 ); +} +void on_mt_sync_next_clicked( GtkWidget *w, gpointer user_data) +{ + multitrack_sync_simple_cmd( info->mt, VIMS_VIDEO_SKIP_FRAME, 0 ); +} + +void on_delete1_activate(GtkWidget *w, gpointer user_data) +{ +} +void on_new_source1_activate( GtkWidget *w , gpointer data ) +{ +} +void on_add_file1_activate(GtkWidget *w, gpointer user_data) +{ +} + +/****************************************************** + * on_effectchain_button_pressed() + * + * Signal handler over the effect chain. + * + * Catch button press event on shift+click to toogle chain state. + * NOTA : works over the FULL row + * + ******************************************************/ +gboolean on_effectchain_button_pressed (GtkWidget *tree, GdkEventButton *event, gpointer userdata) +{ + /* shift key + single click with the left mouse button? */ + if (event->state & GDK_SHIFT_MASK) + { + if (event->type == GDK_BUTTON_PRESS && event->button == 1) + { + GtkTreePath *path; + GtkTreeViewColumn *column; + gint cell_x, cell_y; + + if(gtk_tree_view_get_path_at_pos( GTK_TREE_VIEW( tree ), + (gint) event->x, + (gint) event->y, + &path, &column, &cell_x, &cell_y )) + + { + /* compare iter from tree selection and clicked path */ + GtkTreeIter iter; + gint fxcid = 0; + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW( tree )); + + gtk_tree_model_get_iter(model, &iter, path); + gtk_tree_model_get(model,&iter, FXC_ID, &fxcid, -1 ); + + /* user can click on all row, uncomment and fix accordingly the test to check particular column */ + //guint column_num = get_treeview_col_number_from_column ( column ); + //if(column_num != -1) + { + multi_vims(VIMS_CHAIN_ENTRY_SET_STATE, "%d %d",0, fxcid); + info->uc.reload_hint[HINT_HISTORY] = 1; + } + } + } + } + return FALSE; /* lets normal things happening */ +} + +static +gchar *get_clipboard_fx_parameter_buffer(int *mixing_src, int *mixing_cha, int *enabled, int *fx_id) +{ + char rest[2048 + 22 + 1]; + int len = 0; + int tmp[8]; + int i; + int n_params = 0; + int fid = 0; + + veejay_memset( rest,0,sizeof(rest)); + + multi_vims( VIMS_CHAIN_GET_ENTRY, "%d %d", 0,info->uc.selected_chain_entry ); + + gchar *answer = recv_vims(3,&len); + if(len <= 0 || answer == NULL ) + { + gveejay_popup_err( "Error", "Nothing in FX clipboard"); + if(answer) g_free(answer); + return NULL; + } + + i = sscanf( answer, "%d %d %d %d %d %d %d %d %d %d %d %1024[0-9 ]", + &fid, //fx id + &tmp[0], //is video + &n_params, //num params + &tmp[0], //kf_type + &tmp[0], //transition enabled, not copied + &tmp[0], //transition loop, not copied + &tmp[0], //kf_status + &tmp[1], //source + &tmp[2], //channel + &tmp[3], //fx enabled + &tmp[0], //dummy + rest + ); + + if( i != 12 ) { + g_free(answer); + return NULL; + } + + *mixing_src = tmp[1]; + *mixing_cha = tmp[2]; + *enabled = tmp[3]; + *fx_id = fid; + + g_free(answer); + + return strdup(rest); +} + +typedef struct +{ + char *parameters; + int fx_id; + int src; + int cha; + int enabled; +} clipboard_t; + +static clipboard_t *get_new_clipboard() +{ + clipboard_t *c = (clipboard_t*) vj_calloc( sizeof(clipboard_t) ); + + c->parameters = get_clipboard_fx_parameter_buffer( &(c->src), &(c->cha), &(c->enabled), &(c->fx_id) ); + if( c->parameters == NULL ) { + free(c); + return NULL; + } + return c; +} + +static void del_clipboard(clipboard_t *c) +{ + if(c) { + if(c->parameters) + free(c->parameters); + free(c); + } + c = NULL; +} + +static clipboard_t *last_clipboard = NULL; + +static void do_clipboard(clipboard_t *c, int id, int entry_id) +{ + char msg[1024]; + snprintf( msg, sizeof(msg), "%03d:%d %d %d %d %s;", + VIMS_CHAIN_ENTRY_SET_PRESET, + id, + entry_id, + c->fx_id, + c->enabled, + c->parameters + ); + + msg_vims(msg); + + snprintf( msg, sizeof(msg), "%03d:%d %d;", + ( c->enabled ? VIMS_CHAIN_ENTRY_SET_VIDEO_ON : VIMS_CHAIN_ENTRY_SET_VIDEO_OFF ), + id, + entry_id + ); + msg_vims(msg); + + if( last_clipboard->cha > 0 ) { + snprintf( msg, sizeof(msg), "%03d:%d %d %d %d;", + VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL, + id, + entry_id, + c->src, + c->cha + ); + msg_vims(msg); + } +} + +void on_button_fx_cut_clicked( GtkWidget *w, gpointer user_data) +{ + if(last_clipboard) + del_clipboard( last_clipboard ); + + last_clipboard = get_new_clipboard(); + + on_button_fx_del_clicked( NULL,NULL ); +} + +void on_button_fx_paste_clicked( GtkWidget *w, gpointer user_data) +{ + sample_slot_t *s = info->selected_slot; + + if( last_clipboard == NULL ) { + vj_msg(VEEJAY_MSG_INFO, "Nothing in FX clipboard"); + return; + } + + if( s == NULL ) { + vj_msg(VEEJAY_MSG_INFO, "No FX entry selected"); + return; + } + + do_clipboard( last_clipboard, s->sample_id, info->uc.selected_chain_entry ); + + info->uc.reload_hint[HINT_ENTRY]=1; +} + +void on_button_fx_copy_clicked(GtkWidget *w, gpointer user_data) +{ + if(last_clipboard) + del_clipboard(last_clipboard); + + last_clipboard = get_new_clipboard(); +} +void on_copy1_activate( GtkWidget *w, gpointer user_data) +{ +} +void on_new_color1_activate(GtkWidget *w , gpointer user_data) +{ +} +void on_delete2_activate( GtkWidget *w, gpointer user_data) +{ +} +void +on_spin_samplebank_select_value_changed + (GtkSpinButton *spinbutton, + gpointer user_data) +{ + GtkNotebook *samplebank = GTK_NOTEBOOK( info->sample_bank_pad ); + + gint max_page = gtk_notebook_get_n_pages(samplebank); + + gint page = gtk_spin_button_get_value_as_int(spinbutton); + + if(page >= max_page){ /* @mvh I know this is not pretty but why make it difficult */ + page = 0; + gtk_spin_button_set_value(spinbutton, page); + } else if( page < 0 ) { + page = max_page; + gtk_spin_button_set_value(spinbutton,page); + } + gtk_notebook_set_current_page_(samplebank, page); +} +void +on_button_samplebank_prev_clicked (GtkButton *button, + gpointer user_data) +{ + GtkNotebook *samplebank = GTK_NOTEBOOK( info->sample_bank_pad ); + gtk_notebook_prev_page(samplebank); + //update the bank spin widget + gint page = gtk_notebook_get_current_page (samplebank); + if (page != -1) + update_spin_value("spin_samplebank_select", page); +} + + +void +on_button_samplebank_next_clicked (GtkButton *button, + gpointer user_data) +{ + GtkNotebook *samplebank = GTK_NOTEBOOK( info->sample_bank_pad ); + gtk_notebook_next_page(samplebank); + //update the bank spin widget + gint page = gtk_notebook_get_current_page (samplebank); + if (page != -1) + update_spin_value("spin_samplebank_select", page); +} + +void +on_vims_messenger_rewind_clicked( GtkButton *togglebutton, gpointer user_data) +{ + info->vims_line = 0; + vj_msg(VEEJAY_MSG_INFO, "Start from line 0 in vims messenger editor"); +} + +void +on_vims_messenger_clear_clicked( GtkButton *togglebutton, gpointer user_data) +{ + clear_textview_buffer( "vims_messenger_textview"); +} + +void +on_vims_messenger_single_clicked( void ) +{ + GtkTextView *t= GTK_TEXT_VIEW(GTK_WIDGET( + glade_xml_get_widget_( + info->main_window, + "vims_messenger_textview")) + ); + + GtkTextBuffer* buffer = gtk_text_view_get_buffer(t); + int lc = gtk_text_buffer_get_line_count(buffer); + + if(info->vims_line > lc ) + info->vims_line = 0; + + while(info->vims_line < lc ) + { + GtkTextIter start, end; + gtk_text_buffer_get_iter_at_line(buffer, &start, info->vims_line); + + end = start; + + gtk_text_iter_forward_sentence_end(&end); + gchar *str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); + + info->vims_line++; + + if(strlen(str) <= 0) + continue; // skip empty lines + + if(str[0] != '+') + { + msg_vims( str ); + vj_msg(VEEJAY_MSG_INFO, "Sent VIMS message '%s' (line %d)",str, info->vims_line-1 ); + break; + } + } +} + +static gint srt_load_subtitle(int sid) +{ + gint len = 0; + gint seq_id = 0; + gint tc1l=0; + gint tc2l=0; + char tc1[20]; + char tc2[20]; + char tmp[1000]; + gint tlen=0; + gint ln[4]; + gint fg[4]; + gint bg[4]; + gint use_bg = 0; + gint outline = 0; + gint size = 0; + gint font = 0; + gint x =0; + gint y = 0; + + multi_vims( VIMS_SRT_INFO, "%d", sid ); + gchar *text = recv_vims( 6,&len ); + veejay_memset(tmp,0,sizeof(tmp)); + veejay_memset(tc1,0,sizeof(tc1)); + veejay_memset(tc2,0,sizeof(tc2)); + + clear_textview_buffer( "textview_text" ); + int s1=0,s2=0; + if(text && len > 0 ) + { + sscanf( text,"%5d%9d%9d%2d", &seq_id ,&s1,&s2,&tc1l ); + strncpy( tc1, text+7+18,tc1l ); + sscanf( text+7+18+tc1l,"%2d", &tc2l ); + strncpy( tc2, text+7+18+tc1l + 2, tc2l ); + sscanf( text+7+18+tc1l+2+tc2l, "%3d", &tlen ); + strncpy( tmp, text + 7 + 18 + tc1l + 2 + tc2l + 3, tlen ); + sscanf( text+7+18 + tc1l+2+tc2l+3+tlen,"%04d%04d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d%03d", + &x,&y, &font, &size, &bg[0],&bg[1],&bg[2],&fg[0],&fg[1],&fg[2],&use_bg,&outline,&ln[0],&ln[1], + &ln[2],&bg[3],&fg[3],&ln[3] ); + } + + srt_locked_ = 1; + + update_spin_range( "spin_text_start",0, get_total_frames(),s1); + update_spin_range( "spin_text_end",0, get_total_frames(),s2); + + set_textview_buffer( "textview_text", tmp ); + + update_spin_value( "spin_text_start" ,s1); + update_spin_value( "spin_text_end", s2 ); + + change_box_color_rgb( + glade_xml_get_widget_(info->main_window, "boxbg" ), + bg[0],bg[1],bg[2],bg[3], (is_button_toggled( "textcolorbg" ) ? 1 : 0 ) ); + + change_box_color_rgb( + glade_xml_get_widget_(info->main_window, "boxtext" ), + fg[0],fg[1],fg[2],fg[3], (is_button_toggled( "textcolorfg" ) ? 1: 0) ); + + + change_box_color_rgb( + glade_xml_get_widget_( info->main_window, "boxln" ), + ln[0],ln[1],ln[2],ln[3], (is_button_toggled( "textcolorln" ) ? 1: 0) ); + + memcpy( bg_, bg, sizeof(bg_)); + memcpy( fg_, fg, sizeof(fg_)); + memcpy( ln_, ln, sizeof(ln_)); + + set_toggle_button( "use_bg", use_bg ); + set_toggle_button( "use_outline", outline); + update_spin_value( "spin_text_size", size ); + update_spin_value( "spin_text_x", x ); + update_spin_value( "spin_text_y", y ); + + if(is_button_toggled( "textcolorfg") ) + { + update_slider_value( "textcolorred", fg_[0],0 ); + update_slider_value( "textcolorblue",fg_[2],0 ); + update_slider_value( "textcolorgreen",fg_[1],0); + update_slider_value( "textcoloralpha", fg_[3],0); + } + else if( is_button_toggled( "textcolorbg") ) + { + update_slider_value( "textcolorred", bg_[0],0 ); + update_slider_value( "textcolorblue",bg_[2],0 ); + update_slider_value( "textcolorgreen",bg_[1],0); + update_slider_value( "textcoloralpha",bg_[3],0); + } + else if ( is_button_toggled( "textcolorln" )) + { + update_slider_value( "textcolorred", ln_[0],0 ); + update_slider_value( "textcolorblue",ln_[2],0 ); + update_slider_value( "textcolorgreen",ln_[1],0); + update_slider_value( "textcoloralpha", ln_[3],0); + } + GtkWidget *combo = glade_xml_get_widget_( info->main_window, "combobox_fonts" ); + gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), font ); + + +// glade_xml_get_widget_( info->main_window, "combobox_textsrt" ); +// gtk_combo_box_set_active( GTK_COMBO_BOX( combo ), seq_id-1 ); + +// if(len > 0 ) +// enable_widget( "SRTframe"); + + + srt_locked_ = 0; + + if(text) free(text); + + return seq_id; +} + +void on_button_text_new_clicked( GtkWidget *w, gpointer data ) +{ + gint x = get_nums( "spin_text_x" ); + gint y = get_nums( "spin_text_y" ); + gint s1 = 0; + gint s2 = 0; + if( info->status_tokens[PLAY_MODE] == MODE_SAMPLE ) + { + s1 = info->status_tokens[SAMPLE_START]; + s2 = info->status_tokens[SAMPLE_END]; + } + else + { + s1 = 0; + s2 = get_nums("stream_length"); + } + + gchar *text = strdup(" "); + + multi_vims( VIMS_SRT_ADD, "%d %d %d %d %d %s", + 0,s1,s2,x,y,text ); + + int tmp = 0; + gchar *new_srt_id = recv_vims( 5, &tmp ); + int id = 0; + if(new_srt_id && tmp > 0) + { + sscanf( new_srt_id, "%d", &id ); + if(id > 0 ) + srt_seq_ = id; + } + if( new_srt_id ) + free(new_srt_id); + + free(text); + if( id > 0 ) + info->uc.reload_hint[HINT_HISTORY] = 1; + +} + +void on_button_text_del_clicked( GtkWidget *w, gpointer data ) +{ + multi_vims( VIMS_SRT_DEL, "%d", srt_seq_ ); + info->uc.reload_hint[HINT_HISTORY] = 1; +} + +void on_spin_text_start_value_changed( GtkWidget *w, gpointer data ) +{ + gint start = get_nums( "spin_text_end"); + char *text = format_time( start, info->el.fps ); + update_label_str( "labeltextstart", text ); + free(text); +} + +void on_spin_text_end_value_changed( GtkWidget *w, gpointer data ) +{ + gint end = get_nums( "spin_text_end" ); + char *text = format_time( end, info->el.fps ); + update_label_str( "labeltextend", text ); + free(text); +} +void on_spin_text_x_value_changed( GtkWidget *w, gpointer data ) +{ + if( srt_locked_) + return; + + gint x = get_nums( "spin_text_x" ); + gint y = get_nums( "spin_text_y"); + multi_vims( VIMS_FONT_POS,"%d %d", x,y ); +} +void on_spin_text_y_value_changed( GtkWidget *w, gpointer data ) +{ + if( srt_locked_) + return; + + gint x = get_nums( "spin_text_x" ); + gint y = get_nums( "spin_text_y"); + multi_vims( VIMS_FONT_POS,"%d %d", x,y ); +} +void on_button_srt_save_clicked( GtkWidget *w, gpointer data ) +{ + gchar *filename = dialog_save_file("Save SRT file"); + if( filename ) + { + multi_vims( VIMS_SRT_SAVE, "%s", filename ); + g_free(filename); + } +} +void on_button_srt_load_clicked( GtkWidget *w, gpointer data ) +{ + gchar *filename = dialog_open_file("Load SRT file",4); + if( filename ) + { + multi_vims( VIMS_SRT_LOAD, "%s", filename ); + g_free(filename); + } +} + + +void on_combobox_fonts_changed( GtkWidget *w, gpointer data ) +{ + if(srt_locked_) + return; + gint font = gtk_combo_box_get_active( GTK_COMBO_BOX( w ) ); + gint size = get_nums( "spin_text_size" ); + if( font < 0 || size < 0 ) + return; + multi_vims( VIMS_FONT_SIZE_FONT, "%d %d", font , size ); +} +void on_spin_text_size_value_changed( GtkWidget *w, gpointer data ) +{ + if( srt_locked_) + return; + GtkWidget *ww = glade_xml_get_widget_( info->main_window, + "combobox_fonts" ); + gint font = gtk_combo_box_get_active( GTK_COMBO_BOX( ww ) ); + gint size = get_nums( "spin_text_size" ); + + multi_vims( VIMS_FONT_SIZE_FONT, "%d %d", font , size ); +} + +void on_button_text_update_clicked(GtkWidget *w, gpointer data) +{ + gint s1 = get_nums( "spin_text_start" ); + gint s2 = get_nums( "spin_text_end" ); + gchar *text = get_textview_buffer( "textview_text" ); + if(text) + multi_vims( VIMS_SRT_UPDATE, "%d %d %d %s", srt_seq_, s1,s2,text ); +} + +static void change_box_color_rgb( GtkWidget *box, int r, int g, int b,int a, int fill ) +{ + cairo_t *cr; + cr = gdk_cairo_create (gtk_widget_get_window(box)); + + GdkColor col; + + memset( &col,0, sizeof( GdkColor ) ); + col.red = 255.0 * r; + col.green = 255.0 * g; + col.blue = 255.0 * b; + + if(fill) + { + update_slider_value( "textcolorred", r ,0); + update_slider_value( "textcolorgreen",g,0 ); + update_slider_value( "textcolorblue",b,0); + update_slider_value( "textcoloralpha",a,0); + } + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill (cr); + + cairo_destroy(cr); +} + +void on_combobox_textsrt_changed( GtkWidget *w, gpointer data) +{ + if(info->status_lock) + return; + + gchar *k = gtk_combo_box_text_get_active_text( GTK_COMBO_BOX_TEXT(w) ); + int sid = atoi(k); + if( sid > 0) + { + multi_vims( VIMS_SRT_SELECT, "%d", sid ); + srt_seq_ = sid; + gint res = srt_load_subtitle(sid); + char text[32]; + sprintf(text, "Edit SRT %d", res ); + update_label_str( "srtid_label", text ); + } +} + + +static void change_box_color( GtkWidget *box, double val, int plane, int fill ) +{ + cairo_t *cr; + cr = gdk_cairo_create (gtk_widget_get_window(box)); + + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + double v = (1.0 / 255.0) * val; + + int r = get_slider_val( "textcolorred" ); + int b = get_slider_val( "textcolorgreen" ); + int g = get_slider_val( "textcolorblue" ); + int a = get_slider_val("textcoloralpha" ); + + if(plane==0) + { + col.red = 65535.0 * v; + switch(fill) + { + case 0: fg_[0] = r; break; + case 1: bg_[0] = r; break; + case 2: ln_[0] = r; break; + } + } + if(plane==1) + { + col.green = 65535 * v; + switch(fill) + { + case 0: fg_[1] = g; break; + case 1: bg_[1] = g; break; + case 2: ln_[1] = g; break; + } + } + if(plane==2) + { + col.blue = 65535 * v; + switch(fill) + { + case 0: fg_[2] = b; break; + case 1: bg_[2] = b; break; + case 2: ln_[2] = b; break; + } + } + + if(plane==-1) + { + col.red = 255.0 * r; + col.green = 255.0 * g; + col.blue = 255.0 * b; + switch(fill) + { + case 0: fg_[0] = r; fg_[1] = g; fg_[2] = b; fg_[3] = a; break; + case 1: bg_[0] = r; bg_[1] = g; bg_[2] = b; bg_[3] = a; break; + case 2: ln_[0] = r; ln_[1] = g; ln_[2] = b; ln_[3] = a; break; + } + + } + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill (cr); + + cairo_destroy(cr); +} + +static void colbox( const char *name1,const char *name2, int plane ) +{ + int fg = is_button_toggled("textcolorfg"); + int bg = is_button_toggled("textcolorbg"); + int ln = is_button_toggled("textcolorln"); + + int v = get_slider_val( name2 ); + change_box_color( + glade_xml_get_widget_( info->main_window,name1 ) , + v, + plane, + -1 ); //green + + if(fg) + change_box_color( + glade_xml_get_widget_( info->main_window, "boxtext" ), + 0.0, + -1, + 0 ); + if(bg) + change_box_color( + glade_xml_get_widget_( info->main_window, "boxbg" ), + 0.0, + -1, + 1 ); + + if(ln) + change_box_color( + glade_xml_get_widget_( info->main_window, "boxln" ), + 0.0, + -1, + 2 ); + +} + +void on_textcoloralpha_value_changed(GtkWidget *w, gpointer data ) +{ + if(info->status_lock || srt_locked_) + return; + + int fg = is_button_toggled("textcolorfg"); + int bg = is_button_toggled("textcolorbg"); + int ln = is_button_toggled("textcolorln"); + gint r = get_slider_val( "textcolorred" ); + gint g = get_slider_val( "textcolorgreen" ); + gint b = get_slider_val( "textcolorblue" ); + gint a = get_slider_val( "textcoloralpha" ); + + int m = 0; + if( fg ) + { + fg_[3] = a; + m = 1; + } + if( bg ) + { + bg_[3] = a; + m = 2; + } + if( ln ) + { + ln_[3] = a; + m = 3; + } + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", r,g,b,a, m ); +} + +void on_textcolorred_value_changed(GtkWidget *w , gpointer data ) +{ + colbox( "boxred", "textcolorred", 0 ); +} + + +void on_textcolorgreen_value_changed(GtkWidget *w , gpointer data ) +{ + colbox( "boxgreen", "textcolorgreen", 1 ); +} + +void on_textcolorblue_value_changed(GtkWidget *w , gpointer data ) +{ + colbox( "boxblue", "textcolorblue", 2 ); +} + +void on_textcolorfg_toggled( GtkWidget *w, gpointer data ) +{ + if( is_button_toggled( "textcolorfg" ) ) + { + update_slider_value( "textcolorred", fg_[0],0 ); + update_slider_value( "textcolorgreen", fg_[1],0 ); + update_slider_value( "textcolorblue", fg_[2],0); + update_slider_value( "textcoloralpha", fg_[3],0); + } +} +void on_textcolorbg_toggled( GtkWidget *w, gpointer data ) +{ + if( is_button_toggled( "textcolorbg" ) ) + { + update_slider_value( "textcolorred", bg_[0],0 ); + update_slider_value( "textcolorgreen", bg_[1],0 ); + update_slider_value( "textcolorblue", bg_[2],0); + update_slider_value( "textcoloralpha", bg_[3],0); + } +} +void on_textcolorln_toggled( GtkWidget *w, gpointer data ) +{ + if( is_button_toggled( "textcolorln" ) ) + { + update_slider_value( "textcolorred", ln_[0],0 ); + update_slider_value( "textcolorgreen", ln_[1],0 ); + update_slider_value( "textcolorblue", ln_[2],0); + update_slider_value( "textcoloralpha", ln_[3],0); + } +} + +void on_use_bg_toggled( GtkWidget *w , gpointer data) +{ + if(srt_locked_ || info->status_lock) + return; + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", + is_button_toggled("use_outline"), + is_button_toggled("use_bg"), + 0, + 0, + 0 ); +} + +void on_use_outline_toggled( GtkWidget *w, gpointer data) +{ + if(srt_locked_ || info->status_lock) + return; + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", + is_button_toggled("use_outline"), + is_button_toggled("use_bg"), + 0, + 0, + 0 ); + +} + +void on_buttonfg_clicked( GtkWidget *w, gpointer data ) +{ + gint r = get_slider_val( "textcolorred" ); + gint g = get_slider_val( "textcolorgreen" ); + gint b = get_slider_val( "textcolorblue" ); + gint a = get_slider_val( "textcoloralpha"); + fg_[0] = r; + fg_[1] = g; + fg_[2] = b; + fg_[3] = a; + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", r,g,b,a, 1 ); +} +void on_buttonbg_clicked( GtkWidget *w, gpointer data ) +{ + gint r = get_slider_val( "textcolorred" ); + gint g = get_slider_val( "textcolorgreen" ); + gint b = get_slider_val( "textcolorblue" ); + gint a = get_slider_val( "textcoloralpha" ); + + bg_[0] = r; + bg_[1] = g; + bg_[2] = b; + bg_[3] = a; + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", r,g,b,a, 2 ); +} +void on_buttonln_clicked( GtkWidget *w, gpointer data ) +{ + gint r = get_slider_val( "textcolorred" ); + gint g = get_slider_val( "textcolorgreen" ); + gint b = get_slider_val( "textcolorblue" ); + gint a = get_slider_val( "textcoloralpha" ); + + ln_[0] = r; + ln_[1] = g; + ln_[2] = b; + ln_[3] = a; + + multi_vims( VIMS_FONT_COL, "%d %d %d %d %d", r,g,b,a, 3 ); +} + +gboolean boxfg_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.red = 255.0 * fg_[0]; + col.green = 255.0 * fg_[1]; + col.blue = 255.0 * fg_[2]; + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + +gboolean boxbg_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.red = 255.0 * bg_[0]; + col.green = 255.0 * bg_[1]; + col.blue = 255.0 * bg_[2]; + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + +gboolean boxln_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.red = 255.0 * ln_[0]; + col.green = 255.0 * ln_[1]; + col.blue = 255.0 * ln_[2]; + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + +gboolean boxred_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.red = 255 * get_slider_val( "textcolorred" ); + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + + +gboolean boxgreen_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.green = 0xff * get_slider_val( "textcolorgreen" ); + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + +gboolean boxblue_draw(GtkWidget *w, cairo_t *cr ) +{ + GdkColor col; + memset( &col,0, sizeof( GdkColor ) ); + col.blue = 255 * get_slider_val( "textcolorblue" ); + + gdk_cairo_set_source_color( cr, &col ); + cairo_rectangle (cr, 0, 0, 24, 24); + cairo_fill ( cr ); + + return TRUE; +} + + +void on_osdbutton_clicked(GtkWidget *w, gpointer data ) +{ + single_vims(VIMS_OSD); +} + +void on_seqactive_toggled( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + int enabled = is_button_toggled("seqactive" ); + multi_vims( VIMS_SEQUENCE_STATUS, "%d", enabled ); + vj_midi_learning_vims_msg(info->midi,NULL, VIMS_SEQUENCE_STATUS, enabled); + vj_msg(VEEJAY_MSG_INFO, "Sample sequencer is %s", (enabled ? "enabled" : "disabled" )); +} + +void on_hqbutton_clicked( GtkWidget *w, gpointer data ) // 1/1 +{ + multitrack_set_quality( info->mt, 0 ); + vj_msg(VEEJAY_MSG_INFO, "Live view quality set to best"); +} +void on_lqbutton_clicked( GtkWidget *w, gpointer data ) // 1/2 +{ + multitrack_set_quality( info->mt, 1 ); + vj_msg(VEEJAY_MSG_INFO, "Live view quality set to half resolution"); +} +void on_bq_button_clicked( GtkWidget *w, gpointer data ) // 1/4 +{ + multitrack_set_quality( info->mt, 2 ); + vj_msg(VEEJAY_MSG_INFO, "Live view quality set to a quarter resolution"); +} +void on_uq_button_clicked( GtkWidget *w, gpointer data ) // 1/8 +{ + multitrack_set_quality( info->mt, 3 ); + vj_msg(VEEJAY_MSG_INFO,"Live view quality set to an eighth resolution"); +} + +void on_record_vp_clicked( GtkWidget *w, gpointer data ) +{ + single_vims( VIMS_RECVIEWPORT ); +} + +void on_subrender_entry_toggle_toggled(GtkWidget *w, gpointer data) +{ + if(info->status_lock || info->parameter_lock) + return; + int enabled = is_button_toggled( "subrender_entry_toggle" ); + multi_vims( VIMS_SUB_RENDER_ENTRY,"%d %d %d", 0,-1,enabled); + vj_msg(VEEJAY_MSG_INFO, "Sub rendering is %s", (enabled ? "enabled" : "disabled")); +} + +void on_transition_enabled_toggled(GtkWidget *w, gpointer data) +{ + if(info->status_lock || info->parameter_lock) + return; + int enabled = is_button_toggled( "transition_enabled" ); + int loop = get_nums("transition_loop"); + + multi_vims( VIMS_SAMPLE_MIX_TRANSITION, "%d %d %d %d", 0, -1, enabled, loop ); + if(enabled) { + vj_msg(VEEJAY_MSG_INFO, "Transitioning to mixing source at loop %d", loop); + } + else { + vj_msg(VEEJAY_MSG_INFO, "Disabled transition to mixing source"); + } +} + +void on_transition_loop_value_changed(GtkWidget *w, gpointer data) +{ + if(info->status_lock || info->parameter_lock) + return; + + int enabled = is_button_toggled( "transition_enabled" ); + int loop = get_nums("transition_loop"); + + multi_vims( VIMS_SAMPLE_MIX_TRANSITION, "%d %d %d %d", 0, -1, enabled, loop ); +} + +void on_macroplay_toggled( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + if( is_button_toggled( "macroplay" )) + { + multi_vims( VIMS_MACRO, "%d", 2 ); + vj_midi_learning_vims_msg( info->midi,NULL,VIMS_MACRO,2 ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg( VEEJAY_MSG_INFO, "Started macro playback"); + } +} + +void on_macrorecord_toggled( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + if( is_button_toggled( "macrorecord")) + { + multi_vims( VIMS_MACRO, "%d", 1 ); + vj_midi_learning_vims_msg( info->midi,NULL,VIMS_MACRO,1 ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Started macro record"); + } +} + +void on_macrostop_toggled( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + if( is_button_toggled( "macrostop")) + { + multi_vims( VIMS_MACRO, "%d", 0 ); + vj_midi_learning_vims_msg( info->midi,NULL,VIMS_MACRO,0 ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Stopped macro playback/record"); + } +} + +void on_macroclear_clicked( GtkWidget *w, gpointer data ) +{ + if(info->status_lock) + return; + + multi_vims( VIMS_MACRO, "%d", 3 ); + vj_midi_learning_vims_msg( info->midi,NULL, VIMS_MACRO, 3); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Reset macro playback/record"); +} + + +void on_macro_loop_position_value_changed( GtkWidget *w, gpointer data) +{ + if(!info->status_lock) + macro_line[2] = (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON(w) ); +} + +void on_macro_dup_position_value_changed( GtkWidget *w, gpointer data ) +{ + if(!info->status_lock) + macro_line[1] = (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON(w) ); +} + +void on_macro_frame_position_value_changed( GtkWidget *w, gpointer data) +{ + if(!info->status_lock) + macro_line[0] = (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON(w) ); +} + +void on_macro_button_clear_bank_clicked( GtkWidget *w, gpointer data) +{ + int num = get_nums("macro_bank_select"); + multi_vims(VIMS_CLEAR_MACRO_BANK, "%d", num); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Macro bank %d cleared", num); +} + +void on_macro_save_button_clicked( GtkWidget *w, gpointer data) +{ + macro_line[0] = get_nums("macro_frame_position"); + macro_line[1] = get_nums("macro_dup_position"); + macro_line[2] = get_nums("macro_loop_position"); + + char *message = get_text("macro_vims_message"); + multi_vims( VIMS_PUT_MACRO, "%d %d %d %s", macro_line[0],macro_line[1],macro_line[2], message ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Saved new event at frame %ld.%d, loop %d", macro_line[0],macro_line[1],macro_line[2]); +} + +void on_macro_delete_button_clicked( GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_DEL_MACRO,"%d %d %d %d", macro_line[0], macro_line[1], macro_line[2], macro_line[3] ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Removed event at frame %ld.%d, loop %d #%d", macro_line[0],macro_line[1],macro_line[2],macro_line[3]); +} + +void on_macro_refresh_button_clicked( GtkWidget *w, gpointer data) +{ + info->uc.reload_hint[HINT_MACRO] = 1; +} + +void on_macro_delete_all_button_clicked( GtkWidget *w, gpointer data) +{ + multi_vims( VIMS_MACRO, "%d", 3 ); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Removed all events from all banks"); +} + +void on_macro_bank_select_value_changed( GtkWidget *w, gpointer data) +{ + int bank = gtk_spin_button_get_value(GTK_SPIN_BUTTON(w)); + multi_vims( VIMS_MACRO_SELECT, "%d",bank); + info->uc.reload_hint[HINT_MACRO] = 1; + vj_msg(VEEJAY_MSG_INFO, "Selected macro bank %d",bank); +} + +void on_midilearn_toggled( GtkWidget *w, gpointer data ) +{ + vj_midi_learn( info->midi); +} + +void on_midievent_toggled( GtkWidget *w, gpointer data ) +{ + vj_midi_play( info->midi ); +} + +void on_load_midi_layout_activate( GtkWidget *w , gpointer data ) +{ + gchar *filename = dialog_open_file( "Select MIDI configuration file to load",0); + if( filename ) { + vj_midi_load( info->midi, filename ); + g_free(filename); + } +} +void on_save_midi_layout_activate( GtkWidget *w, gpointer data ) +{ + gchar *filename = dialog_save_file( "Save MIDI configuration to file"); + if(filename) + vj_midi_save( info->midi, filename ); +} + +void on_clear_midi_layout_activate( GtkWidget *w, gpointer data ) +{ + vj_midi_reset(info->midi); +} + +void on_button_vloop_stop_clicked(GtkWidget *widget, gpointer user_data) +{ + single_vims( VIMS_VLOOPBACK_STOP ); +} + +void on_button_vloop_start_clicked(GtkWidget *widget, gpointer user_data) +{ + multi_vims( VIMS_VLOOPBACK_START, "%d", get_nums( "spin_vloop" ) ); +} + +void on_toggle_multicast_toggled(GtkWidget *widget, gpointer user_data) +{ + if( is_button_toggled( "toggle_multicast" ) ) { + multi_vims( VIMS_VIDEO_MCAST_START, "%d", 0 ); + vj_msg(VEEJAY_MSG_INFO, "Multicast enabled"); + } + else { + single_vims( VIMS_VIDEO_MCAST_STOP ); + vj_msg(VEEJAY_MSG_INFO, "Multicast disabled"); + } +} diff --git a/veejay-current/reloaded-gtk3/src/callback.h b/veejay-current/reloaded-gtk3/src/callback.h new file mode 100644 index 00000000..010f630e --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/callback.h @@ -0,0 +1,80 @@ +/* gveejay - Linux VeeJay - GVeejay GTK+-2/Glade User Interface + * (C) 2002-2015 Niels Elburg + * (C) 2016 JΓ©rΓ΄me Blanchi + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef VJCALLBACK_H +#define VJCALLBACK_H + + +#define SLIDER_CHANGED( arg_num, value ) \ +{\ +if(!info->status_lock && !info->parameter_lock)\ +{\ +info->parameter_lock = 1;\ +multi_vims( VIMS_CHAIN_ENTRY_SET_ARG_VAL, "%d %d %d %d", 0, info->uc.selected_chain_entry,arg_num, value );\ +vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0,info->uc.selected_chain_entry, arg_num,1 );\ +if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \ +int *entry_tokens = &(info->uc.entry_tokens[0]);\ +update_label_str( "value_friendlyname", _effect_get_hint( entry_tokens[ENTRY_FXID], arg_num, value ));\ +info->parameter_lock = 0;\ +}\ +} + +#define PARAM_CHANGED( arg_num, fraction, name ) \ +{\ +if(!info->status_lock && !info->parameter_lock)\ +{\ +info->parameter_lock = 1;\ +multi_vims( VIMS_CHAIN_ENTRY_SET_ARG_VAL, "%d %d %d %d", 0, info->uc.selected_chain_entry,arg_num, (get_slider_val(name) + fraction) );\ +update_slider_value( name, (get_slider_val(name) + fraction), 0 );\ +vj_midi_learning_vims_fx( info->midi, arg_num, VIMS_CHAIN_ENTRY_SET_ARG_VAL, 0, info->uc.selected_chain_entry,arg_num,2 );\ +if(info->uc.selected_rgbkey) update_rgbkey_from_slider(); \ +int *entry_tokens = &(info->uc.entry_tokens[0]);\ +update_label_str( "value_friendlyname", _effect_get_hint( entry_tokens[ENTRY_FXID], arg_num, get_slider_val(name) ));\ +info->parameter_lock = 0;\ +}\ +} + + +#define KF_CHANGED( arg_num ) \ +{\ +enable_widget("fxanimcontrols");\ +if(arg_num != info->uc.selected_parameter_id)\ +{\ +vj_kf_select_parameter(arg_num);\ +}\ +} + +/*int sample_calctime();*/ +void text_defaults(); + +gboolean boxbg_draw ( GtkWidget *w, cairo_t *cr); +gboolean boxfg_draw ( GtkWidget *w, cairo_t *cr ); +gboolean boxln_draw ( GtkWidget *w, cairo_t *cr ); +gboolean boxred_draw ( GtkWidget *w, cairo_t *cr ); +gboolean boxblue_draw ( GtkWidget *w, cairo_t *cr ); +gboolean boxgreen_draw ( GtkWidget *w, cairo_t *cr ); + + +void on_timeline_value_changed ( GtkWidget *widget, gpointer user_data ); +void on_timeline_in_point_changed ( GtkWidget *widget, gpointer user_data ); +void on_timeline_out_point_changed ( GtkWidget *widget, gpointer user_data ); +void on_timeline_bind_toggled( GtkWidget *widget, gpointer user_data ); +void on_timeline_cleared ( GtkWidget *widget, gpointer user_data ); + +#endif diff --git a/veejay-current/reloaded-gtk3/src/cellrendererspin.c b/veejay-current/reloaded-gtk3/src/cellrendererspin.c new file mode 100644 index 00000000..435ab832 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/cellrendererspin.c @@ -0,0 +1,369 @@ +/*************************************************************************** + cellrendererspin.c + ------------------ + begin : Tue Oct 21 2003 + copyright : (C) 2003 by Tim-Philipp Mόller + email : t.i.m at orange dot net + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 is a dirty 15-minute hack that tries to + * make editable cells with spin buttons instead + * of the text entry widget. + * + * Modify how you please. At the moment you need + * to hook up your own cell data function to make + * sure that the number of digits is the same in + * editing mode as it is in non-editing mode. + * + * The parameters passed to _new() should probably + * be properties, and probably we don't need most + * of them anyway. Also, it would be good if there + * was a better method to ensure that the number + * of digits is the same without this. + * + * Maybe one should just rip out the whole _render + * stuff from GtkCellRendererText and make a + * whole new specialised GtkCellRenderFloat + * or something. + * + * If anyone ever completes this code to sth useful, + * or achieves sth similar in another way, or has + * any comments on it, please drop me a mail. + */ + + /* + * Modified by d.j.a.y , 2018 + * - gtk3 compliant + */ + +#include "cellrendererspin.h" + +#include + +#define GUI_CELL_RENDERER_SPIN_PATH "gui-cell-renderer-spin-path" +#define GUI_CELL_RENDERER_SPIN_INFO "gui-cell-renderer-spin-info" + +/* Some boring function declarations: GObject type system stuff */ + +static void gui_cell_renderer_spin_init (GuiCellRendererSpin *cellspin); + +static void gui_cell_renderer_spin_class_init (GuiCellRendererSpinClass *klass); + +static void gui_cell_renderer_spin_finalize (GObject *gobject); + + +static gpointer parent_class; + + +static GtkCellEditable +*gui_cell_renderer_spin_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags); + +struct _GCRSpinInfo +{ + gulong focus_out_id; +}; + +typedef struct _GCRSpinInfo GCRSpinInfo; + +/*************************************************************************** + * + * gui_cell_renderer_spin_get_type + * + * Here we register our type with the GObject type system if we + * haven't done so yet. Everything else is done in the callbacks. + * + ***************************************************************************/ + +GType +gui_cell_renderer_spin_get_type (void) +{ + static GType cell_spin_type = 0; + + if (cell_spin_type) + return cell_spin_type; + + if (1) + { + static const GTypeInfo cell_spin_info = + { + sizeof (GuiCellRendererSpinClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gui_cell_renderer_spin_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GuiCellRendererSpin), + 0, /* n_preallocs */ + (GInstanceInitFunc) gui_cell_renderer_spin_init, + }; + + /* Derive from GtkCellRenderer */ + cell_spin_type = g_type_register_static (GTK_TYPE_CELL_RENDERER_TEXT, + "GuiCellRendererSpin", + &cell_spin_info, + 0); + } + + return cell_spin_type; +} + +/*************************************************************************** + * + * gui_cell_renderer_spin_init + * + * Set some default properties of the parent (GtkCellRendererText). + * + ***************************************************************************/ + +static void +gui_cell_renderer_spin_init (GuiCellRendererSpin *cellrendererspin) +{ + return; +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_class_init: + * + ***************************************************************************/ + +static void +gui_cell_renderer_spin_class_init (GuiCellRendererSpinClass *klass) +{ + GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS(klass); + GObjectClass *object_class = G_OBJECT_CLASS(klass); + + parent_class = g_type_class_peek_parent (klass); + object_class->finalize = gui_cell_renderer_spin_finalize; + + /* Override the cell renderer's edit-related methods */ + cell_class->start_editing = gui_cell_renderer_spin_start_editing; +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_finalize: free any resources here + * + ***************************************************************************/ + +static void +gui_cell_renderer_spin_finalize (GObject *object) +{ +/* + GuiCellRendererSpin *cellrendererspin = GUI_CELL_RENDERER_SPIN(object); +*/ + + /* Free any dynamically allocated resources here */ + + + /* chain up to parent class to make sure + * they release all their memory as well */ + + (* G_OBJECT_CLASS (parent_class)->finalize) (object); +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_new + * + * return a new cell renderer instance + * (all the parameters should really be properties) + * + * Not sure which of all these values are really + * relevant for the spin button - needs checking! + * + ***************************************************************************/ + +GtkCellRenderer * +gui_cell_renderer_spin_new (gdouble lower, + gdouble upper, + gdouble step_inc, + gdouble page_inc, + gdouble page_size, + gdouble climb_rate, + guint digits) +{ + GtkCellRenderer *cell; + GuiCellRendererSpin *spincell; + + cell = g_object_new(GUI_TYPE_CELL_RENDERER_SPIN, NULL); + + spincell = GUI_CELL_RENDERER_SPIN(cell); + + spincell->lower = lower; + spincell->upper = upper; + spincell->step_inc = step_inc; + spincell->page_inc = page_inc; + spincell->page_size = page_size; + spincell->climb_rate = climb_rate; + spincell->digits = digits; + + return cell; +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_editing_done + * + ***************************************************************************/ + +static void +gui_cell_renderer_spin_editing_done (GtkCellEditable *spinbutton, + gpointer data) +{ + const gchar *path; + const gchar *new_text; + GCRSpinInfo *info; + + info = g_object_get_data (G_OBJECT (data), GUI_CELL_RENDERER_SPIN_INFO); + + if (info->focus_out_id > 0) + { + g_signal_handler_disconnect (spinbutton, info->focus_out_id); + info->focus_out_id = 0; + } + + gboolean editing_canceled; + g_object_get (spinbutton, "editing-canceled", &editing_canceled, NULL); + if (editing_canceled) + return; + + path = g_object_get_data (G_OBJECT (spinbutton), GUI_CELL_RENDERER_SPIN_PATH); + new_text = gtk_entry_get_text (GTK_ENTRY(spinbutton)); + + g_signal_emit_by_name(data, "edited", path, new_text); +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_focus_out_event + * + ***************************************************************************/ + +static gboolean +gui_cell_renderer_spin_focus_out_event (GtkWidget *spinbutton, + GdkEvent *event, + gpointer data) +{ + gui_cell_renderer_spin_editing_done (GTK_CELL_EDITABLE (spinbutton), data); + + /* entry needs focus-out-event */ + return FALSE; +} + +/*************************************************************************** + * + * gui_cell_renderer_spin_start_editing + * + ***************************************************************************/ + +static gboolean +onButtonPress (GtkWidget *spinbutton, GdkEventButton *bevent, gpointer data) +{ + if ((bevent->button == 1 && bevent->type == GDK_2BUTTON_PRESS) || bevent->type == GDK_3BUTTON_PRESS) + { + g_print ("double or triple click caught and ignored.\n"); + return TRUE; /* don't invoke other handlers */ + } + + return FALSE; +} + + +/*************************************************************************** + * + * gui_cell_renderer_spin_start_editing + * + ***************************************************************************/ + +static GtkCellEditable * +gui_cell_renderer_spin_start_editing (GtkCellRenderer *cell, + GdkEvent *event, + GtkWidget *widget, + const gchar *path, + const GdkRectangle *background_area, + const GdkRectangle *cell_area, + GtkCellRendererState flags) +{ + GtkCellRendererText *celltext; + GuiCellRendererSpin *spincell; + GtkAdjustment *adj; + GtkWidget *spinbutton; + GCRSpinInfo *info; + gdouble curval = 0.0; + + celltext = GTK_CELL_RENDERER_TEXT(cell); + spincell = GUI_CELL_RENDERER_SPIN(cell); + + /* If the cell isn't editable we return NULL. */ + gboolean editable; + g_object_get (celltext, "editable", &editable, NULL); + if (editable == FALSE) + return NULL; + + spinbutton = g_object_new (GTK_TYPE_SPIN_BUTTON, "has_frame", FALSE, "numeric", TRUE, NULL); + + /* dirty */ + gchar *text; + g_object_get (celltext, "text", &text, NULL); + if (text) + curval = atof(text); + + adj = GTK_ADJUSTMENT(gtk_adjustment_new(curval, + spincell->lower, + spincell->upper, + spincell->step_inc, + spincell->page_inc, + 0)); + + gtk_spin_button_configure(GTK_SPIN_BUTTON(spinbutton), adj, spincell->climb_rate, spincell->digits); + + g_object_set_data_full (G_OBJECT(spinbutton), GUI_CELL_RENDERER_SPIN_PATH, g_strdup (path), g_free); + + gtk_editable_select_region (GTK_EDITABLE (spinbutton), 0, -1); + + gtk_widget_show (spinbutton); + + g_signal_connect (spinbutton, "editing_done", + G_CALLBACK (gui_cell_renderer_spin_editing_done), + celltext); + + /* hack trying to catch the quite annoying effect + * a double click has while editing */ + + g_signal_connect (spinbutton, "button_press_event", + G_CALLBACK (onButtonPress), + NULL); + + info = g_new0(GCRSpinInfo, 1); + + info->focus_out_id = g_signal_connect (spinbutton, "focus_out_event", + G_CALLBACK (gui_cell_renderer_spin_focus_out_event), + celltext); + + g_object_set_data_full (G_OBJECT (cell), GUI_CELL_RENDERER_SPIN_INFO, info, g_free); + + return GTK_CELL_EDITABLE (spinbutton); +} diff --git a/veejay-current/reloaded-gtk3/src/cellrendererspin.h b/veejay-current/reloaded-gtk3/src/cellrendererspin.h new file mode 100644 index 00000000..85cb1af9 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/cellrendererspin.h @@ -0,0 +1,68 @@ +/*************************************************************************** + cellrendererspin.h + ------------------ + begin : Tue Oct 21 2003 + copyright : (C) 2003 by Tim-Philipp Mόller + email : t.i.m at orange dot net + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef _cellrendererspin_h_included_ +#define _cellrendererspin_h_included_ + +#include + +/* Some boilerplate GObject type check and type cast macros */ + +#define GUI_TYPE_CELL_RENDERER_SPIN (gui_cell_renderer_spin_get_type()) +#define GUI_CELL_RENDERER_SPIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GUI_TYPE_CELL_RENDERER_SPIN, GuiCellRendererSpin)) +#define GUI_CELL_RENDERER_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CELL_RENDERER_SPIN, GuiCellRendererSpinClass)) +#define GUI_IS_CELL_RENDERER_SPIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CELL_RENDERER_SPIN)) +#define GUI_IS_CELL_RENDERER_SPIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CELL_RENDERER_SPIN)) +#define GUI_CELL_RENDERER_SPIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CELL_RENDERER_SPIN, GuiCellRendererSpinClass)) + + + +typedef struct _GuiCellRendererSpin GuiCellRendererSpin; +typedef struct _GuiCellRendererSpinClass GuiCellRendererSpinClass; + + +struct _GuiCellRendererSpin +{ + GtkCellRendererText parent; + + gdouble lower; + gdouble upper; + gdouble step_inc; + gdouble page_inc; + gdouble page_size; + gdouble climb_rate; + guint digits; +}; + +struct _GuiCellRendererSpinClass +{ + GtkCellRendererTextClass parent_class; +}; + +GType gui_cell_renderer_spin_get_type (void); + +GtkCellRenderer *gui_cell_renderer_spin_new (gdouble lower, + gdouble upper, + gdouble step_inc, + gdouble page_inc, + gdouble page_size, + gdouble climb_rate, + guint digits); + + +#endif /* _spinbar_renderer_h_included_ */ + diff --git a/veejay-current/reloaded-gtk3/src/common.h b/veejay-current/reloaded-gtk3/src/common.h new file mode 100644 index 00000000..a723728b --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/common.h @@ -0,0 +1,73 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef GVRCOMMON_H +#define GVRCOMMON_H +#define STATUS_BYTES 150 +#define STATUS_TOKENS 35 +#define STATUS_LENGTH 512 +#define VEEJAY_CODENAME VERSION +/* Status bytes */ + +#define ELAPSED_TIME 0 +#define PLAY_MODE 2 +#define CURRENT_ID 3 +#define SAMPLE_FX 4 +#define SAMPLE_START 5 +#define SAMPLE_END 6 +#define SAMPLE_SPEED 7 +#define SAMPLE_LOOP 8 +#define SAMPLE_COUNT 12 +#define SAMPLE_MARKER_START 13 +#define STREAM_TYPE 13 +#define SAMPLE_MARKER_END 14 +#define FRAME_NUM 1 +#define TOTAL_FRAMES 6 +#define TOTAL_SLOTS 16 +#define TOTAL_MEM 17 +#define CURRENT_FPS 18 +#define CYCLE_LO 19 +#define CYCLE_HI 20 +#define SEQ_ACT 21 +#define SEQ_CUR 22 +#define CHAIN_FADE 23 +#define FRAME_DUP 24 +#define MACRO 25 +#define SUBRENDER 26 +#define FADE_METHOD 27 +#define FADE_ENTRY 28 +#define FADE_ALPHA 29 +#define SAMPLE_LOOP_STAT 30 +#define SAMPLE_LOOP_STAT_STOP 31 +#define SAMPLE_INV_COUNT 33 +#define FEEDBACK 32 +#define CURRENT_ENTRY 15 +#define MODE_PLAIN 2 +#define MODE_SAMPLE 0 +#define MODE_PATTERN 3 +#define MODE_STREAM 1 +#define STREAM_COL_R 5 +#define STREAM_COL_G 6 +#define STREAM_COL_B 7 +#define STREAM_RECORDED 11 +#define STREAM_DURATION 10 +#define STREAM_RECORDING 9 +#define MAX_UI_PARAMETERS 16 +#define STREAM_AVF 12 + +#endif diff --git a/veejay-current/reloaded-gtk3/src/curve.c b/veejay-current/reloaded-gtk3/src/curve.c new file mode 100644 index 00000000..6226a8f4 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/curve.c @@ -0,0 +1,97 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include "curve.h" + +void get_points_from_curve( GtkWidget *curve, int len, float *vec ) +{ + gtk3_curve_get_vector( curve, len, vec ); +} + +void reset_curve( GtkWidget *curve ) +{ + gtk_widget_set_sensitive( curve, TRUE ); + gtk3_curve_reset( curve ); + gtk3_curve_set_range( curve , 0.0, 1.0, 0.0, 1.0 ); +} + +void set_points_in_curve( Gtk3CurveType type, GtkWidget *curve) +{ + gtk3_curve_set_curve_type( curve , type ); +} + + +int set_points_in_curve_ext( GtkWidget *curve, unsigned char *blob, int id, int fx_entry, int *lo, int *hi, int *curve_type, int *status) +{ + int parameter_id = 0; + int start = 0, end =0,type=0; + int entry = 0; + int n = sscanf( (char*) blob, "key%2d%2d%8d%8d%2d%2d", &entry, ¶meter_id, &start, &end,&type,status ); + int len = end - start; + int i; + int min = 0, max = 0; + + if(n != 6 || len <= 0 ) + { + return -1; + } + + _effect_get_minmax(id, &min, &max, parameter_id ); + + unsigned int k = 0; + unsigned char *in = blob + 27; + float *vec = (float*) vj_calloc(sizeof(float) * len ); + int diff = max - min; + for(i = start ; i < end; i ++ ) + { + unsigned char *ptr = in + (k * 4); + int value = + ( ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24) ); + + // val = ((Input - InputLow) / (InputHigh - InputLow)) * (OutputHigh - OutputLow) + OutputLow; + // with OutputLow==0 and OutputHigh==1 in gtkcurve range + float val = ((float)(value - min) / (diff)); + + vec[k] = val; + k++; + } + + gtk3_curve_set_vector( curve , len, vec ); + + switch( type ) { + case 1: *curve_type = GTK3_CURVE_TYPE_SPLINE; break; + case 2: *curve_type = GTK3_CURVE_TYPE_FREE; break; + default: *curve_type = GTK3_CURVE_TYPE_LINEAR; break; + } + + gtk3_curve_set_curve_type( curve, *curve_type ); + + *lo = start; + *hi = end; + + free(vec); + + return parameter_id; +} diff --git a/veejay-current/reloaded-gtk3/src/curve.h b/veejay-current/reloaded-gtk3/src/curve.h new file mode 100644 index 00000000..f79eca00 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/curve.h @@ -0,0 +1,33 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef VJCURVE_H +#define VJCURVE_H +#include +#include +#define MAX_CHAIN_LEN 20 + +#include "gtk3curve.h" + +int set_points_in_curve_ext( GtkWidget *curve, unsigned char *blob, int id, int fx_entry, int *lo, int *hi, int *ct, int *status); +void set_points_in_curve( Gtk3CurveType type, GtkWidget *curve); +void reset_curve( GtkWidget *curve ); +void get_points_from_curve( GtkWidget *curve, int len, float *v ); + +#endif diff --git a/veejay-current/reloaded-gtk3/src/format_codes.h b/veejay-current/reloaded-gtk3/src/format_codes.h new file mode 100644 index 00000000..2c958f04 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/format_codes.h @@ -0,0 +1,46 @@ +/* + $Id: format_codes.h,v 1.10 2005/12/09 23:07:56 wackston2 Exp $ + + Copyright (C) 2001 Andrew Stevens + + 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 +*/ + +#ifndef __FORMAT_CODES_H__ +#define __FORMAT_CODES_H__ + +#define MPEG_FORMAT_MPEG1 0 +#define MPEG_FORMAT_VCD 1 +#define MPEG_FORMAT_VCD_NSR 2 +#define MPEG_FORMAT_MPEG2 3 +#define MPEG_FORMAT_SVCD 4 +#define MPEG_FORMAT_SVCD_NSR 5 +#define MPEG_FORMAT_VCD_STILL 6 +#define MPEG_FORMAT_SVCD_STILL 7 +#define MPEG_FORMAT_DVD_NAV 8 +#define MPEG_FORMAT_DVD 9 +#define MPEG_FORMAT_ATSC480i 10 +#define MPEG_FORMAT_ATSC480p 11 +#define MPEG_FORMAT_ATSC720p 12 +#define MPEG_FORMAT_ATSC1080i 13 + +#define MPEG_FORMAT_FIRST 0 +#define MPEG_FORMAT_LAST MPEG_FORMAT_ATSC1080i + +#define MPEG_STILLS_FORMAT(x) ((x)==MPEG_FORMAT_VCD_STILL||(x)==MPEG_FORMAT_SVCD_STILL) +#define MPEG_ATSC_FORMAT(x) ((x)>=MPEG_FORMAT_ATSC480i && (x)<=MPEG_FORMAT_ATSC1080i) +#define MPEG_HDTV_FORMAT(x) MPEG_ATSC_FORMAT(x) +#define MPEG_SDTV_FORMAT(x) (!MPEG_HDTV_FORMAT(x)) +#endif /* __FORMAT_CODES_H__ */ diff --git a/veejay-current/reloaded-gtk3/src/gtk3curve.c b/veejay-current/reloaded-gtk3/src/gtk3curve.c new file mode 100644 index 00000000..f71170ea --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/gtk3curve.c @@ -0,0 +1,1975 @@ +/* Copyright (C) 2016 Benoit Touchette + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version + * 2.1 of the License. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* Portions of this code Copyright (C) 1997 David Mosberger and + * Copyright (C) 1997 - 2000 GTK+ Team. + */ + +#include +#include +#include +#include + +#include + +#include "gtk3curve.h" + +#ifdef DEBUG +#define DEBUG_INFO g_print +#define DEBUG_ERROR g_printerr +#else +#define DEBUG_INFO(...) +#define DEBUG_ERROR(...) +#endif + +static guint curve_type_changed_signal = 0; +static gint Gtk3Curve_private_offset = 0; +static GtkDrawingAreaClass *gtk3_curve_parent_class = NULL; + +#define _gtk3_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID + +#define GTK3_PARAM_READABLE G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB +#define GTK3_PARAM_WRITABLE G_PARAM_WRITABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB +#define GTK3_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB + +#define RADIUS 3 /* radius of the control points */ +#define MIN_DISTANCE 8 /* min distance between control points */ +#define GRAPH_MASK (GDK_EXPOSURE_MASK | \ + GDK_POINTER_MOTION_MASK | \ + GDK_POINTER_MOTION_HINT_MASK | \ + GDK_ENTER_NOTIFY_MASK | \ + GDK_LEAVE_NOTIFY_MASK | \ + GDK_BUTTON_PRESS_MASK | \ + GDK_BUTTON_RELEASE_MASK | \ + GDK_BUTTON1_MOTION_MASK) + +struct _Gtk3CurvePrivate +{ + GdkWindow *event_window; + GList *children; + + gint cursor_type; + + gfloat min_x; + gfloat max_x; + gfloat min_y; + gfloat max_y; + + gboolean use_bg_theme; + + Gtk3CurveColor background; + Gtk3CurveColor cpoint; + Gtk3CurveColor grid; + Gtk3CurveColor curve; + + Gtk3CurveType curve_type; + + gint width; + gint height; + + gint grab_point; + gint last; + + Gtk3CurveGridSize grid_size; + Gtk3CurveData curve_data; + + guint state : 1; + guint in_curve : 1; +}; + +enum +{ + PROP_0, + PROP_CURVE_TYPE, + PROP_MIN_X, + PROP_MAX_X, + PROP_MIN_Y, + PROP_MAX_Y +}; + +static void gtk3_curve_realize (GtkWidget *widget); +static void gtk3_curve_unrealize (GtkWidget *widget); +static void gtk3_curve_style_updated (GtkWidget *widget); +static void gtk3_curve_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); +static void gtk3_curve_configure (Gtk3Curve *curve); +static gboolean gtk3_curve_draw (GtkWidget *widget, + cairo_t *cr); +static void gtk3_curve_map (GtkWidget *widget); +static void gtk3_curve_unmap (GtkWidget *widget); +static gboolean gtk3_curve_enter (GtkWidget *widget, + GdkEventCrossing *event); +static gboolean gtk3_curve_leave (GtkWidget *widget, + GdkEventCrossing *event); +static gboolean gtk3_curve_button_press (GtkWidget *widget, + GdkEventButton *event); +static gboolean gtk3_curve_button_release (GtkWidget *widget, + GdkEventButton *event); +static gboolean gtk3_curve_motion_notify (GtkWidget *widget, + GdkEventMotion *event); +static void gtk3_curve_screen_changed (GtkWidget *widget, + GdkScreen *prev_screen); +static void gtk3_curve_style_updated (GtkWidget *widget); +static void gtk3_curve_finalize (GObject *object); +static void gtk3_curve_dispose (GObject *object); +static void gtk3_curve_get_property (GObject *object, + guint param_id, + GValue *value, + GParamSpec *pspec); +static void gtk3_curve_set_property (GObject *object, + guint param_id, + const GValue *value, + GParamSpec *pspec); +static void gtk3_curve_size_graph (Gtk3Curve *curve); +static void gtk3_curve_create_layouts (GtkWidget *widget); +static void gtk3_curve_reset_vector (GtkWidget *widget); +static void gtk3_curve_interpolate (GtkWidget *widget, + gint width, + gint height); +static int project (gfloat value, + gfloat min, + gfloat max, + int norm); +static gfloat unproject (gint value, + gfloat min, + gfloat max, + int norm); +static void spline_solve (int n, + gfloat x[], + gfloat y[], + gfloat y2[]); +static gfloat spline_eval (int n, + gfloat x[], + gfloat y[], + gfloat y2[], + gfloat val); +static void gtk3_curve_draw_line (cairo_t *cr, + gdouble x1, + gdouble y1, + gdouble x2, + gdouble y2); +static void gtk3_curve_class_init (Gtk3CurveClass *klass); +static void gtk3_curve_init (Gtk3Curve *self); + +static void gtk3_curve_get_cursor_coord (GtkWidget *widget, + gint *tx, + gint *ty); + +static inline gpointer +gtk3_curve_get_instance_private (Gtk3Curve *self) +{ + return (G_STRUCT_MEMBER_P (self, Gtk3Curve_private_offset)); +} + +static void gtk_gadget_class_intern_init (gpointer klass) +{ + g_type_class_adjust_private_offset (klass, &Gtk3Curve_private_offset); + gtk3_curve_parent_class = g_type_class_peek_parent (klass); + gtk3_curve_class_init ((Gtk3CurveClass*) klass); +} + +GType +gtk3_curve_get_type (void) +{ + static GType curve_type = 0; + + if (G_UNLIKELY (curve_type == 0)) + { + const GTypeInfo curve_info = + { + sizeof (Gtk3CurveClass), + NULL, // base_init + NULL, // base_finalize + (GClassInitFunc) gtk3_curve_class_init, + NULL, // class_finalize + NULL, // class_data + sizeof (Gtk3Curve), + 0, // n_preallocs + (GInstanceInitFunc) gtk3_curve_init, + }; + + curve_type = g_type_register_static (GTK_TYPE_WIDGET, "Gtk3Curve", + &curve_info, 0); + + Gtk3Curve_private_offset = + g_type_add_instance_private (curve_type, sizeof (Gtk3CurvePrivate)); + } + return curve_type; +} + +GType +gtk3_curve_type_get_type (void) +{ + static GType etype = 0; + if (G_UNLIKELY(etype == 0)) + { + static const GEnumValue values[] = + { + { GTK3_CURVE_TYPE_LINEAR, "GTK3_CURVE_TYPE_LINEAR", "linear" }, + { GTK3_CURVE_TYPE_SPLINE, "GTK3_CURVE_TYPE_SPLINE", "spline" }, + { GTK3_CURVE_TYPE_FREE, "GTK3_CURVE_TYPE_FREE", "free" }, + { 0, NULL, NULL } + }; + etype = g_enum_register_static (g_intern_static_string ("Gtk3CurveType"), + values); + } + return etype; +} + +static void +gtk3_curve_class_init (Gtk3CurveClass* klass) +{ + GtkContainerClass *container_class; + GObjectClass *gobject_class; + GtkWidgetClass *widget_class; + + DEBUG_INFO("class_init [S]\n"); + + widget_class = GTK_WIDGET_CLASS (klass); + + widget_class->realize = gtk3_curve_realize; + widget_class->unrealize = gtk3_curve_unrealize; + + widget_class->draw = gtk3_curve_draw; + widget_class->motion_notify_event = gtk3_curve_motion_notify; + + widget_class->map = gtk3_curve_map; + widget_class->unmap = gtk3_curve_unmap; + + widget_class->enter_notify_event = gtk3_curve_enter; + widget_class->leave_notify_event = gtk3_curve_leave; + + widget_class->button_press_event = gtk3_curve_button_press; + widget_class->button_release_event = gtk3_curve_button_release; + + widget_class->size_allocate = gtk3_curve_size_allocate; + widget_class->screen_changed = gtk3_curve_screen_changed; + widget_class->style_updated = gtk3_curve_style_updated; + + gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DRAWING_AREA); + + gobject_class = G_OBJECT_CLASS (klass); + + g_type_class_adjust_private_offset (klass, &Gtk3Curve_private_offset); + + gtk3_curve_parent_class = g_type_class_peek_parent (klass); + + gobject_class->finalize = gtk3_curve_finalize; + gobject_class->dispose = gtk3_curve_dispose; + gobject_class->set_property = gtk3_curve_set_property; + gobject_class->get_property = gtk3_curve_get_property; + + g_object_class_install_property (gobject_class, + PROP_CURVE_TYPE, + g_param_spec_enum ("curve-type", + "Curve type", + "Is this curve linear, spline interpolated, or free-form", + GTK3_TYPE_CURVE_TYPE, + GTK3_CURVE_TYPE_SPLINE, + GTK3_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, + PROP_MIN_X, + g_param_spec_float ("min-x", + "Minimum X", + "Minimum possible value for X", + -G_MAXFLOAT, + G_MAXFLOAT, + 0.0, + GTK3_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, + PROP_MAX_X, + g_param_spec_float ("max-x", + "Maximum X", + "Maximum possible X value", + -G_MAXFLOAT, + G_MAXFLOAT, + 1.0, + GTK3_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, + PROP_MIN_Y, + g_param_spec_float ("min-y", + "Minimum Y", + "Minimum possible value for Y", + -G_MAXFLOAT, + G_MAXFLOAT, + 0.0, + GTK3_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, + PROP_MAX_Y, + g_param_spec_float ("max-y", + "Maximum Y", + "Maximum possible value for Y", + -G_MAXFLOAT, + G_MAXFLOAT, + 1.0, + GTK3_PARAM_READWRITE)); + + curve_type_changed_signal = + g_signal_new ("curve-type-changed", + G_OBJECT_CLASS_TYPE (gobject_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (Gtk3CurveClass, curve_type_changed), + NULL, NULL, + _gtk3_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + DEBUG_INFO("class_init [E]\n"); +} + +static void +gtk3_curve_init (Gtk3Curve* self) +{ + Gtk3CurvePrivate *priv; + + DEBUG_INFO("init [S]\n"); + + gtk_widget_set_has_window(GTK_WIDGET(self), TRUE); + gtk_widget_set_redraw_on_allocate(GTK_WIDGET(self), TRUE); + + self->priv = gtk3_curve_get_instance_private (self); + priv = self->priv; + + /* Curve Data Points */ + priv->curve_data.description = NULL; + priv->curve_data.n_points = 0; + priv->curve_data.d_point = NULL; + priv->curve_data.n_cpoints = 0; + priv->curve_data.d_cpoints = NULL; + priv->curve_data.curve_type = GTK3_CURVE_TYPE_SPLINE; + + /* Misc */ + priv->use_bg_theme = TRUE; + priv->cursor_type = GDK_TOP_LEFT_ARROW; + priv->grid_size = GTK3_CURVE_GRID_LARGE; + priv->height = 0; + priv->grab_point = -1; + + /* Min & Max range */ + priv->min_x = 0.0; + priv->max_x = 1.0; + priv->min_y = 0.0; + priv->max_y = 1.0; + + /* Default Colors */ + gtk3_curve_set_color_background_rgba (GTK_WIDGET(self), 1.0, 1.0, 1.0, 1.0); + gtk3_curve_set_color_curve_rgba (GTK_WIDGET(self), 0.0, 0.0, 0.0, 1.0); + gtk3_curve_set_color_grid_rgba (GTK_WIDGET(self), 0.0, 0.0, 0.0, 1.0); + gtk3_curve_set_color_cpoint_rgba (GTK_WIDGET(self), 0.2, 0.2, 0.2, 1.0); + + gtk3_curve_size_graph (self); + + DEBUG_INFO("init [E]\n"); +} + +GtkWidget * +gtk3_curve_new() +{ + return g_object_new (GTK3_TYPE_CURVE, NULL); +} + +static void +gtk3_curve_style_updated (GtkWidget *widget) +{ + GTK_WIDGET_CLASS (gtk3_curve_parent_class)->style_updated (widget); + + DEBUG_INFO("style_updated [S]\n"); + if (gtk_widget_get_realized (widget) && + gtk_widget_get_has_window (widget)) + { + gtk_widget_queue_draw (widget); + } + DEBUG_INFO("style_updated [E]\n"); +} + +static void +gtk3_curve_realize (GtkWidget *widget) +{ + GtkAllocation allocation; + GdkWindow *window; + GdkWindow *parent_window; + GdkWindowAttr attributes; + gint attributes_mask; + Gtk3CurvePrivate *priv; + + priv = GTK3_CURVE (widget)->priv; + + DEBUG_INFO("realize [S]\n"); + if (!gtk_widget_get_has_window (widget)) + { + GTK_WIDGET_CLASS (gtk3_curve_parent_class)->realize (widget); + } + else + { + gtk_widget_set_realized (widget, TRUE); + parent_window = gtk_widget_get_parent_window (widget); + gtk_widget_set_window (widget, parent_window); + g_object_ref (parent_window); + + gtk_widget_get_allocation (widget, &allocation); + DEBUG_INFO("allocation [%d,%d] [%dx%d]\n", + allocation.x, + allocation.y, + allocation.width, + allocation.height); + + attributes.window_type = GDK_WINDOW_CHILD; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.visual = gtk_widget_get_visual (widget); + attributes.event_mask = gtk_widget_get_events (widget) | + GRAPH_MASK; + + attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; + + priv->event_window = gdk_window_new (parent_window, + &attributes, + attributes_mask); + + gtk_widget_register_window (widget, priv->event_window); + gtk_widget_set_window (widget, priv->event_window); + } + + gtk3_curve_configure (GTK3_CURVE (widget)); + + DEBUG_INFO("realize [E]\n"); +} + +static void +gtk3_curve_unrealize (GtkWidget *widget) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + + DEBUG_INFO("unrealize [S]\n"); + if (priv->event_window != NULL) + { + DEBUG_INFO("unregister/destroy\n"); + gtk_widget_unregister_window (widget, priv->event_window); + gdk_window_destroy (priv->event_window); + priv->event_window = NULL; + } + + DEBUG_INFO("unrealize [E]\n"); +} + +static void +gtk3_curve_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) +{ + g_return_if_fail (GTK3_IS_CURVE (widget)); + g_return_if_fail (allocation != NULL); + + DEBUG_INFO("size_allocate [S]\n"); + gtk_widget_set_allocation (widget, allocation); + + DEBUG_INFO("allocation [%d,%d] [%dx%d]\n", + allocation->x, + allocation->y, + allocation->width, + allocation->height); + + if (gtk_widget_get_realized (widget)) + { + if (gtk_widget_get_has_window (widget)) + { + gdk_window_move_resize (gtk_widget_get_window (widget), + allocation->x, allocation->y, + allocation->width, allocation->height); + } + + gtk3_curve_configure (GTK3_CURVE (widget)); + } + DEBUG_INFO("size_allocate [E]\n"); +} + +static void +gtk3_curve_configure (Gtk3Curve *curve) +{ + GtkAllocation allocation; + GtkWidget *widget; + GdkEvent *event = gdk_event_new (GDK_CONFIGURE); + + DEBUG_INFO("configure [S]\n"); + + widget = GTK_WIDGET (curve); + gtk_widget_get_allocation (widget, &allocation); + + DEBUG_INFO("allocation [%d,%d] [%dx%d]\n", + allocation.x, + allocation.y, + allocation.width, + allocation.height); + + event->configure.window = g_object_ref (gtk_widget_get_window (widget)); + event->configure.send_event = TRUE; + event->configure.x = allocation.x; + event->configure.y = allocation.y; + event->configure.width = allocation.width; + event->configure.height = allocation.height; + + gtk_widget_event (widget, event); + gtk_widget_queue_draw (widget); + + gdk_event_free (event); + + DEBUG_INFO("configure [E]\n"); +} + +static void gtk3_curve_draw_line (cairo_t *cr, + gdouble x1, gdouble y1, + gdouble x2, gdouble y2) +{ + cairo_move_to (cr, x1, y1); + cairo_line_to (cr, x2, y2); + cairo_stroke (cr); +} + +static gboolean +gtk3_curve_draw (GtkWidget *widget, + cairo_t *cr) +{ + Gtk3CurvePrivate *priv; + GtkStyleContext *style_context; + GtkStyle *style; + GdkRGBA color; + gint last_x, last_y; + gint i; + GtkAllocation allocation; + Gtk3Curve *curve; + gfloat grid; + + curve = GTK3_CURVE (widget); + priv = curve->priv; + + DEBUG_INFO("draw [S]\n"); + +//FIXME Should not be drawn is not visible ... only widget visible test ? or draw called too often? + + if (!cr) + { + DEBUG_ERROR("cairo == null\n"); + return TRUE; + } + + gtk_widget_get_allocation (widget, &allocation); + + DEBUG_INFO("%d x %d\n", allocation.width, allocation.height); + + if (priv->height != allocation.width || + priv->curve_data.n_points != allocation.height) + { + gtk3_curve_interpolate (widget, + allocation.width - RADIUS * 2, + allocation.height - RADIUS * 2); + } + + if (priv->use_bg_theme) + { + style_context = gtk_widget_get_style_context(GTK_WIDGET (curve)); + gtk_render_background(style_context, cr, + 0, 0, + allocation.width + RADIUS * 2, + allocation.height + RADIUS * 2); + gtk_style_context_get_color (style_context, + gtk_style_context_get_state (style_context), + &color); + gdk_cairo_set_source_rgba (cr, &color); + } + else + { + cairo_set_source_rgba (cr, + priv->background.red, + priv->background.green, + priv->background.blue, + priv->background.alpha); + } + cairo_paint(cr); + + cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); + + switch (priv->grid_size) + { + default: + case GTK3_CURVE_GRID_MICRO: + grid = 10.0; + break; + case GTK3_CURVE_GRID_SMALL: + grid = 8.0; + break; + case GTK3_CURVE_GRID_MEDIUM: + grid = 6.0; + break; + case GTK3_CURVE_GRID_LARGE: + grid = 4.0; + case GTK3_CURVE_GRID_XLARGE: + grid = 2.0; + } + + gfloat wm = allocation.width - (RADIUS * 2); + gfloat hm = allocation.height - (RADIUS * 2); + + /* Draw grid */ + for (i = 0; i < (int)grid+1; i++) + { + cairo_set_line_width (cr, 0.5); + cairo_set_source_rgba (cr, + priv->grid.red, + priv->grid.green, + priv->grid.blue, + priv->grid.alpha); + gdouble x1 = RADIUS; + gdouble y1 = i * (hm / grid) + RADIUS; + gdouble x2 = wm + RADIUS; + gdouble y2 = i * (hm / grid) + RADIUS; + gtk3_curve_draw_line (cr, x1, y1, x2, y2); + + x1 = i * (wm / grid) + RADIUS; + y1 = RADIUS; + x2 = i * (wm / grid) + RADIUS; + y2 = hm + RADIUS; + gtk3_curve_draw_line (cr, x1, y1, x2, y2); + } + + /* Draw a curve or line or set of lines */ + for (int i=0; icurve_data.n_points; i++) + { + gdouble x = priv->curve_data.d_point[i].x; + gdouble y = priv->curve_data.d_point[i].y; + + if (i > 0) + { + cairo_set_line_width (cr, 0.5); + cairo_set_source_rgba (cr, + priv->curve.red, + priv->curve.green, + priv->curve.blue, + priv->curve.alpha); + gtk3_curve_draw_line (cr, last_x, last_y, x, y); + } + + last_x = x; + last_y = y; + } + + if (priv->curve_data.curve_type != GTK3_CURVE_TYPE_FREE) + for (i = 0; i < priv->curve_data.n_cpoints; ++i) + { + gdouble x, y; + + if (priv->curve_data.d_cpoints[i].x < priv->min_x) + continue; + + x = project (priv->curve_data.d_cpoints[i].x, + priv->min_x, priv->max_x, + wm); + y = allocation.height - project (priv->curve_data.d_cpoints[i].y, + priv->min_y, + priv->max_y, + hm); + + /* draw a bullet */ + cairo_set_source_rgba (cr, + priv->cpoint.red, + priv->cpoint.green, + priv->cpoint.blue, + priv->cpoint.alpha); + cairo_arc(cr, + x, + y, + RADIUS * 1.5, + 0, + 2 * M_PI); + cairo_fill (cr); + } + + DEBUG_INFO("draw [E]\n"); + return FALSE; +} + +static void +gtk3_curve_map (GtkWidget *widget) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + + GTK_WIDGET_CLASS (gtk3_curve_parent_class)->map (widget); + + DEBUG_INFO("map [S]\n"); + if (priv->event_window) + { + DEBUG_INFO("show\n"); + gdk_window_show (priv->event_window); + } + DEBUG_INFO("map [E]\n"); +} + +static void +gtk3_curve_unmap (GtkWidget *widget) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + + DEBUG_INFO("unmap [S]\n"); + if (priv->event_window) + { + DEBUG_INFO("hide\n"); + gdk_window_hide (priv->event_window); + } + + GTK_WIDGET_CLASS (gtk3_curve_parent_class)->unmap (widget); + DEBUG_INFO("unmap [E]\n"); +} + +static gboolean +gtk3_curve_enter (GtkWidget *widget, + GdkEventCrossing *event) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + + DEBUG_INFO("enter [S]\n"); + if (event->window == priv->event_window) + { + priv->in_curve = TRUE; + } + DEBUG_INFO("enter [E]\n"); + + return FALSE; +} + +static gboolean +gtk3_curve_leave (GtkWidget *widget, + GdkEventCrossing *event) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + + DEBUG_INFO("leave [S]\n"); + if (event->window == priv->event_window) + { + priv->in_curve = FALSE; + } + DEBUG_INFO("leave [E]\n"); + + return FALSE; +} + +static +void gtk3_curve_get_cursor_coord(GtkWidget *widget, gint *tx, gint *ty) +{ + GdkDeviceManager *device_manager; + GdkDevice *device_pointer; + GdkDisplay *display; + + /* get the pointer position */ + display = gtk_widget_get_display (widget); + device_manager = gdk_display_get_device_manager (display); + device_pointer = gdk_device_manager_get_client_pointer (device_manager); + gdk_window_get_device_position (gtk_widget_get_window (widget), + device_pointer, + tx, ty, NULL); +} + +static gboolean +gtk3_curve_button_press (GtkWidget *widget, + GdkEventButton *event) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + GdkCursorType new_type = priv->cursor_type; + GtkAllocation allocation; + gint cx, x, y, width, height, i; + gint closest_point = 0; + gfloat rx, ry, min_x; + gint tx, ty; + guint distance; + + DEBUG_INFO("button press [S]\n"); + + gtk_grab_add (widget); + new_type = GDK_TCROSS; + + gtk_widget_get_allocation (widget, &allocation); + + width = allocation.width - RADIUS * 2; + height = allocation.height - RADIUS * 2; + + if ((width < 0) || (height < 0)) + return FALSE; + + /* get the pointer position */ + gtk3_curve_get_cursor_coord (widget, &tx, &ty); + x = CLAMP ((tx - RADIUS), 0, width - 1); + y = CLAMP ((ty - RADIUS), 0, height - 1); + + DEBUG_INFO("press : xy[%dx%d] txy[%dx%d]\n", + x, y, + tx, ty); + + min_x = priv->min_x; + + distance = ~0U; + for (i = 0; i < priv->curve_data.n_cpoints; ++i) + { + cx = project (priv->curve_data.d_cpoints[i].x, min_x, priv->max_x, width); + if ((guint) abs (x - cx) < distance) + { + distance = abs (x - cx); + closest_point = i; + } + } + + switch (priv->curve_data.curve_type) + { + default: + case GTK3_CURVE_TYPE_LINEAR: + case GTK3_CURVE_TYPE_SPLINE: + if (distance > MIN_DISTANCE) + { + /* insert a new control point */ + if (priv->curve_data.n_cpoints > 0) + { + cx = project (priv->curve_data.d_cpoints[closest_point].x, min_x, + priv->max_x, width); + if (x > cx) + ++closest_point; + } + ++priv->curve_data.n_cpoints; + priv->curve_data.d_cpoints = + g_realloc (priv->curve_data.d_cpoints, + priv->curve_data.n_cpoints * sizeof (*priv->curve_data.d_cpoints)); + for (i = priv->curve_data.n_cpoints - 1; i > closest_point; --i) + memcpy (priv->curve_data.d_cpoints + i, priv->curve_data.d_cpoints + i - 1, + sizeof (*priv->curve_data.d_cpoints)); + } + priv->grab_point = closest_point; + priv->curve_data.d_cpoints[priv->grab_point].x = + unproject (x, min_x, priv->max_x, width); + priv->curve_data.d_cpoints[priv->grab_point].y = + unproject (height - y, priv->min_y, priv->max_y, height); + gtk3_curve_interpolate (widget, width, height); + break; + + case GTK3_CURVE_TYPE_FREE: + priv->curve_data.d_point[x].x = RADIUS + x; + priv->curve_data.d_point[x].y = RADIUS + y; + priv->grab_point = x; + priv->last = y; + break; + } + + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } + + DEBUG_INFO("button press [E]\n"); + + return FALSE; +} + +static gboolean +gtk3_curve_button_release (GtkWidget *widget, + GdkEventButton *event) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + GtkAllocation allocation; + GdkCursorType new_type = priv->cursor_type; + gint src, dst, cx, x, y, width, height, i; + gfloat rx, ry, min_x; + gint closest_point = 0; + guint distance; + gint tx, ty; + + DEBUG_INFO("button release [S]\n"); + + gtk_grab_remove (widget); + + gtk_widget_get_allocation (widget, &allocation); + + width = allocation.width - RADIUS * 2; + height = allocation.height - RADIUS * 2; + + if ((width < 0) || (height < 0)) + return FALSE; + + /* get the pointer position */ + gtk3_curve_get_cursor_coord (widget, &tx, &ty); + x = CLAMP ((tx - RADIUS), 0, width - 1); + y = CLAMP ((ty - RADIUS), 0, height - 1); + + DEBUG_INFO("release : xy[%dx%d] txy[%dx%d]\n", + x, y, + tx, ty); + + min_x = priv->min_x; + + distance = ~0U; + for (i = 0; i < priv->curve_data.n_cpoints; ++i) + { + cx = project (priv->curve_data.d_cpoints[i].x, + min_x, priv->max_x, width); + if ((guint) abs (x - cx) < distance) + { + distance = abs (x - cx); + closest_point = i; + } + } + + /* delete inactive points: */ + if (priv->curve_data.curve_type != GTK3_CURVE_TYPE_FREE) + { + for (src = dst = 0; src < priv->curve_data.n_cpoints; ++src) + { + if (priv->curve_data.d_cpoints[src].x >= min_x) + { + memcpy (priv->curve_data.d_cpoints + dst, + priv->curve_data.d_cpoints + src, + sizeof (*priv->curve_data.d_cpoints)); + ++dst; + } + } + + if (dst < src) + { + priv->curve_data.n_cpoints -= (src - dst); + + if (priv->curve_data.n_cpoints <= 0) + { + priv->curve_data.n_cpoints = 1; + priv->curve_data.d_cpoints[0].x = min_x; + priv->curve_data.d_cpoints[0].y = priv->min_y; + gtk3_curve_interpolate (widget, width, height); + + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } + } + + priv->curve_data.d_cpoints = + g_realloc (priv->curve_data.d_cpoints, + priv->curve_data.n_cpoints * + sizeof (*priv->curve_data.d_cpoints)); + } + } + + new_type = GDK_FLEUR; + priv->grab_point = -1; + + DEBUG_INFO("button release [E]\n"); + + return FALSE; +} + +static gboolean +gtk3_curve_motion_notify (GtkWidget *widget, + GdkEventMotion *event) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (widget)->priv; + GtkAllocation allocation; + GdkCursorType new_type = priv->cursor_type; + gint i, src, dst, leftbound, rightbound; + GdkEventMotion *mevent; + gint tx, ty, h,w; + gint cx, x, y, width, height; + gint closest_point = 0; + gfloat rx, ry, min_x; + guint distance; + gint x1, x2, y1, y2; + gint retval = FALSE; + + DEBUG_INFO("motion_notify [S]\n"); + mevent = (GdkEventMotion *) event; + + + gtk_widget_get_allocation (widget, &allocation); + + width = allocation.width - RADIUS * 2; + height = allocation.height - RADIUS * 2; + + if ((width < 0) || (height < 0)) + return FALSE; + + /* get the pointer position */ + gtk3_curve_get_cursor_coord (widget, &tx, &ty); + x = CLAMP ((tx - RADIUS), 0, width - 1); + y = CLAMP ((ty - RADIUS), 0, height - 1); + + DEBUG_INFO("motion : xy[%dx%d] txy[%dx%d]\n", + x, y, + tx, ty); + + min_x = priv->min_x; + + distance = ~0U; + for (i = 0; i < priv->curve_data.n_cpoints; ++i) + { + cx = project (priv->curve_data.d_cpoints[i].x, min_x, priv->max_x, width); + if ((guint) abs (x - cx) < distance) + { + distance = abs (x - cx); + closest_point = i; + } + } + + switch (priv->curve_data.curve_type) + { + default: + case GTK3_CURVE_TYPE_LINEAR: + case GTK3_CURVE_TYPE_SPLINE: + if (priv->grab_point == -1) + { + /* if no point is grabbed... */ + if (distance <= MIN_DISTANCE) + new_type = GDK_FLEUR; + else + new_type = GDK_TCROSS; + } + else + { + /* drag the grabbed point */ + new_type = GDK_TCROSS; + + leftbound = -MIN_DISTANCE; + if (priv->grab_point > 0) + leftbound = project (priv->curve_data.d_cpoints[priv->grab_point - 1].x, + min_x, priv->max_x, width); + + rightbound = width + RADIUS * 2 + MIN_DISTANCE; + if (priv->grab_point + 1 < priv->curve_data.n_cpoints) + rightbound = project (priv->curve_data.d_cpoints[priv->grab_point + 1].x, + min_x, priv->max_x, width); + + if (tx <= leftbound || tx >= rightbound + || ty > height + RADIUS * 2 + MIN_DISTANCE + || ty < -MIN_DISTANCE) + priv->curve_data.d_cpoints[priv->grab_point].x = min_x - 1.0; + else + { + rx = unproject (x, min_x, priv->max_x, width); + ry = unproject (height - y, priv->min_y, priv->max_y, height); + priv->curve_data.d_cpoints[priv->grab_point].x = rx; + priv->curve_data.d_cpoints[priv->grab_point].y = ry; + } + gtk3_curve_interpolate (widget, width, height); + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } + } + break; + + case GTK3_CURVE_TYPE_FREE: + if (priv->grab_point != -1) + { + if (priv->grab_point > x) + { + x1 = x; + x2 = priv->grab_point; + y1 = y; + y2 = priv->last; + } + else + { + x1 = priv->grab_point; + x2 = x; + y1 = priv->last; + y2 = y; + } + + if (x2 != x1) + for (i = x1; i <= x2; i++) + { + priv->curve_data.d_point[i].x = RADIUS + i; + priv->curve_data.d_point[i].y = RADIUS + + (y1 + ((y2 - y1) * (i - x1)) / (x2 - x1)); + } + else + { + priv->curve_data.d_point[x].x = RADIUS + x; + priv->curve_data.d_point[x].y = RADIUS + y; + } + priv->grab_point = x; + priv->last = y; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } + } + if (mevent->state & GDK_BUTTON1_MASK) + new_type = GDK_TCROSS; + else + new_type = GDK_PENCIL; + break; + } + + if (new_type != (GdkCursorType) priv->cursor_type) + { + GdkCursor *cursor; + priv->cursor_type = new_type; + cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), + priv->cursor_type); + gdk_window_set_cursor (gtk_widget_get_window (widget), cursor); + g_object_unref (cursor); + } + + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } + + DEBUG_INFO("motion_notify [E]\n"); +} + +static void +gtk3_curve_screen_changed (GtkWidget *widget, + GdkScreen *prev_screen) +{ + DEBUG_INFO("screen changed [S]\n"); + gtk3_curve_create_layouts (widget); + DEBUG_INFO("screen changed [E]\n"); +} + +static void +gtk3_curve_dispose (GObject *object) +{ + Gtk3CurvePrivate *priv = GTK3_CURVE (object)->priv; + G_OBJECT_CLASS (gtk3_curve_parent_class)->dispose (object); +} + +static void +gtk3_curve_finalize (GObject *object) +{ + Gtk3Curve *curve; + Gtk3CurvePrivate *priv; + + g_return_if_fail (GTK3_IS_CURVE (object)); + + curve = GTK3_CURVE (object); + priv = curve->priv; + + if (priv->curve_data.d_point) + g_free (priv->curve_data.d_point); + if (priv->curve_data.d_cpoints) + g_free (priv->curve_data.d_cpoints); + + G_OBJECT_CLASS (gtk3_curve_parent_class)->finalize (object); +} + +static void +gtk3_curve_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + Gtk3Curve *curve = GTK3_CURVE (object); + GtkWidget *widget = GTK_WIDGET(object); + Gtk3CurvePrivate *priv = curve->priv; + + switch (prop_id) + { + case PROP_CURVE_TYPE: + gtk3_curve_set_curve_type (widget, g_value_get_enum (value)); + break; + + case PROP_MIN_X: + gtk3_curve_set_range (widget, g_value_get_float (value), priv->max_x, + priv->min_y, priv->max_y); + break; + + case PROP_MAX_X: + gtk3_curve_set_range (widget, priv->min_x, g_value_get_float (value), + priv->min_y, priv->max_y); + break; + + case PROP_MIN_Y: + gtk3_curve_set_range (widget, priv->min_x, priv->max_x, + g_value_get_float (value), priv->max_y); + break; + + case PROP_MAX_Y: + gtk3_curve_set_range (widget, priv->min_x, priv->max_x, + priv->min_y, g_value_get_float (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gtk3_curve_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + Gtk3Curve *curve = GTK3_CURVE (object); + Gtk3CurvePrivate *priv = curve->priv; + + switch (prop_id) + { + case PROP_CURVE_TYPE: + g_value_set_enum (value, priv->curve_data.curve_type); + break; + + case PROP_MIN_X: + g_value_set_float (value, priv->min_x); + break; + + case PROP_MAX_X: + g_value_set_float (value, priv->max_x); + break; + + case PROP_MIN_Y: + g_value_set_float (value, priv->min_y); + break; + + case PROP_MAX_Y: + g_value_set_float (value, priv->max_y); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gtk3_curve_size_graph (Gtk3Curve *curve) +{ + Gtk3CurvePrivate *priv = curve->priv; + gint width, height; + gfloat aspect; + GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (curve)); + + width = (priv->max_x - priv->min_x); + height = (priv->max_y - priv->min_y); + aspect = width / (gfloat) height; + if (width > gdk_screen_get_width (screen) / 4) + { + width = gdk_screen_get_width (screen) / 4; + } + if (height > gdk_screen_get_height (screen) / 4) + { + height = gdk_screen_get_height (screen) / 4; + } + + if (aspect < 1.0) + { + width = height * aspect; + } + else + { + height = width / aspect; + } + + DEBUG_INFO("Set requested size to [%dx%d]\n", width, height); + + gtk_widget_set_size_request (GTK_WIDGET (curve), width, height); +} + +static void +gtk3_curve_create_layouts (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + DEBUG_INFO("create pango [S]\n"); + DEBUG_INFO("create pango [E]\n"); +} + +static void +gtk3_curve_reset_vector (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + gint width, height; + + g_free (priv->curve_data.d_cpoints); + + priv->curve_data.n_cpoints = 2; + priv->curve_data.d_cpoints = g_malloc (2 * sizeof (priv->curve_data.d_cpoints[0])); + priv->curve_data.d_cpoints[0].x = priv->min_x; + priv->curve_data.d_cpoints[0].y = priv->min_y; + priv->curve_data.d_cpoints[1].x = priv->max_x; + priv->curve_data.d_cpoints[1].y = priv->max_y; + + width = gtk_widget_get_allocated_width(widget) - RADIUS * 2; + height = gtk_widget_get_allocated_height(widget) - RADIUS * 2; + if (width < RADIUS * 2) return; + if (height < RADIUS * 2) return; + + if (priv->curve_data.curve_type == GTK3_CURVE_TYPE_FREE) + { + priv->curve_data.curve_type = GTK3_CURVE_TYPE_LINEAR; + gtk3_curve_interpolate (widget, width, height); + priv->curve_data.curve_type = GTK3_CURVE_TYPE_FREE; + } + else + gtk3_curve_interpolate (widget, width, height); + + DEBUG_INFO("reset vector\n"); + + if (gtk_widget_is_visible (GTK_WIDGET (curve))) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (GTK_WIDGET (curve)); + + } +} + +static void +gtk3_curve_interpolate (GtkWidget *widget, gint width, gint height) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + gfloat *vector; + int i; + + vector = g_malloc (width * sizeof (vector[0])); + + gtk3_curve_get_vector (widget, width, vector); + + priv->height = height; + if (priv->curve_data.n_points != width) + { + priv->curve_data.n_points = width; + g_free (priv->curve_data.d_point); + priv->curve_data.d_point = g_malloc (priv->curve_data.n_points * sizeof (priv->curve_data.d_point[0])); + } + + for (i = 0; i < width; ++i) + { + priv->curve_data.d_point[i].x = RADIUS + i; + priv->curve_data.d_point[i].y = RADIUS + height + - project (vector[i], priv->min_y, priv->max_y, height); + } + + g_free (vector); +} + +/* ===================== */ +/* =========================== YE OLDE MATH ========================== */ +/* ===================== */ + +/* Solve the tridiagonal equation system that determines the second + derivatives for the interpolation points. (Based on Numerical + Recipies 2nd Edition.) */ +static void +spline_solve (int n, gfloat x[], gfloat y[], gfloat y2[]) +{ + gfloat p, sig, *u; + gint i, k; + + u = g_malloc ((n - 1) * sizeof (u[0])); + + y2[0] = u[0] = 0.0; /* set lower boundary condition to "natural" */ + + for (i = 1; i < n - 1; ++i) + { + sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]); + p = sig * y2[i - 1] + 2.0; + y2[i] = (sig - 1.0) / p; + u[i] = ((y[i + 1] - y[i]) + / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1])); + u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p; + } + + y2[n - 1] = 0.0; + for (k = n - 2; k >= 0; --k) + y2[k] = y2[k] * y2[k + 1] + u[k]; + + g_free (u); +} + +static gfloat +spline_eval (int n, gfloat x[], gfloat y[], gfloat y2[], gfloat val) +{ + gint k_lo, k_hi, k; + gfloat h, b, a; + + /* do a binary search for the right interval: */ + k_lo = 0; + k_hi = n - 1; + while (k_hi - k_lo > 1) + { + k = (k_hi + k_lo) / 2; + if (x[k] > val) + k_hi = k; + else + k_lo = k; + } + + h = x[k_hi] - x[k_lo]; + g_assert (h > 0.0); + + a = (x[k_hi] - val) / h; + b = (val - x[k_lo]) / h; + return a*y[k_lo] + b*y[k_hi] + + ((a*a*a - a)*y2[k_lo] + (b*b*b - b)*y2[k_hi]) * (h*h)/6.0; +} + +static int +project (gfloat value, gfloat min, gfloat max, int norm) +{ + return (norm - 1) * ((value - min) / (max - min)) + 0.5; +} + +static gfloat +unproject (gint value, gfloat min, gfloat max, int norm) +{ + return value / (gfloat) (norm - 1) * (max - min) + min; +} + +/* ===================== */ +/* =========================== PUBLIC FUNCTIONS =========================== */ +/* ===================== */ + +void +gtk3_curve_set_gamma (GtkWidget *widget, gfloat gamma) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + gfloat x, one_over_gamma, height; + Gtk3CurveType old_type; + gint i; + + if (priv->curve_data.n_points < 2) + return; + + old_type = priv->curve_data.curve_type; + priv->curve_data.curve_type = GTK3_CURVE_TYPE_FREE; + + if (gamma <= 0) + one_over_gamma = 1.0; + else + one_over_gamma = 1.0 / gamma; + height = priv->height; + for (i = 0; i < priv->curve_data.n_points; ++i) + { + x = (gfloat) i / (priv->curve_data.n_points - 1); + priv->curve_data.d_point[i].x = RADIUS + i; + priv->curve_data.d_point[i].y = + RADIUS + (height * (1.0 - pow (x, one_over_gamma)) + 0.5); + } + + if (old_type != GTK3_CURVE_TYPE_FREE) + g_signal_emit (curve, curve_type_changed_signal, 0); + + priv->width = priv->curve_data.n_points; + + DEBUG_INFO("set gamma \n"); + if (gtk_widget_is_visible (GTK_WIDGET (curve))) + { + DEBUG_INFO("queue draw \n"); + gtk_widget_queue_draw (GTK_WIDGET (curve)); + } +} + +void +gtk3_curve_set_range (GtkWidget *widget, + gfloat min_x, + gfloat max_x, + gfloat min_y, + gfloat max_y) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + + DEBUG_INFO("set range [S]\n"); + + DEBUG_INFO("min_x[%0.1f] max_x[%0.1f]\n", min_x, max_x); + DEBUG_INFO("min_y[%0.1f] max_y[%0.1f]\n", min_y, max_y); + + g_object_freeze_notify (G_OBJECT (curve)); + + if (priv->min_x != min_x) + { + priv->min_x = min_x; + g_object_notify (G_OBJECT (curve), "min-x"); + } + + if (priv->max_x != max_x) + { + priv->max_x = max_x; + g_object_notify (G_OBJECT (curve), "max-x"); + } + + if (priv->min_y != min_y) + { + priv->min_y = min_y; + g_object_notify (G_OBJECT (curve), "min-y"); + } + + if (priv->max_y != max_y) + { + priv->max_y = max_y; + g_object_notify (G_OBJECT (curve), "max-y"); + } + + g_object_thaw_notify (G_OBJECT (curve)); + + gtk3_curve_size_graph (curve); + gtk3_curve_reset_vector (widget); + + DEBUG_INFO("set range [E]\n"); +} + +void +gtk3_curve_get_vector (GtkWidget *widget, int veclen, gfloat vector[]) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + gfloat rx, ry, dx, dy, min_x, delta_x, *mem, *xv, *yv, *y2v, prev; + gint dst, i, x, next, num_active_ctlpoints = 0, first_active = -1; + + min_x = priv->min_x; + + if (priv->curve_data.curve_type != GTK3_CURVE_TYPE_FREE) + { + /* count active points: */ + prev = min_x - 1.0; + for (i = num_active_ctlpoints = 0; i < priv->curve_data.n_cpoints; ++i) + if (priv->curve_data.d_cpoints[i].x > prev) + { + if (first_active < 0) + first_active = i; + prev = priv->curve_data.d_cpoints[i].x; + ++num_active_ctlpoints; + } + + /* handle degenerate case: */ + if (num_active_ctlpoints < 2) + { + if (num_active_ctlpoints > 0) + ry = priv->curve_data.d_cpoints[first_active].y; + else + ry = priv->min_y; + if (ry < priv->min_y) ry = priv->min_y; + if (ry > priv->max_y) ry = priv->max_y; + for (x = 0; x < veclen; ++x) + vector[x] = ry; + return; + } + } + + switch (priv->curve_data.curve_type) + { + default: + case GTK3_CURVE_TYPE_SPLINE: + mem = g_malloc (3 * num_active_ctlpoints * sizeof (gfloat)); + xv = mem; + yv = mem + num_active_ctlpoints; + y2v = mem + 2*num_active_ctlpoints; + + prev = min_x - 1.0; + for (i = dst = 0; i < priv->curve_data.n_cpoints; ++i) + if (priv->curve_data.d_cpoints[i].x > prev) + { + prev = priv->curve_data.d_cpoints[i].x; + xv[dst] = priv->curve_data.d_cpoints[i].x; + yv[dst] = priv->curve_data.d_cpoints[i].y; + ++dst; + } + + spline_solve (num_active_ctlpoints, xv, yv, y2v); + + rx = min_x; + dx = (priv->max_x - min_x) / (veclen - 1); + for (x = 0; x < veclen; ++x, rx += dx) + { + ry = spline_eval (num_active_ctlpoints, xv, yv, y2v, rx); + if (ry < priv->min_y) ry = priv->min_y; + if (ry > priv->max_y) ry = priv->max_y; + vector[x] = ry; + } + + g_free (mem); + break; + + case GTK3_CURVE_TYPE_LINEAR: + dx = (priv->max_x - min_x) / (veclen - 1); + rx = min_x; + ry = priv->min_y; + dy = 0.0; + i = first_active; + for (x = 0; x < veclen; ++x, rx += dx) + { + if (rx >= priv->curve_data.d_cpoints[i].x) + { + if (rx > priv->curve_data.d_cpoints[i].x) + ry = priv->min_y; + dy = 0.0; + next = i + 1; + while (next < priv->curve_data.n_cpoints + && priv->curve_data.d_cpoints[next].x <= priv->curve_data.d_cpoints[i].x) + ++next; + if (next < priv->curve_data.n_cpoints) + { + delta_x = priv->curve_data.d_cpoints[next].x - priv->curve_data.d_cpoints[i].x; + dy = ((priv->curve_data.d_cpoints[next].y - priv->curve_data.d_cpoints[i].y) + / delta_x); + dy *= dx; + ry = priv->curve_data.d_cpoints[i].y; + i = next; + } + } + vector[x] = ry; + ry += dy; + } + break; + + case GTK3_CURVE_TYPE_FREE: + if (priv->curve_data.d_point) + { + rx = 0.0; + dx = priv->curve_data.n_points / (double) veclen; + for (x = 0; x < veclen; ++x, rx += dx) + vector[x] = unproject (RADIUS + priv->height - priv->curve_data.d_point[(int) rx].y, + priv->min_y, priv->max_y, + priv->height); + } + else + memset (vector, 0, veclen * sizeof (vector[0])); + break; + } +} + +void +gtk3_curve_set_vector (GtkWidget *widget, int veclen, gfloat vector[]) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + Gtk3CurveType old_type; + gfloat rx, dx, ry; + gint i, height; + GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (curve)); + + old_type = priv->curve_data.curve_type; + priv->curve_data.curve_type = GTK3_CURVE_TYPE_FREE; + + if (priv->curve_data.d_point) + height = gtk_widget_get_allocated_height(GTK_WIDGET (curve)) - RADIUS * 2; + else + { + height = (priv->max_y - priv->min_y); + if (height > gdk_screen_get_height (screen) / 4) + height = gdk_screen_get_height (screen) / 4; + + priv->height = height; + priv->curve_data.n_points = veclen; + priv->curve_data.d_point = g_malloc (priv->curve_data.n_points * sizeof (priv->curve_data.d_point[0])); + } + rx = 0; + dx = (veclen - 1.0) / (priv->curve_data.n_points - 1.0); + + for (i = 0; i < priv->curve_data.n_points; ++i, rx += dx) + { + ry = vector[(int) (rx + 0.5)]; + if (ry > priv->max_y) ry = priv->max_y; + if (ry < priv->min_y) ry = priv->min_y; + priv->curve_data.d_point[i].x = RADIUS + i; + priv->curve_data.d_point[i].y = + RADIUS + height - project (ry, priv->min_y, priv->max_y, height); + } + if (old_type != GTK3_CURVE_TYPE_FREE) + { + g_signal_emit (curve, curve_type_changed_signal, 0); + g_object_notify (G_OBJECT (curve), "curve-type"); + } + + DEBUG_INFO("set vector \n"); + + priv->width = priv->curve_data.n_points; + + if (gtk_widget_is_visible (GTK_WIDGET (curve))) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (GTK_WIDGET (curve)); + } +} + +void +gtk3_curve_set_curve_type (GtkWidget *widget, Gtk3CurveType new_type) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + gfloat rx, dx; + gint x, i; + + if (new_type != priv->curve_data.curve_type) + { + gint width, height; + + width = gtk_widget_get_allocated_width(widget) - RADIUS * 2; + height = gtk_widget_get_allocated_height(widget) - RADIUS * 2; + + if (new_type == GTK3_CURVE_TYPE_FREE) + { + gtk3_curve_interpolate (widget, width, height); + priv->curve_data.curve_type = new_type; + } + else if (priv->curve_data.curve_type == GTK3_CURVE_TYPE_FREE) + { + g_free (priv->curve_data.d_cpoints); + priv->curve_data.n_cpoints = 9; + priv->curve_data.d_cpoints = g_malloc (priv->curve_data.n_cpoints * sizeof (*priv->curve_data.d_cpoints)); + + rx = 0.0; + dx = (width - 1) / (gfloat) (priv->curve_data.n_cpoints - 1); + + for (i = 0; i < priv->curve_data.n_cpoints; ++i, rx += dx) + { + x = (int) (rx + 0.5); + priv->curve_data.d_cpoints[i].x = + unproject (x, priv->min_x, priv->max_x, width); + priv->curve_data.d_cpoints[i].y = + unproject (RADIUS + height - priv->curve_data.d_point[x].y, + priv->min_y, priv->max_y, height); + } + + priv->curve_data.curve_type = new_type; + gtk3_curve_interpolate (widget, width, height); + } + else + { + priv->curve_data.curve_type = new_type; + gtk3_curve_interpolate (widget, width, height); + } + + g_signal_emit (curve, curve_type_changed_signal, 0); + g_object_notify (G_OBJECT (curve), "curve-type"); + + DEBUG_INFO("set curve type\n"); + + if (gtk_widget_is_visible (GTK_WIDGET (curve))) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (GTK_WIDGET (curve)); + } + } +} + +void gtk3_curve_set_color_background (GtkWidget *widget, Gtk3CurveColor color) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->background.red = color.red; + priv->background.green = color.green; + priv->background.blue = color.blue; + priv->background.alpha = color.alpha; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +void gtk3_curve_set_color_background_rgba (GtkWidget *widget, gfloat r, + gfloat g, gfloat b, gfloat a) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->background.red = r; + priv->background.green = g; + priv->background.blue = b; + priv->background.alpha = a; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +Gtk3CurveColor gtk3_curve_get_color_background (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->background; +} + +void gtk3_curve_set_color_grid (GtkWidget *widget, Gtk3CurveColor color) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->grid.red = color.red; + priv->grid.green = color.green; + priv->grid.blue = color.blue; + priv->grid.alpha = color.alpha; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +void gtk3_curve_set_color_grid_rgba (GtkWidget *widget, gfloat r, + gfloat g, gfloat b, gfloat a) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->grid.red = r; + priv->grid.green = g; + priv->grid.blue = b; + priv->grid.alpha = a; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +Gtk3CurveColor gtk3_curve_get_color_grid (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->grid; +} + +void gtk3_curve_set_color_curve (GtkWidget *widget, Gtk3CurveColor color) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->curve.red = color.red; + priv->curve.green = color.green; + priv->curve.blue = color.blue; + priv->curve.alpha = color.alpha; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +void gtk3_curve_set_color_curve_rgba (GtkWidget *widget, gfloat r, + gfloat g, gfloat b, gfloat a) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->curve.red = r; + priv->curve.green = g; + priv->curve.blue = b; + priv->curve.alpha = a; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +Gtk3CurveColor gtk3_curve_get_color_curve (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->curve; +} + +void gtk3_curve_set_color_cpoint (GtkWidget *widget, Gtk3CurveColor color) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->cpoint.red = color.red; + priv->cpoint.green = color.green; + priv->cpoint.blue = color.blue; + priv->cpoint.alpha = color.alpha; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +void gtk3_curve_set_color_cpoint_rgba (GtkWidget *widget, gfloat r, + gfloat g, gfloat b, gfloat a) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->cpoint.red = r; + priv->cpoint.green = g; + priv->cpoint.blue = b; + priv->cpoint.alpha = a; + if (gtk_widget_is_visible (widget)) + { + DEBUG_INFO("queue draw\n"); + gtk_widget_queue_draw (widget); + } +} + +Gtk3CurveColor gtk3_curve_get_color_cpoint (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->cpoint; +} + +void gtk3_curve_set_use_theme_background(GtkWidget *widget, gboolean use) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->use_bg_theme = use; +} + +gboolean gtk3_curve_get_use_theme_background(GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->use_bg_theme; +} + +void gtk3_curve_set_grid_size(GtkWidget *widget, Gtk3CurveGridSize size) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + priv->grid_size = size; +} + +Gtk3CurveGridSize gtk3_curve_get_grid_size(GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + return priv->grid_size; +} + +void +gtk3_curve_reset (GtkWidget *widget) +{ + Gtk3Curve *curve = GTK3_CURVE (widget); + Gtk3CurvePrivate *priv = curve->priv; + Gtk3CurveType old_type; + + old_type = priv->curve_data.curve_type; + priv->curve_data.curve_type = GTK3_CURVE_TYPE_SPLINE; + gtk3_curve_reset_vector (widget); + + if (old_type != GTK3_CURVE_TYPE_SPLINE) + { + g_signal_emit (curve, curve_type_changed_signal, 0); + g_object_notify (G_OBJECT (curve), "curve-type"); + } +} + +void +gtk3_curve_save(Gtk3CurveData *data, gchar *filename) { + // TODO - add code here +} + + +Gtk3CurveData +gtk3_curve_load(gchar *filename) { + // TODO - add code here +} diff --git a/veejay-current/reloaded-gtk3/src/gtk3curve.h b/veejay-current/reloaded-gtk3/src/gtk3curve.h new file mode 100644 index 00000000..6e70461d --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/gtk3curve.h @@ -0,0 +1,174 @@ +/* Copyright (C) 2016 Benoit Touchette + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation version + * 2.1 of the License. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#ifndef __GTK3_CURVE__H__ +#define __GTK3_CURVE__H__ + +#include + +#define GTK3_TYPE_CURVE (gtk3_curve_get_type ()) +#define GTK3_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK3_TYPE_CURVE, Gtk3Curve)) +#define GTK3_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK3_TYPE_CURVE)) +#define GTK3_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK3_TYPE_CURVE, Gtk3CurveClass)) +#define GTK3_IS_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK3_TYPE_CURVE)) +#define GTK3_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK3_TYPE_CURVE, Gtk3CurveClass)) + +#define GTK3_TYPE_CURVE_TYPE (gtk3_curve_type_get_type ()) + +typedef enum +{ + GTK3_CURVE_GRID_MICRO, + GTK3_CURVE_GRID_SMALL, + GTK3_CURVE_GRID_MEDIUM, + GTK3_CURVE_GRID_LARGE, + GTK3_CURVE_GRID_XLARGE +} Gtk3CurveGridSize; + + +typedef enum +{ + GTK3_CURVE_TYPE_LINEAR, /* linear interpolation */ + GTK3_CURVE_TYPE_SPLINE, /* spline interpolation */ + GTK3_CURVE_TYPE_FREE /* free form curve */ +} Gtk3CurveType; + +typedef struct _Gtk3Curve Gtk3Curve; +typedef struct _Gtk3CurveClass Gtk3CurveClass; +typedef struct _Gtk3CurvePrivate Gtk3CurvePrivate; +typedef struct _Gtk3CurveColor Gtk3CurveColor; +typedef struct _Gtk3CurveData Gtk3CurveData; +typedef struct _Gtk3CurveVector Gtk3CurveVector; +typedef struct _Gtk3CurvePoint Gtk3CurvePoint; + +struct _Gtk3CurvePoint +{ + gint x; + gint y; +}; + +struct _Gtk3CurveColor +{ + gfloat red; + gfloat green; + gfloat blue; + gfloat alpha; +}; + +struct _Gtk3CurveVector +{ + gfloat x; + gfloat y; +}; + +struct _Gtk3CurveData +{ + gchar *description; + + Gtk3CurveType curve_type; + + gint n_points; + Gtk3CurvePoint *d_point; + + gint n_cpoints; + Gtk3CurveVector *d_cpoints; +}; + +struct _Gtk3Curve +{ + GtkWidget widget; + Gtk3CurvePrivate *priv; +}; + +struct _Gtk3CurveClass +{ + GtkWidgetClass parent_class; + + void (* curve_type_changed) (Gtk3Curve *curve); + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +}; + +GType gtk3_curve_type_get_type (void); +GType gtk3_curve_get_type (void) G_GNUC_CONST; +GtkWidget* gtk3_curve_new (void); + +void gtk3_curve_reset (GtkWidget *widget); +void gtk3_curve_set_gamma (GtkWidget *widget, + gfloat gamma_); +void gtk3_curve_set_range (GtkWidget *widget, + gfloat min_x, + gfloat max_x, + gfloat min_y, + gfloat max_y); +void gtk3_curve_get_vector (GtkWidget *widget, + gint veclen, + gfloat vector[]); +void gtk3_curve_set_vector (GtkWidget *widget, + gint veclen, + gfloat vector[]); +void gtk3_curve_set_curve_type (GtkWidget *widget, + Gtk3CurveType type); + +void gtk3_curve_set_color_background (GtkWidget *widget, + Gtk3CurveColor color); +void gtk3_curve_set_color_grid (GtkWidget *widget, + Gtk3CurveColor color); +void gtk3_curve_set_color_curve (GtkWidget *widget, + Gtk3CurveColor color); +void gtk3_curve_set_color_cpoint (GtkWidget *widget, + Gtk3CurveColor color); + +void gtk3_curve_set_color_background_rgba (GtkWidget *widget, + gfloat r, + gfloat g, + gfloat b, + gfloat a); +void gtk3_curve_set_color_grid_rgba (GtkWidget *widget, + gfloat r, + gfloat g, + gfloat b, + gfloat a); +void gtk3_curve_set_color_curve_rgba (GtkWidget *widget, + gfloat r, + gfloat g, + gfloat b, + gfloat a); +void gtk3_curve_set_color_cpoint_rgba (GtkWidget *widget, + gfloat r, + gfloat g, + gfloat b, + gfloat a); + +Gtk3CurveColor gtk3_curve_get_color_background (GtkWidget *widget); +Gtk3CurveColor gtk3_curve_get_color_grid (GtkWidget *widget); +Gtk3CurveColor gtk3_curve_get_color_curve (GtkWidget *widget); +Gtk3CurveColor gtk3_curve_get_color_cpoint (GtkWidget *widget); + +void gtk3_curve_set_use_theme_background (GtkWidget *widget, + gboolean use); +gboolean gtk3_curve_get_use_theme_background (GtkWidget *widget); +void gtk3_curve_set_grid_size (GtkWidget *widget, + Gtk3CurveGridSize size); +Gtk3CurveGridSize gtk3_curve_get_grid_size (GtkWidget *widget); +void gtk3_curve_save (Gtk3CurveData *data, + gchar *filename); +Gtk3CurveData gtk3_curve_load (gchar *filename); + +#endif /* __GTK3_CURVE__H__ */ diff --git a/veejay-current/reloaded-gtk3/src/gtktimeselection.c b/veejay-current/reloaded-gtk3/src/gtktimeselection.c new file mode 100644 index 00000000..3cdee8c5 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/gtktimeselection.c @@ -0,0 +1,881 @@ +/* veejay - Linux VeeJay + * (C) 2002-2015 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + Implements a new slider type widget with selection markers + + */ + + /* + * Modified by d.j.a.y , 2018 + * - gtk3 compliant + */ + +#include +#include +#include + +#include "gtktimeselection.h" + +//G_DEFINE_TYPE(TimelineSelectionClass, timeline, GTK_TYPE_DRAWING_AREA ); + +enum +{ + POS_CHANGED, + IN_CHANGED, + OUT_CHANGED, + BIND_CHANGED, + CLEAR_CHANGED, + SELECTION_CHANGED_SIGNAL, + LAST_SIGNAL +}; + +enum +{ + MIN = 1, + MAX = 2, + POS = 3, + LENGTH = 4, + IN_POINT = 5, + OUT_POINT = 6, + SEL = 7, + BIND = 8, + CLEARED = 9, +}; + +typedef enum { + MOUSE_OUTSIDE, + MOUSE_STEPPER, + MOUSE_SELECTION, + MOUSE_WIDGET /* inside widget but not in any of the above */ +} mouse_location; + + +/* Slider with 2 bars + + + +*/ + +typedef enum TimelineAction +{ + action_none = 0, + action_in_point, + action_out_point, + action_pos, + action_atomic, +} TimelineAction; + +#define POINT_IN_RECT(xcoord, ycoord, rect) \ + ((xcoord) >= (rect).x && \ + (xcoord) < ((rect).x + (rect).width) && \ + (ycoord) >= (rect).y && \ + (ycoord) < ((rect).y + (rect).height)) + +struct _TimelineSelection +{ + GtkDrawingArea cr; + GtkWidget *widget; + gdouble min; + gdouble max; + gdouble value; + gdouble frame_num; + gdouble num_video_frames; + gdouble in; + gdouble out; + gboolean bind; + gint grab_button; + TimelineAction action; + mouse_location grab_location; + mouse_location current_location; + GdkRectangle stepper; + GdkRectangle selection; + gboolean has_stepper; + gboolean clear; + gdouble stepper_size; /* size of triangle */ + gdouble stepper_draw_size; + gdouble stepper_length; /* length from top to bottom */ + gint step_size; /* step frames 1,2,4,8,16, ... */ + gdouble frame_width; + gdouble frame_height; + gdouble font_line; + gboolean has_selection; /* use in/out points for selection */ + gdouble move_x; +}; + +static void get_property( GObject *object, + guint id, + GValue *value , + GParamSpec *pspec ); + +static void set_property ( GObject *object, + guint id, + const GValue * value, + GParamSpec *pspec ); + +static gboolean event_press (GtkWidget *widget, GdkEventButton *bev, gpointer user_data); + +static gboolean event_release (GtkWidget *widget, GdkEventButton *bev, gpointer user_data); + +static gboolean event_motion (GtkWidget *widget, GdkEventMotion *mev, gpointer user_data); + +static gboolean event_scroll (GtkWidget *widget, GdkEventScroll *mev, gpointer user_data); + +static void timeline_class_init( TimelineSelectionClass *class ); + +static void timeline_init(TimelineSelection *te ); + +static gboolean timeline_draw(GtkWidget *widget, cairo_t *cr ); + +static GObjectClass *parent_class = NULL; +static gint timeline_signals[LAST_SIGNAL] = { 0 }; + +struct _TimelineSelectionClass +{ + GtkWidgetClass parent_class; + void (*pos_changed) (TimelineSelection *te); + void (*in_point_changed) (TimelineSelection *te); + void (*out_point_changed) (TimelineSelection *te); + void (*bind_toggled) (TimelineSelection *te); + void (*cleared) (TimelineSelection *te); +}; +static void set_property (GObject *object, + guint id, const GValue *value, GParamSpec *pspec) +{ + TimelineSelection *te = TIMELINE_SELECTION(object); + switch(id) + { + case MIN: + if(te->min != g_value_get_double(value)) + { + te->min = g_value_get_double(value); + } + break; + case MAX: + if(te->max != g_value_get_double(value)) + { + te->min = g_value_get_double(value); + } + break; + case POS: + if(te->frame_num != g_value_get_double(value)) + { + te->frame_num = g_value_get_double(value); + } + break; + case LENGTH: + if(te->num_video_frames != g_value_get_double(value)) + { + te->num_video_frames = g_value_get_double(value); + } + break; + case IN_POINT: + if(te->in != g_value_get_double(value)) + { + if( g_value_get_double(value) < te->out ) + te->in = g_value_get_double(value); + } + break; + case OUT_POINT: + if(te->out != g_value_get_double(value)) + { + if( g_value_get_double(value) > te->in ) + te->out = g_value_get_double(value); + } + break; + case SEL: + if(te->has_selection != g_value_get_boolean(value)) + { + te->has_selection = g_value_get_boolean(value); + } + break; + case BIND: + if(te->bind != g_value_get_boolean(value)) + { + te->bind = g_value_get_boolean(value); + } + break; + case CLEARED: + if(te->clear != g_value_get_boolean(value)) + { + te->clear = g_value_get_boolean(value); + } + break; + default: + g_assert(FALSE); + break; + } + gtk_widget_queue_draw( GTK_WIDGET( te )); + +} + +static void get_property( GObject *object, + guint id, GValue *value , GParamSpec *pspec ) +{ + TimelineSelection *te = TIMELINE_SELECTION(object); + switch( id ) + { + case MIN: g_value_set_double( value, te->min );break; + case MAX: g_value_set_double( value, te->max );break; + case POS: g_value_set_double( value, te->frame_num ); break; + case LENGTH: g_value_set_double( value, te->num_video_frames ); break; + case IN_POINT: g_value_set_double( value, te->in ); break; + case OUT_POINT: g_value_set_double( value, te->out ); break; + case SEL: g_value_set_boolean(value, te->has_selection) ; break; + case BIND: g_value_set_boolean(value, te->bind ); break; + case CLEARED: g_value_set_boolean(value,te->clear );break; + } +} + +static void finalize (GObject *object) +{ + parent_class->finalize( object ); +} + +static void timeline_class_init( TimelineSelectionClass *class ) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(class); + widget_class->draw = timeline_draw; + + GObjectClass *gobject_class; + gobject_class = G_OBJECT_CLASS( class ); + parent_class = g_type_class_peek( GTK_TYPE_DRAWING_AREA ); + gobject_class->finalize = finalize; + gobject_class->get_property = get_property; + gobject_class->set_property = set_property; + + g_object_class_install_property(gobject_class, + MIN, + g_param_spec_double( "min", + "left", + "left", + 0.0, + 1.0, + 0.0, + G_PARAM_READWRITE ) + ); + + g_object_class_install_property(gobject_class, + MAX, + g_param_spec_double( "max", + "right", + "right", + 0.0, + 1.0, + 1.0, + G_PARAM_READWRITE ) + ); + + g_object_class_install_property( gobject_class, + POS, + g_param_spec_double( "pos", + "current position", "current position", 0.0,9999999.0, 0.0, + G_PARAM_READWRITE )); + + g_object_class_install_property( gobject_class, + LENGTH, + g_param_spec_double( "length", + "Length (in frames)", "Length (in frames) ",0.0,9999999.0, 1.0, + G_PARAM_READWRITE )); + + + g_object_class_install_property( gobject_class, + IN_POINT, + g_param_spec_double( "in", + "In point", "(in frames) ",0.0,1.0, 0.0, + G_PARAM_READWRITE )); + + + g_object_class_install_property( gobject_class, + OUT_POINT, + g_param_spec_double( "out", + "Out point", "(in frames) ",0.0,1.0, 1.0, + G_PARAM_READWRITE )); + + g_object_class_install_property( gobject_class, + SEL, + g_param_spec_boolean( "selection", + "Marker", "(in frames) ",FALSE, + G_PARAM_READWRITE )); + + g_object_class_install_property( gobject_class, + BIND, + g_param_spec_boolean( "bind", "Bind marker", "Bind In/Out points", FALSE, G_PARAM_READWRITE)); + + g_object_class_install_property( gobject_class, + CLEARED, + g_param_spec_boolean( "clear", "Clear marker", "Clear in/out points", FALSE, G_PARAM_READWRITE )); + + timeline_signals[ SELECTION_CHANGED_SIGNAL ] = g_signal_new( "selection_changed", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_FIRST,0,NULL,NULL, + g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0 , NULL ); + + timeline_signals[ POS_CHANGED ] = g_signal_new( "pos_changed", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET( TimelineSelectionClass, pos_changed ), + NULL,NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL); + + timeline_signals[ IN_CHANGED ] = g_signal_new( "in_point_changed", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET( TimelineSelectionClass, in_point_changed ), + NULL,NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL); + + timeline_signals[ OUT_CHANGED ] = g_signal_new( "out_point_changed", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET( TimelineSelectionClass, out_point_changed ), + NULL,NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL); + + timeline_signals[ CLEAR_CHANGED ] = g_signal_new( "cleared", G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET( TimelineSelectionClass, cleared ), + NULL,NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL ); + + timeline_signals[ BIND_CHANGED ] = g_signal_new( "bind_toggled", + G_TYPE_FROM_CLASS(gobject_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET( TimelineSelectionClass, bind_toggled ), + NULL,NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL ); + +} + +static void timeline_init( TimelineSelection *te ) +{ + te->min = 0.0; + te->max = 0.0; + te->action = action_none; + te->in = 0.0; + te->out = 1.0; + te->num_video_frames = 1.0; + te->frame_num = 0.0; + te->grab_location = MOUSE_OUTSIDE; + te->current_location = MOUSE_OUTSIDE; + te->grab_button = 0; + te->has_stepper = TRUE; + te->has_selection = FALSE; + te->stepper_size = 24; + te->stepper_draw_size = 16; + te->stepper_length = 0; + te->frame_height = 10; + te->font_line = 18; + te->move_x = 0; +} + +GType timeline_get_type(void) +{ + static GType gtype = 0; + if(!gtype) + { + static const GTypeInfo ginfo = {sizeof( TimelineSelectionClass), + NULL, + NULL, + (GClassInitFunc) timeline_class_init, + NULL, + NULL, + sizeof(TimelineSelection), + 0, + (GInstanceInitFunc) timeline_init, + NULL + }; + gtype = g_type_register_static( GTK_TYPE_DRAWING_AREA, "Timeline", &ginfo, 0 ); + } + return gtype; +} + +gdouble timeline_get_in_point( TimelineSelection *te ) +{ + gdouble result = 0.0; + g_object_get( G_OBJECT(te), "in", &result, NULL ); + return result; +} + +gdouble timeline_get_out_point( TimelineSelection *te ) +{ + gdouble result = 0.0; + g_object_get( G_OBJECT(te), "out", &result, NULL ); + return result; +} + +gboolean timeline_get_selection( TimelineSelection *te ) +{ + gboolean result = FALSE; + g_object_get( G_OBJECT(te), "selection", &result, NULL ); + return result; +} + +gboolean timeline_get_bind( TimelineSelection *te ) +{ + gboolean result = FALSE; + g_object_get( G_OBJECT(te), "bind", &result, NULL ); + return result; +} + +void timeline_set_bind(GtkWidget *widget, gboolean active) +{ + TimelineSelection *te = TIMELINE_SELECTION(widget); + g_object_set( G_OBJECT(te), "bind", active, NULL ); + g_signal_emit( te->widget, timeline_signals[BIND_CHANGED], 0); +} + +void timeline_set_out_point( GtkWidget *widget, gdouble pos ) +{ + TimelineSelection *te = TIMELINE_SELECTION(widget); + if( pos < 0.0 ) pos = 0.0; else if (pos > 1.0 ) pos = 1.0; + g_object_set( G_OBJECT(te), "out", pos, NULL ); + g_signal_emit(te->widget, timeline_signals[OUT_CHANGED], 0); + gtk_widget_queue_draw( GTK_WIDGET(te->widget) ); +} + +void timeline_clear_points( GtkWidget *widget ) +{ + gboolean cleared = TRUE; + gdouble pos = 0.0; + gdouble pos2 = 1.0; + TimelineSelection *te = TIMELINE_SELECTION(widget); + g_object_set( G_OBJECT(te), "clear", cleared, NULL ); + g_object_set( G_OBJECT(te), "in", pos, NULL ); + g_object_set( G_OBJECT(te), "out", pos2, NULL ); + g_signal_emit(te->widget, timeline_signals[CLEAR_CHANGED], 0 ); + gtk_widget_queue_draw(GTK_WIDGET(te->widget) ); +} + +void timeline_set_in_point( GtkWidget *widget, gdouble pos ) +{ + TimelineSelection *te = TIMELINE_SELECTION(widget); + if( pos < 0.0 ) pos = 0.0; else if (pos > 1.0 ) pos = 1.0; + g_object_set( G_OBJECT(te), "in", pos, NULL ); + g_signal_emit(te->widget, timeline_signals[IN_CHANGED], 0); + gtk_widget_queue_draw( GTK_WIDGET(te->widget) ); +} + +void timeline_set_selection( GtkWidget *widget, gboolean active) +{ + TimelineSelection *te = TIMELINE_SELECTION(widget); + g_object_set( G_OBJECT(te), "selection", active, NULL ); + gtk_widget_queue_draw( GTK_WIDGET(te->widget) ); +} + +void timeline_set_length( GtkWidget *widget, gdouble length, gdouble pos) +{ + TimelineSelection *te = TIMELINE_SELECTION( widget ); + if( pos < 0.0 ) pos = 0.0; + g_object_set( G_OBJECT(te), "length", length, NULL ); + timeline_set_pos( GTK_WIDGET(te->widget), pos ); +} + +void timeline_set_pos( GtkWidget *widget,gdouble pos) +{ + TimelineSelection *te = TIMELINE_SELECTION( widget ); + if( pos < 0.0 ) pos = 0.0; + g_object_set( G_OBJECT(te), "pos", pos, NULL ); + g_signal_emit( te->widget, timeline_signals[POS_CHANGED], 0); + gtk_widget_queue_draw( GTK_WIDGET(te->widget) ); +} + +gdouble timeline_get_pos( TimelineSelection *te ) +{ + gdouble result = 0.0; + g_object_get( G_OBJECT(te), "pos", &result, NULL ); + return result; +} + +gdouble timeline_get_length( TimelineSelection *te ) +{ + gdouble result = 0.0; + g_object_get( G_OBJECT(te), "length", &result, NULL ); + return result; +} + +static void move_selection( GtkWidget *widget, gdouble x, gdouble width ) +{ + TimelineSelection *te = TIMELINE_SELECTION( widget ); + + gdouble dx3 = (0.5 * (te->out - te->in)) * width; + + gdouble dx1 = x - dx3; + gdouble dx2 = x + dx3; + + te->in = (1.0/width) * dx1; + te->out = (1.0/width ) * dx2; + + timeline_set_out_point(widget, te->out ); + timeline_set_in_point(widget, te->in ); + te->move_x = x; +} + +static gboolean +event_scroll (GtkWidget *widget, GdkEventScroll *ev, gpointer user_data) +{ + TimelineSelection *te = TIMELINE_SELECTION (widget); + + GdkScrollDirection direction; + gboolean scroll_status = gdk_event_get_scroll_direction((GdkEvent*)ev, &direction); + if(scroll_status) + { + if( direction == GDK_SCROLL_UP ) { + gdouble cur_pos = timeline_get_pos(te); + timeline_set_pos( widget, cur_pos + 1 ); + } + else if( direction == GDK_SCROLL_DOWN ) { + gdouble cur_pos = timeline_get_pos(te); + timeline_set_pos( widget, cur_pos - 1 ); + } + } + gtk_widget_queue_draw( widget ); + + return FALSE; +} + +static gboolean event_press(GtkWidget *widget, GdkEventButton *ev, gpointer user_data) +{ + TimelineSelection *te = TIMELINE_SELECTION( widget ); + GtkAllocation all; + gtk_widget_get_allocation(widget, &all); + gdouble width = all.width; + + te->grab_button = ev->button; + te->current_location = MOUSE_WIDGET; + + if( ev->type == GDK_2BUTTON_PRESS && te->grab_button == 1 ) + { + timeline_clear_points( widget ); + return FALSE; + } + + if(te->grab_button == 1 && POINT_IN_RECT( ev->x, ev->y, te->stepper ) ) + { + if(te->has_stepper) + { + te->current_location = MOUSE_STEPPER; + te->action = action_pos; + } + return FALSE; + } + + if(te->grab_button == 1 && te->has_selection) + { + if( POINT_IN_RECT( ev->x, ev->y, te->selection ) && te->bind ) + { + te->current_location = MOUSE_SELECTION; + } + if(!te->bind) + { + gdouble val = (1.0 / width) * ev->x; + timeline_set_in_point( widget, val ); + } + } + else if(te->grab_button == 3 && te->has_selection ) + { + if( POINT_IN_RECT( ev->x, ev->y, te->selection ) && te->bind ) + { + te->current_location = MOUSE_SELECTION; + } + if(!te->bind) + { + gdouble val = (1.0/width) * ev->x; + timeline_set_out_point( widget, val ); + } + } + else if(te->grab_button == 2 && te->has_selection) + { + gint dx = ev->x; + gint dy = ev->y; + if( POINT_IN_RECT( dx, dy, te->selection ) ) + { + timeline_set_bind( widget, (te->bind ? FALSE: TRUE )); + te->move_x = (gdouble) ev->x; + } + } + + + gtk_widget_queue_draw( widget ); + + return FALSE; +} + +static gboolean event_release (GtkWidget *widget, GdkEventButton *ev, gpointer user_data) +{ + TimelineSelection *te = TIMELINE_SELECTION (widget); + te->action = action_none; + te->current_location = MOUSE_WIDGET; +// te->grab_button = 0; +// te->move_x = 0; + return FALSE; +} + +static gboolean event_motion (GtkWidget *widget, GdkEventMotion *ev, gpointer user_data) +{ + TimelineSelection *te = TIMELINE_SELECTION (widget); + GtkAllocation all; + gtk_widget_get_allocation(widget, &all); + gdouble width = (gdouble) all.width; + gint x,y; + GdkModifierType state; + gdk_window_get_device_position ( ev->window, ev->device, &x, &y, &state ); + + if( te->has_stepper && te->current_location == MOUSE_STEPPER && ev->state & GDK_BUTTON1_MASK) + { + gdouble rel_pos = ((gdouble)ev->x / width) * te->num_video_frames; + gdouble new_pos = (gdouble) ((gint) rel_pos ); + + timeline_set_pos( widget, new_pos ); + return FALSE; + } + + if( te->has_selection && te->current_location != MOUSE_STEPPER) + { + if(!te->bind) + { + gdouble gx = (1.0 / width) * x; + if(te->grab_button == 1 && ev->state & GDK_BUTTON1_MASK) + timeline_set_in_point(widget, gx ); + else if(te->grab_button == 3 && ev->state & GDK_BUTTON3_MASK) + timeline_set_out_point( widget, gx ); + } + } + + if(te->has_selection && te->bind && te->grab_button == 2 ) + move_selection( widget, x, width ); + + gtk_widget_queue_draw( widget ); + + return FALSE; +} + +/*! + * draw a rounded rectangle + */ +void cairo_rectangle_round ( cairo_t * cr, + double x0, + double y0, + double width, + double height, + double radius) +{ + double x1, y1; + + x1 = x0 + width; + y1 = y0 + height; + if (width <= 0.001 || height <= 0.001) + return; + if (width / 2 < radius) + { + if (height / 2 < radius) + { + cairo_move_to (cr, x0, (y0 + y1) / 2); + cairo_curve_to (cr, x0, y0, x0, y0, (x0 + x1) / 2, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); + } + else + { + cairo_move_to (cr, x0, y0 + radius); + cairo_curve_to (cr, x0, y0, x0, y0, (x0 + x1) / 2, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); + cairo_line_to (cr, x1, y1 - radius); + cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0) / 2, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius); + } + } + else +{ + if (height / 2 < radius) + { + cairo_move_to (cr, x0, (y0 + y1) / 2); + cairo_curve_to (cr, x0, y0, x0, y0, x0 + radius, y0); + cairo_line_to (cr, x1 - radius, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1) / 2); + cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); + cairo_line_to (cr, x0 + radius, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1) / 2); + } + else + { + cairo_move_to (cr, x0, y0 + radius); + cairo_curve_to (cr, x0, y0, x0, y0, x0 + radius, y0); + cairo_line_to (cr, x1 - radius, y0); + cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + radius); + cairo_line_to (cr, x1, y1 - radius); + cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1); + cairo_line_to (cr, x0 + radius, y1); + cairo_curve_to (cr, x0, y1, x0, y1, x0, y1 - radius); + } + } + cairo_close_path (cr); +} + +static gboolean timeline_draw (GtkWidget *widget, cairo_t *cr ) +{ + TimelineSelection *te = TIMELINE_SELECTION( widget ); + double width = gtk_widget_get_allocated_width (widget); + double height = gtk_widget_get_allocated_height (widget); + + gdouble marker_width = width/ te->num_video_frames; +// gdouble marker_height = height / te->num_video_frames; + gdouble marker_height = te->frame_height; + + te->frame_width = marker_width; + + GtkStyleContext *sc = gtk_widget_get_style_context(widget); + GdkRGBA color; + gtk_style_context_get_color ( sc, gtk_style_context_get_state (sc), &color ); + +/* Draw stepper */ + if( te->has_stepper ) + { + cairo_set_source_rgba( cr, 1.0,0.0,0.0,1.0); //FIXME use context state color ? + double x1 = marker_width * te->frame_num; + te->stepper.x = x1 - 8; + te->stepper.y = 0; + te->stepper.width = te->stepper_size + 8; + te->stepper.height = te->stepper_size + 2; + + cairo_move_to( cr, x1 - te->stepper_draw_size, 0.0 * height ); + cairo_rel_line_to( cr, te->stepper_draw_size, te->stepper_draw_size ); + cairo_rel_line_to( cr, te->stepper_draw_size, -te->stepper_draw_size ); + cairo_rel_line_to( cr, -2.0 * te->stepper_draw_size, 0 ); + cairo_set_line_join( cr, CAIRO_LINE_JOIN_MITER); + cairo_move_to(cr, x1, te->stepper_draw_size ); + cairo_rel_line_to( cr, 0.0, te->stepper_length ); + cairo_stroke(cr); + if( te->grab_button == 1 && te->current_location == MOUSE_STEPPER ) + { + cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_BOLD ); + + cairo_move_to(cr, x1 + (te->stepper_size * 0.5),te->font_line ); + gchar text[40]; + sprintf(text, "%d", (gint)te->frame_num ); + cairo_text_path( cr, text ); + cairo_set_font_size( cr, 0.2 ); + cairo_set_source_rgba( cr, color.red,color.green,color.blue,0.7 ); + + cairo_fill(cr); + } + } +/* Draw selection */ + if( te->has_selection ) + { + gdouble in = te->in * width; + gdouble out = te->out * width; + + /* If user is editing in_point */ + if( te->grab_button == 1 && te->current_location != MOUSE_STEPPER ) + { + gdouble f = te->in * te->num_video_frames; + + cairo_set_source_rgba( cr, 0.0, color.green, color.blue,0.3 ); + cairo_move_to( cr, in, 0.0 ); + cairo_rel_line_to( cr, 0.0 , te->stepper_length ); + cairo_stroke(cr); + + cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_BOLD ); + + cairo_move_to(cr, in , te->font_line ); + gchar text[40]; + sprintf(text, "%d",(gint) f ); + cairo_text_path( cr, text ); + cairo_set_font_size( cr, 0.2 ); + cairo_set_source_rgba( cr, color.red,color.green,color.blue,0.7 ); + cairo_fill(cr); + + } + if( te->grab_button == 3 && te->current_location != MOUSE_STEPPER ) + { + gdouble f = te->out * te->num_video_frames; + cairo_set_source_rgba( cr, 0.0,color.green,color.blue,0.3 ); + cairo_move_to( cr, out , 0.0 ); + cairo_rel_line_to( cr, 0.0 , te->stepper_length ); + cairo_stroke(cr); + + cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL, + CAIRO_FONT_WEIGHT_BOLD ); + + cairo_move_to(cr, out ,te->font_line ); + gchar text[40]; + sprintf(text, "%d", (gint) f ); + cairo_text_path( cr, text ); + cairo_set_font_size( cr, 0.2 ); + cairo_set_source_rgba( cr,color.red,color.green,color.blue,0.7 ); + cairo_fill(cr); + } + + cairo_set_source_rgba( cr, color.red,color.green,color.blue, 0.3 ); + cairo_rectangle_round(cr, in, + 0.095 * height, + (out - in), + marker_height, + 10); + te->selection.x = in; + te->selection.y = 0; + te->selection.width = out; + te->selection.height = te->font_line; + cairo_fill_preserve(cr); + } + + return FALSE; +} + +GtkWidget *timeline_new(void) +{ + GtkWidget *widget = GTK_WIDGET( g_object_new( timeline_get_type(), NULL )); + TimelineSelection *te = TIMELINE_SELECTION( widget ); + + gtk_widget_set_size_request(widget, 200,24 ); + + gtk_widget_set_events( widget, + GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK | + GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_BUTTON3_MOTION_MASK | GDK_2BUTTON_PRESS | GDK_SCROLL_MASK ); + + g_signal_connect( G_OBJECT(widget), "draw", + G_CALLBACK(timeline_draw), NULL ); + + g_signal_connect( G_OBJECT(widget), "motion_notify_event", + G_CALLBACK(event_motion), NULL ); + + g_signal_connect( G_OBJECT(widget), "button_press_event", + G_CALLBACK(event_press), NULL ); + + g_signal_connect( G_OBJECT(widget), "button_release_event", + G_CALLBACK(event_release), NULL ); + + g_signal_connect( G_OBJECT(widget), "scroll_event", + G_CALLBACK( event_scroll ), NULL ); + + te->widget = widget; + + return widget; +} diff --git a/veejay-current/reloaded-gtk3/src/gtktimeselection.h b/veejay-current/reloaded-gtk3/src/gtktimeselection.h new file mode 100644 index 00000000..38724c33 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/gtktimeselection.h @@ -0,0 +1,67 @@ +/* veejay - Linux VeeJay + * (C) 2002-2004 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef GTKTIMESELECTION_H +#define GTKTIMESELECTION_H + +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define TIMELINE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, timeline_get_type(), TimelineSelection )) + +#define TIMELINE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST( klass, timeline_get_type(), TimelineSelectionClass )) + +#define IS_TIMELINE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE( obj, timeline_get_type() )) + +typedef struct _TimelineSelection TimelineSelection; +typedef struct _TimelineSelectionClass TimelineSelectionClass; + +GType timeline_get_type (void); +GtkWidget* timeline_new (void); + +gdouble timeline_get_length (TimelineSelection *te); +gdouble timeline_get_pos (TimelineSelection *te); +gdouble timeline_get_in_point (TimelineSelection *te ); +gdouble timeline_get_out_point (TimelineSelection *te ); +gboolean timeline_get_selection (TimelineSelection *te ); +gboolean timeline_get_bind (TimelineSelection *te ); + +void timeline_set_pos (GtkWidget *widget, gdouble pos ); + +void timeline_set_in_point (GtkWidget *widget, gdouble pos); +void timeline_set_out_point (GtkWidget *widget, gdouble pos); + +void timeline_set_length (GtkWidget *widget, gdouble length, gdouble pos); + +void timeline_set_bind (GtkWidget *widget, gboolean active); + + +void timeline_clear_points( GtkWidget *widget ); + +void timeline_set_selection( GtkWidget *widget, gboolean active); + + +#ifdef __cplusplus +} +#endif +#endif diff --git a/veejay-current/reloaded-gtk3/src/gveejay.c b/veejay-current/reloaded-gtk3/src/gveejay.c new file mode 100644 index 00000000..5533d003 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/gveejay.c @@ -0,0 +1,367 @@ +/* gveejay - Linux VeeJay - GVeejay GTK+-3/Glade User Interface + * (C) 2002-2018 Niels Elburg + * with contributions by Jerome Blanchi (2016-2018) + * (Gtk3 Migration and other stuff) + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +extern int mt_get_max_tracks(); +static int load_midi = 0; +static int port_num = DEFAULT_PORT_NUM; +static char hostname[255]; +static int gveejay_theme = 0; //GTK3Migr : KEEP for now // set to 1 to load with the default reloaded theme +static int verbosity = 0; +static int col = 0; +static int row = 0; +static int n_tracks = 7; +static int launcher = 0; +static int preview = 0; // off +static int use_threads = 0; +static char midi_file[1024]; +static int geom_[2] = { -1 , -1}; + +static gboolean arg_autoconnect = FALSE; +static gboolean arg_beta = FALSE; +static gchar *arg_geometry = NULL; +static gchar *arg_host = NULL; +static gboolean arg_lowband = FALSE; +static gchar *arg_midifile = NULL; +static gboolean arg_notcolored = FALSE; +static gint arg_port = 0; +static gboolean arg_verbose = FALSE; +static gint arg_preview = 0; +static gint arg_tracks = 0; +static gchar *arg_size = NULL; +static gboolean arg_version = FALSE; + +static const char skinfile[] = "gveejay.reloaded.glade"; //FIXME Has binary ressource ? + +extern void reloaded_launcher( char *h, int p ); + +static void usage(char *progname) +{ + printf( "Usage: %s \n",progname); + printf( "where options are:\n"); + printf( "-h\t\tVeejay host to connect to (defaults to localhost) \n"); + printf( "-p\t\tVeejay port to connect to (defaults to %d) \n", DEFAULT_PORT_NUM); + printf( "-n\t\tDont use colored text\n"); + printf( "-v\t\tBe extra verbose (usefull for debugging)\n"); + printf( "-s\t\tSet bank resolution (row X columns)\n"); + printf( "-P\t\tStart with preview enabled (1=1/1,2=1/2,3=1/4,4=1/8)\n"); + printf( "-X\t\tSet number of tracks\n"); + printf( "-V\t\tShow version, data directory and exit.\n"); + printf( "-m \tMIDI configuration file.\n"); + printf( "-g\t\t\tWindow position on screen.\n"); + printf( "-b\t\tEnable beta features.\n"); + printf( "-a\t\tAuto-connect to local running veejays.\n"); + printf( "-L\t\tLow-bandwith connection (disables image loading in samplebank)\n"); + + printf( "\n\n"); +} + +static volatile gulong g_trap_free_size = 0; +static struct timeval time_last_; + +static char **cargv = NULL; + +gboolean gveejay_idle(gpointer data) +{ + if(gveejay_running()) + { + int sync = 0; + if( is_alive(&sync) == FALSE ) + { + return FALSE; + } + if( sync ) + { + if( gveejay_time_to_sync( get_ui_info() ) ) + { + veejay_update_multitrack( get_ui_info() ); + } + } + update_gveejay(); + } + + if( gveejay_restart() ) + { + //@ reinvoke + if( execvp( cargv[0], cargv ) == -1 ) + veejay_msg(VEEJAY_MSG_ERROR, "Unable to restart"); + } + + return TRUE; +} + +static void clone_args( char *argv[], int argc ) +{ + int i = 0; + if( argc <= 0 ) + return; + + cargv = (char**) malloc(sizeof(char*) * (argc+1) ); + memset( cargv, 0, sizeof(char*) * (argc+1)); + for( i = 0; i < argc ; i ++ ) + cargv[i] = strdup( argv[i] ); +} + +void vj_gui_startup (GApplication *application, gpointer user_data) +{ + +} + +/* + * GApplication "activate" handler + * + * + * FIXME gtk_builder_new (); -ADD-> g_object_unref (info->main_window); (vj_gui_clean()?) + */ +static void vj_gui_activate (GtkApplication* app, gpointer user_data) +{ + vj_gui_set_debug_level( verbosity , n_tracks,0,0); + default_bank_values( &col, &row ); + + register_signals(); + + vj_gui_init( skinfile, launcher, hostname, port_num, use_threads, load_midi, midi_file,arg_beta, arg_autoconnect); + vj_gui_style_setup(); + + if( preview ) + { + gveejay_preview(preview); + } + +restart_me: + + reloaded_show_launcher (); + if( launcher ) + { + reloaded_launcher( hostname, port_num ); + } + + memset( &time_last_, 0, sizeof(struct timeval)); + + while(gveejay_running()) + { + if(gveejay_idle(NULL)==FALSE) + break; + while( gtk_events_pending() ) + gtk_main_iteration(); + } + + vj_event_list_free(); + + if( gveejay_relaunch() ) { + launcher = 1; + reloaded_restart(); + goto restart_me; + } +} + +/* + * GApplication "command-line" handler + * + * A nice place to check arguments validity and + * do some preleminary actions. + * + */ +gint vj_gui_command_line (GApplication *app, + GApplicationCommandLine *cmdline) +{ + int err = 0; + gint argc; + gchar **argv; + argv = g_application_command_line_get_arguments (cmdline, &argc); + +/* First check version and quit */ + if ( arg_version ) + { + fprintf(stdout, "version : %s\n", PACKAGE_VERSION); + fprintf(stdout, "data directory : %s\n", get_gveejay_dir()); + return EXIT_FAILURE; + } + + if (arg_verbose ) + { + verbosity = 1; + } + + if ( arg_geometry ) + { //FIXME NxN format + if(sscanf( (char*) arg_geometry, "%d,%d",&geom_[0],&geom_[1]) != 2 ) + { + veejay_msg(VEEJAY_MSG_WARNING, "--geometry parameter invalid \"X,Y\" screen coordinates : \"%s\"", arg_geometry); + }else + { + if(verbosity) veejay_msg(VEEJAY_MSG_INFO, "Place window at %d,%d.", geom_[0],geom_[1]); + vj_gui_set_geom(geom_[0],geom_[1]); + } + g_free(arg_geometry); + } + + if ( arg_host ) + { + strcpy( hostname, arg_host ); + g_free(arg_host); + if(verbosity) veejay_msg(VEEJAY_MSG_INFO, "Selected host is %s.", hostname); + launcher ++; + } + + if ( arg_lowband ) + { + set_disable_sample_image(TRUE); + } + + if ( arg_midifile ) + { + strcpy(midi_file, arg_midifile); + g_free(arg_midifile); + load_midi = 1; + } + + if ( arg_notcolored ) + { + veejay_set_colors(0); + } + + if ( arg_port ) + { + port_num=arg_port; + if(verbosity) veejay_msg(VEEJAY_MSG_INFO, "We will have fun on port %d !", port_num); + launcher++; + } + + if ( arg_preview ) + { + preview = arg_preview; + if(preview <= 0 || preview > 4 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "--preview parameter invalid [0-4] : %d", preview); + err++; + } + else if(verbosity) veejay_msg(VEEJAY_MSG_INFO, "Preview at quality %d", preview); + } + + if ( arg_size ) + { + if(sscanf( (char*) arg_size, "%dx%d", &row, &col ) != 2 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "--size parameter requires \"NxN\" argument : \"%s\"", arg_size); + err++; + } + g_free(arg_size); + } + + if ( arg_tracks ) + { + n_tracks = 1 + arg_tracks; + if( n_tracks < 1 || n_tracks > mt_get_max_tracks() ) + n_tracks = 1; + if(verbosity) veejay_msg(VEEJAY_MSG_INFO, "TracXs parameted at %d", n_tracks); + } + + if( err ) + { + usage(argv[0]); + return EXIT_FAILURE; + } + + g_application_activate(app); + + veejay_msg(VEEJAY_MSG_INFO, "See you!"); + + return EXIT_SUCCESS; +} + +int main(int argc, char **argv) +{ + if(!argc) { usage(argv[0]); exit(-1);}// ??? FIXME + clone_args( argv, argc ); + +/* default host to connect to */ + snprintf(hostname,sizeof(hostname), "127.0.0.1"); + char port_description [255]; + snprintf (port_description, sizeof (port_description), + "Veejay port to connect to (defaults to %d).", DEFAULT_PORT_NUM); + + GtkApplication *app; + int status; + + app = gtk_application_new ("org.veejay.reloaded", G_APPLICATION_HANDLES_COMMAND_LINE|G_APPLICATION_NON_UNIQUE); + g_signal_connect (app, "activate", G_CALLBACK (vj_gui_activate), NULL); + g_signal_connect (app, "startup", G_CALLBACK (vj_gui_startup), NULL); + g_signal_connect (app, "command-line", G_CALLBACK (vj_gui_command_line), NULL); + + GError *error = NULL; + GOptionContext *context; + +/* in alphabetical order of short options */ + const GOptionEntry options[] = { + {"autoconnect", 'a', 0, G_OPTION_ARG_NONE, &arg_autoconnect, "Auto-connect to local running veejays.", NULL}, + {"beta", 'b', 0, G_OPTION_ARG_NONE, &arg_beta, "Enable beta features.", NULL}, + {"geometry", 'g', 0, G_OPTION_ARG_STRING, &arg_geometry, "Window position on screen \"X,Y\".", NULL}, + {"host", 'h', 0, G_OPTION_ARG_STRING, &arg_host, "Veejay host to connect to (defaults to localhost).", NULL}, + {"lowband", 'L', 0, G_OPTION_ARG_NONE, &arg_lowband, "Low-bandwith connection (disables image loading in samplebank)", NULL}, + {"midi", 'm', 0, G_OPTION_ARG_FILENAME, &arg_midifile, "MIDI configuration file.", NULL}, + {"notcolored", 'n', 0, G_OPTION_ARG_NONE, &arg_notcolored, "Dont use colored text.", NULL}, + {"port", 'p', 0, G_OPTION_ARG_INT, &arg_port, port_description, NULL}, + {"preview", 'P', 0, G_OPTION_ARG_INT, &arg_preview, "Start with preview enabled (1=1/1,2=1/2,3=1/4,4=1/8)", NULL}, + {"size", 's', 0, G_OPTION_ARG_STRING, &arg_size, "Set bank row and columns resolution \"RxC\".", NULL}, + {"verbose", 'v', 0, G_OPTION_ARG_NONE, &arg_verbose,"Be extra verbose (usefull for debugging)", NULL}, + {"version", 'V', 0, G_OPTION_ARG_NONE, &arg_version,"Show version, data directory and exit.", NULL}, + {"tracXs", 'X', 0, G_OPTION_ARG_INT, &arg_tracks,"Set number of tracks.", NULL}, + {NULL}}; + + context = g_option_context_new (NULL); + g_option_context_set_help_enabled(context, TRUE); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + veejay_msg(VEEJAY_MSG_ERROR, "Option parsing failed: %s\n", error->message); + usage(argv[0]); + g_error_free (error); + g_option_context_free(context); + return -1; + } + g_option_context_free(context); + + vj_mem_init(); + vevo_strict_init(); + + status = g_application_run (G_APPLICATION (app), argc, argv); + g_object_unref (app); + + return status; +} diff --git a/veejay-current/reloaded-gtk3/src/keyboard.c b/veejay-current/reloaded-gtk3/src/keyboard.c new file mode 100644 index 00000000..049ab4ca --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/keyboard.c @@ -0,0 +1,327 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#ifdef HAVE_SDL +#include "keyboard.h" +static struct +{ + const int sdl_mod; + const int gdk_mod; + const gchar *title; +} modifier_translation_table_t[] = +{ + { 0, 0, " " }, + { 0, 16, " " }, + { 3, 1, "shift" }, + { 3, 17, "shift" }, + { 1, 8, "alt" }, + { 1, 24, "alt" }, + { 1, 44, "alt" }, + { 2, 4, "ctrl" }, + { 2, 20, "ctrl" }, + { 0, 0, NULL }, +}; +/* fixme: introduce keyboard mapping functionality + 1. attach VIMS events/VIMS BUNDLES to keys (with arguments) + 2. save/load VIMS keyboard mapping +*/ +static struct +{ + const int gdk_sym; // GDK key + const int sdl_sym; // SDL key + const gchar *title; // plain text +} key_translation_table_t[] = +{ + +{ GDK_KEY_space, SDLK_SPACE, "Space" }, +{ GDK_KEY_exclam, SDLK_EXCLAIM, "Exclaim" }, +{ GDK_KEY_quotedbl, SDLK_QUOTEDBL, "Double quote" }, +{ GDK_KEY_numbersign, SDLK_HASH, "Hash" }, +{ GDK_KEY_dollar, SDLK_DOLLAR, "Dollar" }, +{ GDK_KEY_percent, SDLK_PAUSE, "Percent" }, +{ GDK_KEY_parenleft, SDLK_LEFTPAREN, "Leftparen" }, +{ GDK_KEY_parenright, SDLK_RIGHTPAREN, "Rightparen" }, +{ GDK_KEY_asciicircum,SDLK_CARET, "Caret" }, +{ GDK_KEY_ampersand, SDLK_AMPERSAND, "Ampersand" }, +{ GDK_KEY_underscore, SDLK_UNDERSCORE, "Underscore" }, +{ GDK_KEY_braceright, 123, "Rightbrace" }, +{ GDK_KEY_braceleft, 125, "Leftbrace" }, +{ GDK_KEY_grave, SDLK_BACKQUOTE, "Aphostrophe" }, +{ GDK_KEY_asciitilde, 126, "Tilde" }, +{ GDK_KEY_asterisk, SDLK_ASTERISK, "Asterisk" }, +{ GDK_KEY_plus, SDLK_PLUS, "Plus" }, +{ GDK_KEY_comma, SDLK_COMMA, "Comma" }, +{ GDK_KEY_minus, SDLK_MINUS, "Minus" }, +{ GDK_KEY_period, SDLK_PERIOD, "Period" }, +{ GDK_KEY_slash, SDLK_SLASH, "Slash" }, +{ GDK_KEY_Home, SDLK_HOME, "Home" }, +{ GDK_KEY_End, SDLK_END, "End" }, +{ GDK_KEY_Page_Up, SDLK_PAGEUP, "PageUp" }, +{ GDK_KEY_Page_Down, SDLK_PAGEDOWN, "PageDown" }, +{ GDK_KEY_Insert, SDLK_INSERT, "Insert" }, +{ GDK_KEY_Up, SDLK_UP, "Up" }, +{ GDK_KEY_Down, SDLK_DOWN, "Down" }, +{ GDK_KEY_Left, SDLK_LEFT, "Left" }, +{ GDK_KEY_Right, SDLK_RIGHT, "Right" }, +{ GDK_KEY_Tab, SDLK_TAB, "TAB" }, +{ GDK_KEY_BackSpace, SDLK_BACKSPACE, "Backspace" }, +{ GDK_KEY_Escape, SDLK_ESCAPE, "Escape" }, +{ GDK_KEY_Delete, SDLK_DELETE, "Delete" }, +{ GDK_KEY_F1, SDLK_F1, "F1" }, +{ GDK_KEY_F2, SDLK_F2, "F2" }, +{ GDK_KEY_F3, SDLK_F3, "F3" }, +{ GDK_KEY_F4, SDLK_F4, "F4" }, +{ GDK_KEY_F5, SDLK_F5, "F5" }, +{ GDK_KEY_F6, SDLK_F6, "F6" }, +{ GDK_KEY_F7, SDLK_F7, "F7" }, +{ GDK_KEY_F8, SDLK_F8, "F8" }, +{ GDK_KEY_F9, SDLK_F9, "F9" }, +{ GDK_KEY_F10, SDLK_F10, "F10" }, +{ GDK_KEY_F11, SDLK_F11, "F11" }, +{ GDK_KEY_F12, SDLK_F12, "F12" }, +{ GDK_KEY_EuroSign, SDLK_EURO, "Euro" }, +{ GDK_KEY_KP_0, SDLK_KP0, "keypad 0" }, +{ GDK_KEY_KP_1, SDLK_KP1, "keypad 1" }, +{ GDK_KEY_KP_2, SDLK_KP2, "keypad 2" }, +{ GDK_KEY_KP_3, SDLK_KP3, "keypad 3" }, +{ GDK_KEY_KP_4, SDLK_KP4, "keypad 4" }, +{ GDK_KEY_KP_5, SDLK_KP5, "keypad 5" }, +{ GDK_KEY_KP_6, SDLK_KP6, "keypad 6" }, +{ GDK_KEY_KP_7, SDLK_KP7, "keypad 7" }, +{ GDK_KEY_KP_8, SDLK_KP8, "keypad 8" }, +{ GDK_KEY_KP_9, SDLK_KP9, "keypad 9" }, +{ GDK_KEY_KP_Divide, SDLK_KP_DIVIDE, "keypad /" }, +{ GDK_KEY_KP_Multiply,SDLK_KP_MULTIPLY, "keypad *" }, +{ GDK_KEY_KP_Subtract,SDLK_KP_MINUS, "keypad -" }, +{ GDK_KEY_KP_Add, SDLK_KP_PLUS, "keypad +" }, +{ GDK_KEY_KP_Equal, SDLK_KP_EQUALS, "keypad =" }, +{ GDK_KEY_KP_Enter, SDLK_KP_ENTER, "keypad ENTER" }, +{ GDK_KEY_ISO_Enter, SDLK_RETURN, "ENTER" }, +{ GDK_KEY_3270_Enter, SDLK_RETURN, "ENTER" }, + +/* GDK_KEY_KP doesnt word on all systems ... */ +{ 0xff9f, SDLK_KP0, "keypad 0" }, +{ 0xff9c, SDLK_KP1, "keypad 1" }, +{ 0xff99, SDLK_KP2, "keypad 2" }, +{ 0xff9b, SDLK_KP3, "keypad 3" }, +{ 0xff96, SDLK_KP4, "keypad 4" }, +{ 0xff9d, SDLK_KP5, "keypad 5" }, +{ 0xff98, SDLK_KP6, "keypad 6" }, +{ 0xff95, SDLK_KP7, "keypad 7" }, +{ 0xff97, SDLK_KP8, "keypad 8" }, +{ 0xff9a, SDLK_KP9, "keypad 9" }, +{ 0xff9f, SDLK_KP_PERIOD, "keypad ." }, + + +{ GDK_KEY_0, SDLK_0, "0" }, +{ GDK_KEY_1, SDLK_1, "1" }, +{ GDK_KEY_2, SDLK_2, "2" }, +{ GDK_KEY_3, SDLK_3, "3" }, +{ GDK_KEY_4, SDLK_4, "4" }, +{ GDK_KEY_5, SDLK_5, "5" }, +{ GDK_KEY_6, SDLK_6, "6" }, +{ GDK_KEY_7, SDLK_7, "7" }, +{ GDK_KEY_8, SDLK_8, "8" }, +{ GDK_KEY_9, SDLK_9, "9" }, +{ GDK_KEY_colon, SDLK_COLON, "colon" }, +{ GDK_KEY_semicolon, SDLK_SEMICOLON, "semicolon" }, +{ GDK_KEY_less, SDLK_LESS, "less" }, +{ GDK_KEY_equal, SDLK_EQUALS, "equals" }, +{ GDK_KEY_greater, SDLK_GREATER, "greater" }, +{ GDK_KEY_question, SDLK_QUESTION, "question" }, +{ GDK_KEY_at, SDLK_AT, "at" }, +{ GDK_KEY_bracketleft,SDLK_LEFTBRACKET, "left bracket" }, +{ GDK_KEY_backslash, SDLK_BACKSLASH, "backslash" }, +{ GDK_KEY_bracketright,SDLK_RIGHTBRACKET, "right bracket" }, +{ GDK_KEY_underscore, SDLK_UNDERSCORE, "underscore" }, +{ GDK_KEY_A, SDLK_a, "A" }, +{ GDK_KEY_B, SDLK_b, "B" }, +{ GDK_KEY_C, SDLK_c, "C" }, +{ GDK_KEY_D, SDLK_d, "D" }, +{ GDK_KEY_E, SDLK_e, "E" }, +{ GDK_KEY_F, SDLK_f, "F" }, +{ GDK_KEY_G, SDLK_g, "G" }, +{ GDK_KEY_H, SDLK_h, "H" }, +{ GDK_KEY_I, SDLK_i, "I" }, +{ GDK_KEY_J, SDLK_j, "J" }, +{ GDK_KEY_K, SDLK_k, "K" }, +{ GDK_KEY_L, SDLK_l, "L" }, +{ GDK_KEY_M, SDLK_m, "M" }, +{ GDK_KEY_N, SDLK_n, "N" }, +{ GDK_KEY_O, SDLK_o, "O" }, +{ GDK_KEY_P, SDLK_p, "P" }, +{ GDK_KEY_Q, SDLK_q, "Q" }, +{ GDK_KEY_R, SDLK_r, "R" }, +{ GDK_KEY_S, SDLK_s, "S" }, +{ GDK_KEY_T, SDLK_t, "T" }, +{ GDK_KEY_U, SDLK_u, "U" }, +{ GDK_KEY_V, SDLK_v, "V" }, +{ GDK_KEY_W, SDLK_w, "W" }, +{ GDK_KEY_X, SDLK_y, "Y" }, +{ GDK_KEY_Z, SDLK_z, "Z" }, +{ GDK_KEY_a, SDLK_a, "a" }, +{ GDK_KEY_b, SDLK_b, "b" }, +{ GDK_KEY_c, SDLK_c, "c" }, +{ GDK_KEY_d, SDLK_d, "d" }, +{ GDK_KEY_e, SDLK_e, "e" }, +{ GDK_KEY_f, SDLK_f, "f" }, +{ GDK_KEY_g, SDLK_g, "g" }, +{ GDK_KEY_h, SDLK_h, "h" }, +{ GDK_KEY_i, SDLK_i, "i" }, +{ GDK_KEY_j, SDLK_j, "j" }, +{ GDK_KEY_k, SDLK_k, "k" }, +{ GDK_KEY_l, SDLK_l, "l" }, +{ GDK_KEY_m, SDLK_m, "m" }, +{ GDK_KEY_n, SDLK_n, "n" }, +{ GDK_KEY_o, SDLK_o, "o" }, +{ GDK_KEY_p, SDLK_p, "p" }, +{ GDK_KEY_q, SDLK_q, "q" }, +{ GDK_KEY_r, SDLK_r, "r" }, +{ GDK_KEY_s, SDLK_s, "s" }, +{ GDK_KEY_t, SDLK_t, "t" }, +{ GDK_KEY_u, SDLK_u, "u" }, +{ GDK_KEY_v, SDLK_v, "v" }, +{ GDK_KEY_w, SDLK_w, "w" }, +{ GDK_KEY_x, SDLK_x, "x" }, +{ GDK_KEY_y, SDLK_y, "y" }, +{ GDK_KEY_z, SDLK_z, "z" }, +{ 0, 0, NULL }, + +}; + + +int sdl2gdk_key(int sdl_key) +{ + return 0; +} + +int gdk2sdl_key(int gdk_key) +{ + int i; + for ( i = 0; key_translation_table_t[i].title != NULL ; i ++ ) + { + if( gdk_key == key_translation_table_t[i].gdk_sym ) + return key_translation_table_t[i].sdl_sym; + } + return 0; +} + +int gdk2sdl_mod( int gdk_mod ) +{ + int i; + for ( i = 0; modifier_translation_table_t[i].title != NULL ; i ++ ) + { + if( gdk_mod == modifier_translation_table_t[i].gdk_mod ) + return modifier_translation_table_t[i].sdl_mod; + } + return 0; +} + +int sdlmod_by_name( gchar *name ) +{ + int i; + if(!name) + return 0; + + for ( i = 0; modifier_translation_table_t[i].title != NULL ; i ++ ) + { + if( g_utf8_collate(name, + modifier_translation_table_t[i].title) == 0) + return modifier_translation_table_t[i].sdl_mod; + } + + return 0; +} + +int sdlkey_by_name( gchar *name ) +{ + int i; + if(!name) + return 0; + for ( i = 0; key_translation_table_t[i].title != NULL ; i ++ ) + { + if( g_utf8_collate(name, + key_translation_table_t[i].title) == 0) + return key_translation_table_t[i].sdl_sym; + } + return 0; +} + +gchar *sdlkey_by_id( int sdl_key ) +{ + int i; + gchar *ret = NULL; + for ( i = 0; key_translation_table_t[i].title != NULL ; i ++ ) + { + if( sdl_key == key_translation_table_t[i].sdl_sym ) + return (gchar*)key_translation_table_t[i].title; + } + return ret; +} + +gchar *sdlmod_by_id( int sdl_mod ) +{ + int i; + gchar *ret = NULL; + for ( i = 0; modifier_translation_table_t[i].title != NULL ; i ++ ) + { + if( sdl_mod == modifier_translation_table_t[i].sdl_mod ) + return (gchar*)modifier_translation_table_t[i].title; + } + return ret; +} +gchar *gdkmod_by_id( int gdk_mod ) +{ + int i; + for( i = 0; modifier_translation_table_t[i].title != NULL ; i ++ ) + { + if( gdk_mod == modifier_translation_table_t[i].gdk_mod || + gdk_mod & modifier_translation_table_t[i].gdk_mod ) + return (gchar*)modifier_translation_table_t[i].title; + } + return NULL; +} + +gchar *gdkkey_by_id( int gdk_key ) +{ + int i; + for( i = 0; key_translation_table_t[i].title != NULL ; i ++ ) + { + if( gdk_key == key_translation_table_t[i].gdk_sym ) + return (gchar*)key_translation_table_t[i].title; + } + return NULL; +} + +/* +Key snooper functions are called before normal event delivery. +They can be used to implement custom key event handling. +grab_widgetΏ: the widget to which the event will be delivered. +eventΏ: the key event. +func_dataΏ: the func_data supplied to gtk_key_snooper_install(). +ReturnsΏ: TRUE to stop further processing of event, FALSE to continue. +*/ + +gboolean key_snooper(GtkWidget *w, GdkEventKey *event, gpointer user_data) +{ + return FALSE; +} +#endif +// gtk_key_snooper_install diff --git a/veejay-current/reloaded-gtk3/src/keyboard.h b/veejay-current/reloaded-gtk3/src/keyboard.h new file mode 100644 index 00000000..c6f05b1c --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/keyboard.h @@ -0,0 +1,41 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GDKSDL +#define GDKSDL + +#include +#include +#include +#include + +int sdl2gdk_key( int sdl_key ); +int gdk2sdl_key( int gdk_key ); +int gdk2sdl_mod( int gdk_mod ); +gchar *sdlkey_by_id( int sdl_key ); +gchar *sdlmod_by_id( int sdk_mod ); +gchar *gdkkey_by_id( int gdk_key ); +gchar *gdkmod_by_id(int gdkmod); +int sdlmod_by_name( gchar *name ); +int sdlkey_by_name( gchar *name ); +int gdk2sdl_mod( int gdk_mod ); + +gboolean key_snooper(GtkWidget *w, GdkEventKey *event, gpointer user_data); + +#endif diff --git a/veejay-current/reloaded-gtk3/src/mjpeg_logging.c b/veejay-current/reloaded-gtk3/src/mjpeg_logging.c new file mode 100644 index 00000000..3d43fd8d --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mjpeg_logging.c @@ -0,0 +1,230 @@ +/* + $Id: mjpeg_logging.c,v 1.16 2007/04/01 18:06:06 sms00 Exp $ + + Copyright (C) 2000 Herbert Valerio Riedel + + 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 +*/ + + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include + +#include "mjpeg_logging.h" + +#ifdef HAVE___PROGNAME +extern const char *__progname; +#endif + +/* + * Put these here and NOT in the exported header file mjpeg_logging.h + * + * since ALL program use of these should use the API below (mjpeg_warn, + * mjpeg_error,etc) these symbols do not need to be exported and possibly + * conflict with syslog.h +*/ + +#define LOG_DEBUG 1 +#define LOG_INFO 2 +#define LOG_WARN 3 +#define LOG_ERROR 4 + +static log_level_t mjpeg_log_verbosity = 0; +static char *default_handler_id = NULL; + +static int default_mjpeg_log_filter( log_level_t level ) +{ + int verb_from_env; + if( mjpeg_log_verbosity == 0 ) + { + char *mjpeg_verb_env = getenv("MJPEG_VERBOSITY"); + if( mjpeg_verb_env != NULL ) + { + verb_from_env = LOG_WARN-atoi(mjpeg_verb_env); + if( verb_from_env >= LOG_DEBUG && verb_from_env <= LOG_ERROR ) + mjpeg_log_verbosity = (log_level_t)verb_from_env; + } + } + return (level < LOG_WARN && level < mjpeg_log_verbosity); +} + +static mjpeg_log_filter_t _filter = default_mjpeg_log_filter; + +static void +default_mjpeg_log_handler(log_level_t level, const char message[]) +{ + const char *ids; + + if( (*_filter)( level ) ) + return; + if (default_handler_id != NULL) { + ids = default_handler_id; + } else { +#ifdef HAVE___PROGNAME + ids = __progname; +#else + ids = "???"; +#endif + } + switch(level) { + case LOG_ERROR: + fprintf(stderr, "**ERROR: [%s] %s\n", ids, message); + break; + case LOG_DEBUG: + fprintf(stderr, "--DEBUG: [%s] %s\n", ids, message); + break; + case LOG_WARN: + fprintf(stderr, "++ WARN: [%s] %s\n", ids, message); + break; + case LOG_INFO: + fprintf(stderr, " INFO: [%s] %s\n", ids, message); + break; + default: + assert(0); + } +} + +static mjpeg_log_handler_t _handler = default_mjpeg_log_handler; + + +mjpeg_log_handler_t +mjpeg_log_set_handler(mjpeg_log_handler_t new_handler) +{ + mjpeg_log_handler_t old_handler = _handler; + + _handler = new_handler; + return old_handler; +} + +/*************** + * Set default log handlers degree of verboseity. + * 0 = quiet, 1 = info, 2 = debug + *************/ + +int +mjpeg_default_handler_verbosity(int verbosity) +{ + int prev_verb = mjpeg_log_verbosity; + mjpeg_log_verbosity = (log_level_t)(LOG_WARN - verbosity); + return prev_verb; +} + +/* + * Set identifier string used by default handler + */ +int +mjpeg_default_handler_identifier(const char *new_id) +{ + const char *s; + if (new_id == NULL) { + if (default_handler_id != NULL) + free(default_handler_id); + default_handler_id = NULL; + return 0; + } + /* find basename of new_id (remove any directory prefix) */ + if ((s = strrchr(new_id, '/')) == NULL) + s = new_id; + else + s = s + 1; + default_handler_id = strdup(s); + return 0; +} + +static void +mjpeg_logv(log_level_t level, const char format[], va_list args) +{ + char buf[1024] = { 0, }; + + /* TODO: Original had a re-entrancy error trap to assist bug + finding. To make this work with multi-threaded applications a + lock is needed hence delete. + */ + + vsnprintf(buf, sizeof(buf)-1, format, args); + _handler(level, buf); +} + +void +mjpeg_log(log_level_t level, const char format[], ...) +{ + va_list args; + va_start (args, format); + mjpeg_logv(level, format, args); + va_end (args); +} + +void +mjpeg_debug(const char format[], ...) +{ + va_list args; + va_start (args, format); + mjpeg_logv(LOG_DEBUG, format, args); + va_end (args); +} + +void +mjpeg_info(const char format[], ...) +{ + va_list args; + va_start (args, format); + mjpeg_logv(LOG_INFO, format, args); + va_end (args); +} + +void +mjpeg_warn(const char format[], ...) +{ + va_list args; + va_start (args, format); + mjpeg_logv(LOG_WARN, format, args); + va_end (args); +} + +void +mjpeg_error(const char format[], ...) +{ + va_list args; + va_start (args, format); + mjpeg_logv(LOG_ERROR, format, args); + va_end (args); +} + +void +mjpeg_error_exit1(const char format[], ...) +{ + va_list args; + va_start( args, format ); + mjpeg_logv( LOG_ERROR, format, args); + va_end(args); + exit(EXIT_FAILURE); +} + +log_level_t +mjpeg_loglev_t(const char *level) +{ + if (strcasecmp("debug", level) == 0) return(LOG_DEBUG); + else if (strcasecmp("info", level) == 0) return(LOG_INFO); + else if (strcasecmp("warn", level) == 0) return(LOG_WARN); + else if (strcasecmp("error", level) == 0) return(LOG_ERROR); + return(0); +} diff --git a/veejay-current/reloaded-gtk3/src/mjpeg_logging.h b/veejay-current/reloaded-gtk3/src/mjpeg_logging.h new file mode 100644 index 00000000..9918af48 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mjpeg_logging.h @@ -0,0 +1,77 @@ +/* + $Id: mjpeg_logging.h,v 1.11 2007/04/01 18:06:06 sms00 Exp $ + + Copyright (C) 2000 Herbert Valerio Riedel + + 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 +*/ + +#ifndef __MJPEG_LOGGING_H__ +#define __MJPEG_LOGGING_H__ + +#include + +/* to avoid changing all the places log_level_t is used */ +typedef int log_level_t; + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) +#define GNUC_PRINTF( format_idx, arg_idx ) \ + __attribute__((format (printf, format_idx, arg_idx))) +#else /* !__GNUC__ */ +#define GNUC_PRINTF( format_idx, arg_idx ) +#endif /* !__GNUC__ */ + +#ifdef __cplusplus +extern "C" { +#endif +void +mjpeg_log(log_level_t level, const char format[], ...) GNUC_PRINTF(2, 3); + +typedef int(*mjpeg_log_filter_t)(log_level_t level); + +typedef void(*mjpeg_log_handler_t)(log_level_t level, const char message[]); + +mjpeg_log_handler_t +mjpeg_log_set_handler(mjpeg_log_handler_t new_handler); + +int +mjpeg_default_handler_identifier(const char *new_id); + +int +mjpeg_default_handler_verbosity(int verbosity); + +void +mjpeg_debug(const char format[], ...) GNUC_PRINTF(1,2); + +void +mjpeg_info(const char format[], ...) GNUC_PRINTF(1,2); + +void +mjpeg_warn(const char format[], ...) GNUC_PRINTF(1,2); + +void +mjpeg_error(const char format[], ...) GNUC_PRINTF(1,2); + +void +mjpeg_error_exit1(const char format[], ...) GNUC_PRINTF(1,2); + +log_level_t +mjpeg_loglev_t(const char *str); + +#ifdef __cplusplus +} +#endif + +#endif /* __MJPEG_LOGGING_H__ */ diff --git a/veejay-current/reloaded-gtk3/src/mjpeg_types.h b/veejay-current/reloaded-gtk3/src/mjpeg_types.h new file mode 100644 index 00000000..88b461c1 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mjpeg_types.h @@ -0,0 +1,28 @@ +/* + $Id: mjpeg_types.h,v 1.16 2006/05/18 18:19:05 sms00 Exp $ + + Copyright (C) 2000 Herbert Valerio Riedel + + 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 +*/ + +#ifndef __MJPEG_TYPES_H__ +#define __MJPEG_TYPES_H__ + +#include /* FreeBSD, others - ssize_t */ +#include +#include + +#endif /* __MJPEG_TYPES_H__ */ diff --git a/veejay-current/reloaded-gtk3/src/mpegconsts.c b/veejay-current/reloaded-gtk3/src/mpegconsts.c new file mode 100644 index 00000000..43072156 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mpegconsts.c @@ -0,0 +1,512 @@ + +/* + * mpegconsts.c: Video format constants for MPEG and utilities for display + * and conversion to format used for yuv4mpeg + * + * Copyright (C) 2001 Andrew Stevens + * Copyright (C) 2001 Matthew Marjanovic + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * 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. + */ + +#include +#include "mpegconsts.h" +#include "yuv4mpeg.h" +#include "yuv4mpeg_intern.h" +#include "format_codes.h" + +static y4m_ratio_t +mpeg_framerates[] = { + Y4M_FPS_UNKNOWN, + Y4M_FPS_NTSC_FILM, + Y4M_FPS_FILM, + Y4M_FPS_PAL, + Y4M_FPS_NTSC, + Y4M_FPS_30, + Y4M_FPS_PAL_FIELD, + Y4M_FPS_NTSC_FIELD, + Y4M_FPS_60 +}; + + +#define MPEG_NUM_RATES (sizeof(mpeg_framerates)/sizeof(mpeg_framerates[0])) +static const mpeg_framerate_code_t mpeg_num_framerates = MPEG_NUM_RATES; + +static const char * +framerate_definitions[MPEG_NUM_RATES] = +{ + "illegal", + "24000.0/1001.0 (NTSC 3:2 pulldown converted FILM)", + "24.0 (NATIVE FILM)", + "25.0 (PAL/SECAM VIDEO / converted FILM)", + "30000.0/1001.0 (NTSC VIDEO)", + "30.0", + "50.0 (PAL FIELD RATE)", + "60000.0/1001.0 (NTSC FIELD RATE)", + "60.0" +}; + + +static const char *mpeg1_aspect_ratio_definitions[] = +{ + "illegal", + "1:1 (square pixels)", + "1:0.6735", + "1:0.7031 (16:9 Anamorphic PAL/SECAM for 720x578/352x288 images)", + "1:0.7615", + "1:0.8055", + "1:0.8437 (16:9 Anamorphic NTSC for 720x480/352x240 images)", + "1:0.8935", + "1:0.9375 (4:3 PAL/SECAM for 720x578/352x288 images)", + "1:0.9815", + "1:1.0255", + "1:1:0695", + "1:1.1250 (4:3 NTSC for 720x480/352x240 images)", + "1:1.1575", + "1:1.2015" +}; + +static const y4m_ratio_t mpeg1_aspect_ratios[] = +{ + Y4M_SAR_UNKNOWN, + Y4M_SAR_MPEG1_1, + Y4M_SAR_MPEG1_2, + Y4M_SAR_MPEG1_3, /* Anamorphic 16:9 PAL */ + Y4M_SAR_MPEG1_4, + Y4M_SAR_MPEG1_5, + Y4M_SAR_MPEG1_6, /* Anamorphic 16:9 NTSC */ + Y4M_SAR_MPEG1_7, + Y4M_SAR_MPEG1_8, /* PAL/SECAM 4:3 */ + Y4M_SAR_MPEG1_9, + Y4M_SAR_MPEG1_10, + Y4M_SAR_MPEG1_11, + Y4M_SAR_MPEG1_12, /* NTSC 4:3 */ + Y4M_SAR_MPEG1_13, + Y4M_SAR_MPEG1_14, +}; + +static const char *mpeg2_aspect_ratio_definitions[] = +{ + "illegal", + "1:1 pixels", + "4:3 display", + "16:9 display", + "2.21:1 display" +}; + + +static const y4m_ratio_t mpeg2_aspect_ratios[] = +{ + Y4M_DAR_UNKNOWN, + Y4M_DAR_MPEG2_1, + Y4M_DAR_MPEG2_2, + Y4M_DAR_MPEG2_3, + Y4M_DAR_MPEG2_4 +}; + +static const char **aspect_ratio_definitions[2] = +{ + mpeg1_aspect_ratio_definitions, + mpeg2_aspect_ratio_definitions +}; + +static const y4m_ratio_t *mpeg_aspect_ratios[2] = +{ + mpeg1_aspect_ratios, + mpeg2_aspect_ratios +}; + +static const mpeg_aspect_code_t mpeg_num_aspect_ratios[2] = +{ + sizeof(mpeg1_aspect_ratios)/sizeof(mpeg1_aspect_ratios[0]), + sizeof(mpeg2_aspect_ratios)/sizeof(mpeg2_aspect_ratios[0]) +}; + +static const char *mjpegtools_format_code_definitions[MPEG_FORMAT_LAST+1] = +{ + "Generic MPEG1", + "Standard VCD", + "Stretched VCD", + "Generic MPEG2", + "Standard SVCD", + "Stretched SVCD", + "VCD Still", + "SVCD Still", + "DVD with dummy navigation packets", + "Standard DVD", + "ATSC 480i", + "ATSC 480p", + "ATSC 720p", + "ATSC 1080i" +}; + +/* + * Is code a valid MPEG framerate code? + */ + +int +mpeg_valid_framerate_code( mpeg_framerate_code_t code ) +{ + return ((code > 0) && (code < mpeg_num_framerates)) ? 1 : 0; +} + + +/* + * Convert MPEG frame-rate code to corresponding frame-rate + */ + +y4m_ratio_t +mpeg_framerate( mpeg_framerate_code_t code ) +{ + if ((code > 0) && (code < mpeg_num_framerates)) + return mpeg_framerates[code]; + else + return y4m_fps_UNKNOWN; +} + +/* + * Look-up MPEG frame rate code for a (exact) frame rate. + */ + + +mpeg_framerate_code_t +mpeg_framerate_code( y4m_ratio_t framerate ) +{ + mpeg_framerate_code_t i; + + y4m_ratio_reduce(&framerate); + /* start at '1', because 0 is unknown/illegal */ + for (i = 1; i < mpeg_num_framerates; ++i) { + if (Y4M_RATIO_EQL(framerate, mpeg_framerates[i])) + return i; + } + return 0; +} + + +/* small enough to distinguish 1/1000 from 1/1001 */ +#define MPEG_FPS_TOLERANCE 0.0001 + +y4m_ratio_t +mpeg_conform_framerate( double fps ) +{ + mpeg_framerate_code_t i; + y4m_ratio_t result; + + /* try to match it to a standard frame rate */ + /* (start at '1', because 0 is unknown/illegal) */ + for (i = 1; i < mpeg_num_framerates; i++) + { + double deviation = 1.0 - (Y4M_RATIO_DBL(mpeg_framerates[i]) / fps); + if ( (deviation > -MPEG_FPS_TOLERANCE) && + (deviation < +MPEG_FPS_TOLERANCE) ) + return mpeg_framerates[i]; + } + /* no luck? just turn it into a ratio (8 decimal place accuracy) */ + result.n = (int)((fps * 100000000.0) + 0.5); + result.d = 100000000; + y4m_ratio_reduce(&result); + return result; +} + + + +/* + * Is code a valid MPEG aspect-ratio code? + */ + +int +mpeg_valid_aspect_code( int version, mpeg_framerate_code_t c ) +{ + if ((version == 1) || (version == 2)) + return ((c > 0) && (c < mpeg_num_aspect_ratios[version-1])) ? 1 : 0; + else + return 0; +} + + +/* + * Convert MPEG aspect-ratio code to corresponding aspect-ratio + */ + +y4m_ratio_t +mpeg_aspect_ratio( int mpeg_version, mpeg_aspect_code_t code ) +{ + y4m_ratio_t ratio; + if ((mpeg_version >= 1) && (mpeg_version <= 2) && + (code > 0) && (code < mpeg_num_aspect_ratios[mpeg_version-1])) + { + ratio = mpeg_aspect_ratios[mpeg_version-1][code]; + y4m_ratio_reduce(&ratio); + return ratio; + } + else + return y4m_sar_UNKNOWN; +} + + + +/* + * Look-up corresponding MPEG aspect ratio code given an exact aspect ratio. + * + * WARNING: The semantics of aspect ratio coding *changed* between + * MPEG1 and MPEG2. In MPEG1 it is the *pixel* aspect ratio. In + * MPEG2 it is the (far more sensible) aspect ratio of the eventual + * display. + * + */ + +mpeg_aspect_code_t +mpeg_frame_aspect_code( int mpeg_version, y4m_ratio_t aspect_ratio ) +{ + mpeg_aspect_code_t i; + y4m_ratio_t red_ratio = aspect_ratio; + y4m_ratio_reduce( &red_ratio ); + if( mpeg_version < 1 || mpeg_version > 2 ) + return 0; + /* (start at '1', because 0 is unknown/illegal) */ + for( i = 1; i < mpeg_num_aspect_ratios[mpeg_version-1]; ++i ) + { + y4m_ratio_t red_entry = mpeg_aspect_ratios[mpeg_version-1][i]; + y4m_ratio_reduce( &red_entry ); + if( Y4M_RATIO_EQL( red_entry, red_ratio) ) + return i; + } + + return 0; + +} + + + +/* + * Guess the correct MPEG aspect ratio code, + * given the true sample aspect ratio and frame size of a video stream + * (and the MPEG version, 1 or 2). + * + * Returns 0 if it has no good guess. + * + */ + + +/* this is big enough to accommodate the difference between 720 and 704 */ +#define GUESS_ASPECT_TOLERANCE 0.03 + +mpeg_aspect_code_t +mpeg_guess_mpeg_aspect_code(int mpeg_version, y4m_ratio_t sampleaspect, + int frame_width, int frame_height) +{ + if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_UNKNOWN)) + { + return 0; + } + switch (mpeg_version) { + case 1: + if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_SQUARE)) + { + return 1; + } + else if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_NTSC_CCIR601)) + { + return 12; + } + else if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_NTSC_16_9)) + { + return 6; + } + else if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_PAL_CCIR601)) + { + return 8; + } + else if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_PAL_16_9)) + { + return 3; + } + return 0; + break; + case 2: + if (Y4M_RATIO_EQL(sampleaspect, y4m_sar_SQUARE)) + { + return 1; /* '1' means square *pixels* in MPEG-2; go figure. */ + } + else + { + int i; + double true_far; /* true frame aspect ratio */ + true_far = + (double)(sampleaspect.n * frame_width) / + (double)(sampleaspect.d * frame_height); + /* start at '2'... */ + for (i = 2; i < (int)(mpeg_num_aspect_ratios[mpeg_version-1]); i++) + { + double ratio = + true_far / Y4M_RATIO_DBL(mpeg_aspect_ratios[mpeg_version-1][i]); + if ( (ratio > (1.0 - GUESS_ASPECT_TOLERANCE)) && + (ratio < (1.0 + GUESS_ASPECT_TOLERANCE)) ) + return i; + } + return 0; + } + break; + default: + return 0; + break; + } +} + + + + +/* + * Guess the true sample aspect ratio of a video stream, + * given the MPEG aspect ratio code and the actual frame size + * (and the MPEG version, 1 or 2). + * + * Returns y4m_sar_UNKNOWN if it has no good guess. + * + */ +y4m_ratio_t +mpeg_guess_sample_aspect_ratio(int mpeg_version, + mpeg_aspect_code_t code, + int frame_width, int frame_height) +{ + switch (mpeg_version) + { + case 1: + /* MPEG-1 codes turn into SAR's, just not quite the right ones. + For the common/known values, we provide the ratio used in practice, + otherwise say we don't know.*/ + switch (code) + { + case 1: return y4m_sar_SQUARE; break; + case 3: return y4m_sar_PAL_16_9; break; + case 6: return y4m_sar_NTSC_16_9; break; + case 8: return y4m_sar_PAL_CCIR601; break; + case 12: return y4m_sar_NTSC_CCIR601; break; + default: + return y4m_sar_UNKNOWN; break; + } + break; + case 2: + /* MPEG-2 codes turn into Display Aspect Ratios, though not exactly the + DAR's used in practice. For common/standard frame sizes, we provide + the original SAR; otherwise, we say we don't know. */ + if (code == 1) + { + return y4m_sar_SQUARE; /* '1' means square *pixels* in MPEG-2 */ + } + else if ((code >= 2) && (code <= 4)) + { + return y4m_guess_sar(frame_width, frame_height, + mpeg2_aspect_ratios[code]); + } + else + { + return y4m_sar_UNKNOWN; + } + break; + default: + return y4m_sar_UNKNOWN; + break; + } +} + + + + + +/* + * Look-up MPEG explanatory definition string for frame rate code + * + */ + + +const char * +mpeg_framerate_code_definition( mpeg_framerate_code_t code ) +{ + if( code == 0 || code >= mpeg_num_framerates ) + return "UNDEFINED: illegal/reserved frame-rate ratio code"; + + return framerate_definitions[code]; +} + +/* + * Look-up MPEG explanatory definition string aspect ratio code for an + * aspect ratio code + * + */ + +const char * +mpeg_aspect_code_definition( int mpeg_version, mpeg_aspect_code_t code ) +{ + if( mpeg_version < 1 || mpeg_version > 2 ) + return "UNDEFINED: illegal MPEG version"; + + if( code < 1 || code >= mpeg_num_aspect_ratios[mpeg_version-1] ) + return "UNDEFINED: illegal aspect ratio code"; + + return aspect_ratio_definitions[mpeg_version-1][code]; +} + + +/* + * Look-up explanatory definition of interlace field order code + * + */ + +const char * +mpeg_interlace_code_definition( int yuv4m_interlace_code ) +{ + const char *def; + switch( yuv4m_interlace_code ) + { + case Y4M_UNKNOWN : + def = "unknown"; + break; + case Y4M_ILACE_NONE : + def = "none/progressive"; + break; + case Y4M_ILACE_TOP_FIRST : + def = "top-field-first"; + break; + case Y4M_ILACE_BOTTOM_FIRST : + def = "bottom-field-first"; + break; + default : + def = "UNDEFINED: illegal video interlacing type-code!"; + break; + } + return def; +} + +/* + * Look-up explanatory definition of mjepgtools preset format code + * + */ +const char *mpeg_format_code_defintion( int format_code ) +{ + if(format_code >= MPEG_FORMAT_FIRST && format_code <= MPEG_FORMAT_LAST ) + return mjpegtools_format_code_definitions[format_code]; + else + return "UNDEFINED: illegal format code!"; +}; + +/* + * Local variables: + * c-file-style: "stroustrup" + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/veejay-current/reloaded-gtk3/src/mpegconsts.h b/veejay-current/reloaded-gtk3/src/mpegconsts.h new file mode 100644 index 00000000..3e9543d1 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mpegconsts.h @@ -0,0 +1,170 @@ + +/* + * mpegconsts.c: Video format constants for MPEG and utilities for display + * and conversion to format used for yuv4mpeg + * + * Copyright (C) 2001 Andrew Stevens + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __MPEGCONSTS_H__ +#define __MPEGCONSTS_H__ + +#include + +typedef unsigned int mpeg_framerate_code_t; +typedef unsigned int mpeg_aspect_code_t; + +#ifdef __cplusplus +#define START_CPP_WRAP extern "C" { +#define END_CPP_WRAP }; +#else +#define START_CPP_WRAP +#define END_CPP_WRAP +#endif + +START_CPP_WRAP + + +/* + * Convert MPEG frame-rate code to corresponding frame-rate + * y4m_fps_UNKNOWN = { 0, 0 } = Undefined/resrerved code. + */ + +y4m_ratio_t +mpeg_framerate( mpeg_framerate_code_t code ); + + +/* + * Is code a valid MPEG frame-rate code? + * Return 1 if true; 0 otherwise. + */ + +int +mpeg_valid_framerate_code( mpeg_framerate_code_t code ); + + +/* + * Look-up MPEG frame rate code for a (exact) frame rate. + * 0 = No MPEG code defined for frame-rate + */ + +mpeg_framerate_code_t +mpeg_framerate_code( y4m_ratio_t framerate ); + + +/* + * Convert floating-point framerate to an exact ratio. + * Uses a standard MPEG rate, if it finds one within MPEG_FPS_TOLERANCE + * (see mpegconsts.c), otherwise uses "fps:1000000" as the ratio. + */ + +y4m_ratio_t +mpeg_conform_framerate( double fps ); + +/* + * Convert MPEG aspect ratio code to corresponding aspect ratio + * + * WARNING: The semantics of aspect ratio coding *changed* between + * MPEG1 and MPEG2. In MPEG1 it is the *pixel* aspect ratio. In + * MPEG2 it is the (far more sensible) aspect ratio of the eventual + * display. + * + */ + +y4m_ratio_t +mpeg_aspect_ratio( int mpeg_version, mpeg_aspect_code_t code ); + + +/* + * Is code a valid MPEG(1,2) aspect-ratio code? + * Return 1 if true; 0 otherwise. + */ + +int +mpeg_valid_aspect_code( int mpeg_version, mpeg_aspect_code_t code ); + + +/* + * Look-up MPEG aspect ratio code for an aspect ratio - tolerance + * is Y4M_ASPECT_MULT used by YUV4MPEG (see yuv4mpeg_intern.h) + * + * WARNING: The semantics of aspect ratio coding *changed* between + * MPEG1 and MPEG2. In MPEG1 it is the *pixel* aspect ratio. In + * MPEG2 it is the (far more sensible) aspect ratio of the eventual + * display. + * + */ + +mpeg_aspect_code_t +mpeg_frame_aspect_code( int mpeg_version, y4m_ratio_t aspect_ratio ); + +/* + * Look-up MPEG explanatory definition string aspect ratio code for an + * aspect ratio code + * + */ + +const char * +mpeg_aspect_code_definition( int mpeg_version, mpeg_aspect_code_t code ); + +/* + * Look-up MPEG explanatory definition string aspect ratio code for an + * frame rate code + * + */ + +const char * +mpeg_framerate_code_definition( mpeg_framerate_code_t code ); + +const char * +mpeg_interlace_code_definition( int yuv4m_interlace_code ); + + +/* + * Guess the correct MPEG aspect ratio code, + * given the true sample aspect ratio and frame size of a video stream + * (and the MPEG version, 1 or 2). + * + * Returns 0 if it has no good answer. + * + */ +mpeg_aspect_code_t +mpeg_guess_mpeg_aspect_code(int mpeg_version, y4m_ratio_t sampleaspect, + int frame_width, int frame_height); + +/* + * Guess the true sample aspect ratio of a video stream, + * given the MPEG aspect ratio code and the actual frame size + * (and the MPEG version, 1 or 2). + * + * Returns y4m_sar_UNKNOWN if it has no good answer. + * + */ +y4m_ratio_t +mpeg_guess_sample_aspect_ratio(int mpeg_version, + mpeg_aspect_code_t code, + int frame_width, int frame_height); + +/* + * Look-up MJPEGTOOLS MPEG preset format code explanatory definition string a + * + */ +const char *mpeg_format_code_defintion( int format_code ); + +END_CPP_WRAP + +#endif /* __MPEGCONSTS_H__ */ diff --git a/veejay-current/reloaded-gtk3/src/mpegtimecode.c b/veejay-current/reloaded-gtk3/src/mpegtimecode.c new file mode 100644 index 00000000..09986739 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mpegtimecode.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2001 Kawamata/Hitoshi + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include "mpegtimecode.h" + +/************************************************************** + * // NTSC DROP FRAME TIMECODE / 29.97fps (SMTPE) + * // hh:mm:ss:ff + * // hh: 0.. + * // mm: 0..59 + * // ss: 0..59 + * // ff: 0..29 # ss != 0 || mm % 10 == 0 + * // 2..29 # ss == 0 && mm % 10 != 0 + * // + * // 00:00:00:00 00:00:00:01 00:00:00:02 ... 00:00:00:29 + * // 00:00:01:00 00:00:01:01 00:00:01:02 ... 00:00:01:29 + * // : + * // 00:00:59:00 00:00:59:01 00:00:59:02 ... 00:00:59:29 + * // 00:01:00:02 ... 00:01:00:29 + * // 00:01:01:00 00:01:01:01 00:01:01:02 ... 00:01:00:29 + * // : + * // 00:01:59:00 00:01:59:01 00:01:59:02 ... 00:01:59:29 + * // 00:02:00:02 ... 00:02:00:29 + * // 00:02:01:00 00:02:01:01 00:02:01:02 ... 00:02:00:29 + * // : + * // : + * // 00:09:59:00 00:09:59:01 00:09:59:02 ... 00:09:59:29 + * // 00:10:00:00 00:10:00:01 00:10:00:02 ... 00:10:00:29 + * // 00:10:01:00 00:10:01:01 00:10:01:02 ... 00:10:01:29 + * // : + * // 00:10:59:00 00:10:59:01 00:10:59:02 ... 00:10:59:29 + * // 00:11:00:02 ... 00:11:00:29 + * // 00:11:01:00 00:11:01:01 00:11:01:02 ... 00:11:00:29 + * // : + * // : + * // DROP FRAME / 59.94fps (no any standard) + * // DROP FRAME / 23.976fps (no any standard) + ***************************************************************/ + +int dropframetimecode = -1; + +/* mpeg_timecode() return -tc->f on first frame in the minute, tc->f on other. */ +int +mpeg_timecode(MPEG_timecode_t *tc, int f, int fpscode, double fps) +{ + static const int ifpss[] = { 0, 24, 24, 25, 30, 30, 50, 60, 60, }; + int h, m, s; + + if (dropframetimecode < 0) { + char *env = getenv("MJPEG_DROP_FRAME_TIME_CODE"); + dropframetimecode = (env && *env != '0' && *env != 'n' && *env != 'N'); + } + if (dropframetimecode && + 0 < fpscode && fpscode + 1 < sizeof ifpss / sizeof ifpss[0] && + ifpss[fpscode] == ifpss[fpscode + 1]) { + int topinmin = 0, k = (30*4) / ifpss[fpscode]; + f *= k; /* frame# when 119.88fps */ + h = (f / ((10*60*30-18)*4)); /* # of 10min. */ + f %= ((10*60*30-18)*4); /* frame# in 10min. */ + f -= (2*4); /* frame# in 10min. - (2*4) */ + m = (f / ((60*30-2)*4)); /* min. in 10min. */ + topinmin = ((f - k) / ((60*30-2)*4) < m); + m += (h % 6 * 10); /* min. */ + h /= 6; /* hour */ + f %= ((60*30-2)*4); /* frame# in min. - (2*4)*/ + f += (2*4); /* frame# in min. */ + s = f / (30*4); /* sec. */ + f %= (30*4); /* frame# in sec. */ + f /= k; /* frame# in sec. on original fps */ + tc->f = f; + if (topinmin) + f = -f; + } else { + int ifps = ((0 < fpscode && fpscode < sizeof ifpss / sizeof ifpss[0])? + ifpss[fpscode]: (int)(fps + .5)); + s = f / ifps; + f %= ifps; + m = s / 60; + s %= 60; + h = m / 60; + m %= 60; + tc->f = f; + } + tc->s = s; + tc->m = m; + tc->h = h; + return f; +} diff --git a/veejay-current/reloaded-gtk3/src/mpegtimecode.h b/veejay-current/reloaded-gtk3/src/mpegtimecode.h new file mode 100644 index 00000000..e702a9b7 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/mpegtimecode.h @@ -0,0 +1,39 @@ +/* -*- mode:C -*- */ +/* + * Copyright (C) 2001 Kawamata/Hitoshi + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __MPEGTIMECODE_H__ +#define __MPEGTIMECODE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + char h, m, s, f; +} MPEG_timecode_t; + +extern int dropframetimecode; +extern int mpeg_timecode(MPEG_timecode_t *tc, int f, int fpscode, double fps); +/* mpeg_timecode() return -tc->f on first frame in the minute, tc->f on other. */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/veejay-current/reloaded-gtk3/src/multitrack.c b/veejay-current/reloaded-gtk3/src/multitrack.c new file mode 100644 index 00000000..5a181dda --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/multitrack.c @@ -0,0 +1,1131 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2006 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sequence.h" +#include "tracksources.h" + +#define SEQ_BUTTON_CLOSE 0 +#define SEQ_BUTTON_RULE 1 + +#include +#include +#include +#include +#include +#define __MAX_TRACKS 64 +#define RUP8(num)(num/8*8) + +typedef struct +{ + GtkWidget *event_box; + GtkWidget *frame; + GtkWidget *main_vbox; + GtkWidget *panel; + GtkWidget *hbox; + GtkWidget *area; + GtkWidget *sub_frame; + GtkWidget *sub_hbox; + GtkWidget *toggle; + GtkWidget *buttons[8]; + GtkWidget *icons[8]; + GtkWidget *button_box; + GtkWidget *timeline_; + GtkWidget *labels_[4]; + GtkWidget *sliders_[4]; + GtkWidget *button_box2; + GtkWidget *buttons2[8]; + void *tracks; + gint dim[2]; + int num; + int status_lock; + void *backlink; + int status_cache[32]; + int history[4][32]; +} sequence_view_t; + +typedef struct +{ + sequence_view_t **view; + void *preview; + GtkWidget *main_window; + GtkWidget *main_box; + GtkWidget *status_bar; + GtkWidget *scroll; + void *data; + int selected; + int sensitive; + float fps; + float aspect_ratio; + int width; + int height; + int master_track; + GdkPixbuf *logo; + GtkWidget *preview_toggle; + int pw; + int ph; +} multitracker_t; + +static int MAX_TRACKS = 8; /* MASTER (current) + Track 1 to 6 */ +static void *parent__ = NULL; + +static char *mt_new_connection_dialog(multitracker_t *mt, int *port_num, int *error); +static void add_buttons( sequence_view_t *p, sequence_view_t *seqv , GtkWidget *w); +static void add_buttons2( sequence_view_t *p, sequence_view_t *seqv , GtkWidget *w); +static sequence_view_t *new_sequence_view( void *vp, int num ); +static void update_pos( void *data, gint total, gint current ); +static gboolean seqv_mouse_press_event ( GtkWidget *w, GdkEventButton *event, gpointer user_data); + +extern GdkPixbuf *vj_gdk_pixbuf_scale_simple( GdkPixbuf *src, int dw, int dh, GdkInterpType inter_type ); +extern void gtk_widget_set_size_request__( GtkWidget *w, gint iw, gint h, const char *f, int line ); + +#define gtk_widget_set_size_request_(a,b,c) gtk_widget_set_size_request(a,b,c) + +int mt_set_max_tracks(int mt) +{ + if( mt < 0 || mt > __MAX_TRACKS) + return 0; + MAX_TRACKS = mt; + return 1; +} + +int mt_get_max_tracks() +{ + return __MAX_TRACKS; +} +#define gtk_widget_set_sensitive_( w,p ) gtk_widget_set_sensitive(w,p) +#define gtk_image_set_from_pixbuf_(w,p) gtk_image_set_from_pixbuf(w,p) +static void status_print(multitracker_t *mt, const char format[], ... ) +{ + char buf[1024]; + va_list args; + va_start(args,format); + vsnprintf( buf,sizeof(buf), format, args ); + gsize nr,nw; + gchar *text = g_locale_to_utf8( buf, -1, &nr, &nw, NULL ); + text[strlen(text)-1] = '\0'; + gtk_statusbar_push( GTK_STATUSBAR(mt->status_bar), 0, text); + g_free(text); + va_end(args); +} + +static GdkPixbuf *load_logo_image(int dw, int dh ) +{ + char path[1024]; + veejay_memset(path,0,sizeof(path)); + get_gd(path,NULL, "veejay-logo.png"); + return gdk_pixbuf_new_from_file( path,NULL ); +} + +void multitrack_get_preview_dimensions( int w , int h, int *dst_w, int *dst_h ) +{ + int tmp_w = w; + int tmp_h = h; + + float ratio = (float)tmp_w / (float) tmp_h; + + if( tmp_h > MAX_PREVIEW_HEIGHT ) { + tmp_h = MAX_PREVIEW_HEIGHT; + tmp_w = (int) ( (float) tmp_h * ratio ); + } + if( tmp_w > MAX_PREVIEW_WIDTH ) { + tmp_w = MAX_PREVIEW_WIDTH; + tmp_h = tmp_w / ratio; + } + + *dst_w = RUP8(tmp_w); + *dst_h = RUP8(tmp_h); +} + +static void calculate_img_dimension(int w, int h, int *dst_w, int *dst_h, float *result, int max_w, int max_h, int quality) +{ + int tmp_w = w; + int tmp_h = h; + + float ratio = (float)tmp_w / (float) tmp_h; + *result = ratio; + + if( quality > 0 ) { + int qdown = quality; + while( (qdown > 0) ) { + tmp_h = tmp_h / 2; + tmp_w = tmp_w / 2; + qdown--; + } + } + + if( tmp_h > max_h ) { + tmp_h = max_h; + tmp_w = (int) ( (float) tmp_h * ratio ); + } else if( tmp_w > max_w ) { + tmp_w = max_w; + tmp_h = tmp_w / ratio; + } + + *dst_w = RUP8(tmp_w); + *dst_h = RUP8(tmp_h); +} + + +int multitrack_get_sequence_view_id( void *data ) +{ + sequence_view_t *s = (sequence_view_t*) data; + return s->num; +} + +void multitrack_sync_start(void *data) +{ + multitracker_t *mt = (multitracker_t*)data; + gvr_queue_vims( mt->preview,-1,VIMS_VIDEO_PLAY_STOP ); + gvr_queue_vims( mt->preview,-1,VIMS_VIDEO_GOTO_START ); + gvr_queue_vims( mt->preview,-1,VIMS_VIDEO_PLAY_FORWARD ); +} + +void multitrack_sync_simple_cmd( void *data, int vims, int arg ) +{ + multitracker_t *mt = (multitracker_t*)data; + gvr_queue_vims(mt->preview,-1, vims); +} + +void multitrack_sync_simple_cmd2( void *data, int vims, int arg ) +{ + multitracker_t *mt = (multitracker_t*)data; + gvr_queue_mvims(mt->preview,-1, vims, arg); +} + + +static void seq_gotostart(GtkWidget *w, gpointer data ) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_GOTO_START ); +} + +static void seq_reverse(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_PLAY_BACKWARD ); +} + +static void seq_pause(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_PLAY_STOP ); +} + +static void seq_play( GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_PLAY_FORWARD ); +} + +static void seq_gotoend(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_GOTO_END ); +} + +static void seq_speeddown(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gint n = v->status_cache[ SAMPLE_SPEED ]; + + if( n < 0 ) n += 1; + if( n > 0 ) n -= 1; + gvr_queue_mvims( mt->preview, v->num ,VIMS_VIDEO_SET_SPEED , n ); +} + +static void seq_speedup(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gint n = v->status_cache[ SAMPLE_SPEED ]; + + if( n < 0 ) n -= 1; + if( n > 0 ) n += 1; + gvr_queue_mvims( mt->preview, v->num ,VIMS_VIDEO_SET_SPEED , n ); +} + +static void seq_prevframe(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_PREV_FRAME ); + +} + +static void seq_nextframe(GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = (multitracker_t*)v->backlink; + + gvr_queue_vims( mt->preview, v->num ,VIMS_VIDEO_SKIP_FRAME ); +} + +static void seq_speed( GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = v->backlink; + if(v->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gdouble value = gtk_adjustment_get_value (a); + gint speed = (gint) value; + gvr_queue_mvims( mt->preview, v->num ,VIMS_VIDEO_SET_SPEED , speed ); +} + +static void seq_opacity( GtkWidget *w, gpointer data) +{ + sequence_view_t *v = (sequence_view_t*) data; + multitracker_t *mt = v->backlink; + + if(v->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gdouble value = gtk_adjustment_get_value (a); + gint opacity = (gint)( value * 255.0); + gvr_queue_mmvims( mt->preview, v->num ,VIMS_CHAIN_MANUAL_FADE, 0, opacity); +} + + +static void update_pos( void *user_data, gint total, gint current ) +{ + sequence_view_t *v = (sequence_view_t*) user_data; + multitracker_t *mt = v->backlink; + if(v->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( v->timeline_ )); + gtk_adjustment_set_value (a, 1.0 / (gdouble) total * current ); + + char *now = format_time( current , mt->fps); + gtk_label_set_text( GTK_LABEL(v->labels_[0]), now ); + free(now); +} + +static void update_speed( void *user_data, gint speed ) +{ + sequence_view_t *v = (sequence_view_t*) user_data; + if(v->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( v->sliders_[0] )); + gtk_adjustment_set_value( a, (gdouble) speed ); +} + +#define FIRST_ROW_END 5 +static struct +{ + const char *name; + int vims_id; + const char *file; + void (*f)(); +} button_template_t[] = +{ + { "button_gotostart", VIMS_VIDEO_GOTO_START, "button_gotostart.png", seq_gotostart }, + { "button_reverse", VIMS_VIDEO_PLAY_BACKWARD, "button_reverse.png" , seq_reverse }, + { "button_pauseplay", VIMS_VIDEO_PLAY_STOP, "button_pause.png", seq_pause}, + { "button_play", VIMS_VIDEO_PLAY_FORWARD, "button_play.png", seq_play }, + { "button_gotoend", VIMS_VIDEO_GOTO_END, "button_gotoend.png",seq_gotoend }, + + { "button_speeddown", VIMS_VIDEO_SET_SPEED, "button_down.png", seq_speeddown }, + { "button_speedup", VIMS_VIDEO_SET_SPEED, "button_up.png", seq_speedup }, + { "button_prevframe", VIMS_VIDEO_PREV_FRAME, "button_prev.png", seq_prevframe }, + { "button_nextframe", VIMS_VIDEO_SKIP_FRAME, "button_skip.png", seq_nextframe }, + { NULL , 0 , NULL }, +}; + +static void add_buttons( sequence_view_t *p, sequence_view_t *seqv , GtkWidget *w) +{ + int i; + for( i = 0; i < FIRST_ROW_END;i ++ ) + { + char path[1024]; + veejay_memset(path,0,sizeof(path)); + get_gd(path,NULL, button_template_t[i].file ); + seqv->icons[i] = gtk_image_new_from_file( path ); + seqv->buttons[i] = gtk_button_new_with_label(" "); + gtk_widget_set_size_request_( seqv->icons[i],24,20 ); + gtk_button_set_image( GTK_BUTTON(seqv->buttons[i]), seqv->icons[i] ); + gtk_widget_set_size_request_( seqv->buttons[i],24,20 ); + gtk_box_pack_start( GTK_BOX(w), seqv->buttons[i], TRUE,TRUE, 0 ); + g_signal_connect( G_OBJECT( seqv->buttons[i] ), "clicked", G_CALLBACK( button_template_t[i].f), + (gpointer)p ); + gtk_widget_show( seqv->buttons[i] ); + + } +} + +static void add_buttons2( sequence_view_t *p, sequence_view_t *seqv , GtkWidget *w) +{ + int i; + for( i = FIRST_ROW_END; button_template_t[i].name != NULL ;i ++ ) + { + char path[1024]; + veejay_memset(path,0,sizeof(path)); + get_gd(path,NULL, button_template_t[i].file ); + seqv->icons[i] = gtk_image_new_from_file( path ); + seqv->buttons2[i] = gtk_button_new_with_label(" "); + gtk_widget_set_size_request_( seqv->icons[i],24,20 ); + + gtk_button_set_image( GTK_BUTTON(seqv->buttons2[i]), seqv->icons[i] ); + gtk_widget_set_size_request_( seqv->buttons2[i],24,20 ); + gtk_box_pack_start( GTK_BOX(w), seqv->buttons2[i], TRUE,TRUE, 0 ); + g_signal_connect( G_OBJECT( seqv->buttons2[i] ), "clicked", G_CALLBACK( button_template_t[i].f), + (gpointer*)p ); + gtk_widget_show( seqv->buttons2[i] ); + + } +} + + + +static void playmode_sensitivity( sequence_view_t *p, gint pm ) +{ + int i; + if( pm == MODE_STREAM || pm == MODE_PLAIN || pm == MODE_SAMPLE ) + { + if(p->num > 0) + gtk_widget_set_sensitive_( GTK_WIDGET( p->toggle ), TRUE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->panel ), TRUE ); + } + + if( pm == MODE_STREAM ) + { + gtk_widget_set_sensitive_( GTK_WIDGET( p->button_box2 ), FALSE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->button_box ), FALSE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->sliders_[0] ), FALSE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->timeline_ ), FALSE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->sliders_[1] ), TRUE ); + for( i = 0; i < FIRST_ROW_END;i ++ ) + { + gtk_widget_set_sensitive_( GTK_WIDGET( p->buttons[i] ), FALSE ); + + } + } + else + { + if( pm == MODE_SAMPLE || pm == MODE_PLAIN ) + { + gtk_widget_set_sensitive_( GTK_WIDGET( p->button_box2 ), TRUE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->button_box ), TRUE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->sliders_[0] ), TRUE ); + gtk_widget_set_sensitive_( GTK_WIDGET( p->timeline_ ), TRUE ); + for( i = 0; i < FIRST_ROW_END;i ++ ) + { + gtk_widget_set_sensitive_( GTK_WIDGET( p->buttons[i] ), TRUE ); + } + } + if( pm == MODE_SAMPLE ) + gtk_widget_set_sensitive_( GTK_WIDGET( p->sliders_[1] ), TRUE ); + else + gtk_widget_set_sensitive_( GTK_WIDGET( p->sliders_[1] ), FALSE ); + } +} + + +static void update_widgets(int *status, sequence_view_t *p, int pm) +{ + multitracker_t *mt = (multitracker_t*) p->backlink; + int *h = p->history[pm]; + if( h[PLAY_MODE] != pm ) + playmode_sensitivity( p, pm ); + + if( pm == MODE_STREAM ) + { + update_pos( p, status[TOTAL_FRAMES], 0 ); + update_speed( p, 1 ); + } + else + if( pm == MODE_SAMPLE || pm == MODE_PLAIN ) + { + if( h[FRAME_NUM] != status[FRAME_NUM] ) + update_pos( p, status[TOTAL_FRAMES],status[FRAME_NUM] ); + if( h[SAMPLE_SPEED] != status[SAMPLE_SPEED] ) + update_speed( p, status[SAMPLE_SPEED] ); + } + + if( h[TOTAL_SLOTS] != status[TOTAL_SLOTS]) + { + gvr_need_track_list( mt->preview, p->num ); + update_track_view( MAX_TRACKS, get_track_tree( p->tracks ), (void*)p ); + } +} + + +int update_multitrack_widgets( void *data, int *array, int track ) +{ + multitracker_t *mt = (multitracker_t*) data; + sequence_view_t *p = mt->view[ track ]; + + p->status_lock = 1; + int pm = array[PLAY_MODE]; + int i; + for( i = 0; i < 20; i ++ ) + p->status_cache[i] = array[i]; + update_widgets(array, p, pm); + + int *his = p->history[ pm ]; + for( i = 0; i < 20; i ++ ) + his[i] = array[i]; + p->status_lock = 0; + return 1; +} + +static void sequence_preview_size(multitracker_t *mt, int track_num) +{ + float ratio = 0.0f; + int tmp_w = 0; + int tmp_h = 0; + + calculate_img_dimension(mt->width,mt->height, &tmp_w, &tmp_h, &ratio, 160, 120,0); + if(!gvr_track_configure( mt->preview, track_num,tmp_w,tmp_h ) ) + { + veejay_msg(0, "Unable to configure preview %d x %d",tmp_w,tmp_h ); + } + +} + +static void sequence_preview_cb(GtkWidget *widget, gpointer user_data) +{ + sequence_view_t *v = (sequence_view_t*) user_data; + multitracker_t *mt = v->backlink; + int status = 0; + + if(v->status_lock) + return; + + if(v->num != mt->master_track ) + { + status = (gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ) == TRUE ? 1 : 0 ); + + gvr_track_toggle_preview( mt->preview, v->num,status ); + + sequence_preview_size( mt, v->num ); + + if( !status ) + gtk_image_clear( GTK_IMAGE(v->area ) ); + } +} + +static void sequence_set_current_frame(GtkWidget *w, gpointer user_data) +{ + + sequence_view_t *v = (sequence_view_t*) user_data; + multitracker_t *mt = v->backlink; + if(v->status_lock) + return; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gdouble pos = gtk_adjustment_get_value (a); + gint frame = pos * v->status_cache[TOTAL_FRAMES]; + + gvr_queue_mvims( mt->preview, v->num, VIMS_VIDEO_SET_FRAME, frame ); +} + +static sequence_view_t *new_sequence_view( void *vp, int num ) +{ + sequence_view_t *seqv = (sequence_view_t*) vj_calloc(sizeof(sequence_view_t)); + + seqv->num = num; + seqv->backlink = vp; + + seqv->event_box = gtk_event_box_new(); + gtk_event_box_set_visible_window( GTK_EVENT_BOX(seqv->event_box), TRUE ); + gtk_widget_set_can_focus(seqv->event_box, TRUE); + + g_signal_connect( G_OBJECT( seqv->event_box ), + "button_press_event", + G_CALLBACK( seqv_mouse_press_event ), + (gpointer*) seqv ); + gtk_widget_show( GTK_WIDGET( seqv->event_box ) ); + + + gchar *track_title = g_new0( gchar, 20 ); + sprintf(track_title, "Track %d", num ); + seqv->frame = gtk_frame_new( track_title ); + g_free(track_title); + + gtk_container_set_border_width( GTK_CONTAINER( seqv->frame) , 1 ); + gtk_widget_show( GTK_WIDGET( seqv->frame ) ); + gtk_container_add( GTK_CONTAINER( seqv->event_box), seqv->frame ); + + seqv->main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + gtk_container_add( GTK_CONTAINER( seqv->frame ), seqv->main_vbox ); + gtk_widget_show( GTK_WIDGET( seqv->main_vbox ) ); + + seqv->area = gtk_image_new(); + + + gtk_box_pack_start( GTK_BOX(seqv->main_vbox),GTK_WIDGET( seqv->area), FALSE,FALSE,0); + gtk_widget_set_size_request_( seqv->area, 176,144 ); //FIXME + seqv->panel = gtk_frame_new(NULL); + + seqv->toggle = gtk_toggle_button_new_with_label( "preview" ); + + if(num>0) { + gtk_toggle_button_set_active( + GTK_TOGGLE_BUTTON(seqv->toggle), FALSE ); + g_signal_connect( G_OBJECT( seqv->toggle ), "toggled", G_CALLBACK(sequence_preview_cb), + (gpointer)seqv ); + gtk_box_pack_start( GTK_BOX(seqv->main_vbox), seqv->toggle,FALSE,FALSE, 0 ); + + gtk_widget_set_sensitive_( GTK_WIDGET( seqv->toggle ), FALSE ); + + gtk_widget_show( seqv->toggle ); + } else { + gtk_box_pack_start( GTK_BOX(seqv->main_vbox), seqv->toggle,FALSE,FALSE, 0 ); + gtk_widget_show( seqv->toggle ); + gtk_widget_set_sensitive_( GTK_WIDGET( seqv->toggle ), FALSE ); + } + + GtkWidget *vvbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + seqv->button_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + gtk_box_pack_start( GTK_BOX(vvbox), seqv->button_box ,FALSE,FALSE, 0 ); + add_buttons( seqv,seqv,seqv->button_box ); + + gtk_widget_show( seqv->button_box ); + gtk_container_add( GTK_CONTAINER( seqv->main_vbox ), seqv->panel ); + + seqv->button_box2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_pack_start( GTK_BOX(vvbox), seqv->button_box2, FALSE,FALSE, 0 ); + add_buttons2( seqv,seqv,seqv->button_box2 ); + gtk_widget_show( seqv->button_box2 ); + gtk_container_add( GTK_CONTAINER( seqv->panel ), vvbox ); + gtk_widget_show(vvbox); + + GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + seqv->timeline_ = gtk_scale_new_with_range( GTK_ORIENTATION_HORIZONTAL, + 0.0, 1.0, 0.1); + gtk_scale_set_draw_value( GTK_SCALE(seqv->timeline_), FALSE ); + //gtk_widget_set_size_request_( seqv->panel,180 ,180); + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( seqv->timeline_ )); + gtk_adjustment_set_value( a , 0.0 ); + gtk_widget_show( seqv->panel ); + gtk_box_pack_start( GTK_BOX( box ), seqv->timeline_, FALSE,FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( vvbox ), box , FALSE,FALSE,0); + gtk_widget_show(seqv->timeline_); + g_signal_connect( seqv->timeline_, "value_changed", + (GCallback) sequence_set_current_frame, (gpointer*) seqv ); + + GtkWidget *scroll = gtk_scrolled_window_new(NULL,NULL); + gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_ETCHED_IN ); + gtk_widget_set_size_request_(scroll,30,140); + gtk_container_set_border_width(GTK_CONTAINER(scroll),0); + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll),GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC ); + GtkWidget *vvvbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + seqv->tracks = create_track_view(seqv->num, MAX_TRACKS, (void*) seqv ); + gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( get_track_tree(seqv->tracks)) , FALSE ); + gtk_widget_set_size_request_( get_track_tree(seqv->tracks),20,80 ); + gtk_widget_show(scroll); + + gtk_scrolled_window_add_with_viewport( + GTK_SCROLLED_WINDOW( scroll ), get_track_tree(seqv->tracks) ); + gtk_widget_show( get_track_tree(seqv->tracks)); + gtk_box_pack_start( GTK_BOX(vvvbox), scroll, TRUE,TRUE, 0); + + GtkWidget *hhbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + + seqv->sliders_[0] = gtk_scale_new_with_range( GTK_ORIENTATION_VERTICAL, + -12.0,12.0,1.0 ); + seqv->sliders_[1] = gtk_scale_new_with_range( GTK_ORIENTATION_VERTICAL, + 0.0, 1.0, 0.01 ); + + a = gtk_range_get_adjustment( GTK_RANGE( seqv->sliders_[0])); + gtk_adjustment_set_value( a, 1.0 ); + a = gtk_range_get_adjustment( GTK_RANGE( seqv->sliders_[1])); + gtk_adjustment_set_value( a, 0.0 ); + + + gtk_scale_set_digits( GTK_SCALE(seqv->sliders_[1]), 2 ); + g_signal_connect( G_OBJECT( seqv->sliders_[0] ), "value_changed", G_CALLBACK( seq_speed ), + (gpointer*)seqv ); + g_signal_connect( G_OBJECT( seqv->sliders_[1] ), "value_changed", G_CALLBACK( seq_opacity ), + (gpointer*)seqv ); + + gtk_box_pack_start( GTK_BOX( hhbox ), seqv->sliders_[0], TRUE, TRUE, 0 ); + gtk_box_pack_start( GTK_BOX( hhbox ), seqv->sliders_[1], TRUE, TRUE, 0 ); + gtk_widget_show( seqv->sliders_[0] ); + gtk_widget_show( seqv->sliders_[1] ); + gtk_box_pack_start( GTK_BOX(vvvbox), hhbox, TRUE,TRUE, 0 ); + gtk_widget_show( hhbox ); + gtk_container_add( GTK_CONTAINER( box ), vvvbox ); + gtk_widget_show( vvvbox ); + gtk_widget_show( box ); + + + GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + gtk_box_set_spacing( GTK_BOX(hbox), 10 ); + seqv->labels_[0] = gtk_label_new( "00:00:00:00" ); + seqv->labels_[1] = gtk_label_new( "00:00:00:00" ); + gtk_box_pack_start( GTK_BOX( hbox ), seqv->labels_[0], FALSE, FALSE, 0 ); + gtk_box_pack_start( GTK_BOX( hbox ), seqv->labels_[1], FALSE, FALSE, 0 ); + gtk_widget_show( seqv->labels_[0] ); + gtk_widget_show( seqv->labels_[1] ); + gtk_box_pack_start( GTK_BOX(seqv->main_vbox), hbox, FALSE,FALSE, 0 ); + gtk_widget_show( hbox ); + + + gtk_widget_set_sensitive_(GTK_WIDGET(seqv->panel), FALSE ); + + gtk_widget_show( GTK_WIDGET( seqv->area ) ); + + return seqv; +} + + +static int vt__[16]; +static int vt___ = 0; +void *multitrack_sync( void * mt ) +{ + multitracker_t *m = (multitracker_t*) mt; + sync_info *s = gvr_sync( m->preview ); + if(!s) + return NULL; + + if(!vt___) + { + veejay_memset(vt__,0,sizeof(vt__)); + vt___ = 1; + } + + int i; + for( i =0; i < MAX_TRACKS ;i ++ ) + { + if(!vt__[i] && s->status_list[i] == NULL ) + { + //gtk_widget_set_sensitive_(GTK_WIDGET(m->view[i]), FALSE ); + vt__[i] = 1; + } + else if( s->status_list[i] && vt__[i] ) + { + //gtk_widget_set_sensitive_(GTK_WIDGET(m->view[i]), TRUE ); + vt__[i] = 0; + } + } + s->master = m->master_track; + return (void*)s; +} + +static char *mt_new_connection_dialog(multitracker_t *mt, int *port_num, int *error) +{ + GtkWidget *dialog = gtk_dialog_new_with_buttons( + "Connect to a Veejay", + GTK_WINDOW( mt->main_window ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_REJECT, + GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, + NULL ); + + + GtkWidget *text_entry = gtk_entry_new(); + gtk_entry_set_text( GTK_ENTRY(text_entry), "localhost" ); + gtk_editable_set_editable( GTK_EDITABLE(text_entry), TRUE ); + gtk_dialog_set_default_response( GTK_DIALOG(dialog), GTK_RESPONSE_REJECT ); + gtk_window_set_resizable( GTK_WINDOW( dialog ), FALSE ); + + gint base = DEFAULT_PORT_NUM; + + gint p = (1000 * (mt->selected)) + base; + + GtkAdjustment *adj = gtk_adjustment_new( p,1024,65535,5,10,0); + GtkWidget *num_entry = gtk_spin_button_new( GTK_ADJUSTMENT(adj), 5.0, 0 ); + + GtkWidget *text_label = gtk_label_new( "Hostname" ); + GtkWidget *num_label = gtk_label_new( "Port" ); + g_signal_connect( G_OBJECT(dialog), "response", + G_CALLBACK( gtk_widget_hide ), G_OBJECT( dialog ) ); + + GtkWidget *vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 4 ); + gtk_container_add( GTK_CONTAINER( vbox ), text_label ); + gtk_container_add( GTK_CONTAINER( vbox ), text_entry ); + gtk_container_add( GTK_CONTAINER( vbox ), num_label ); + gtk_container_add( GTK_CONTAINER( vbox ), num_entry ); + GtkWidget* content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_add( GTK_CONTAINER (content_area), vbox ); + gtk_widget_show_all( dialog ); + + gint res = gtk_dialog_run( GTK_DIALOG(dialog) ); + + if( res == GTK_RESPONSE_ACCEPT ) + { + const char *host = gtk_entry_get_text( GTK_ENTRY( text_entry ) ); + gint port = gtk_spin_button_get_value( GTK_SPIN_BUTTON(num_entry )); + *port_num = port; + *error = 0; + return strdup(host); + } + + gtk_widget_destroy( dialog ); + + *error = res; + *port_num = 0; + return NULL; +} + +void *multitrack_new( + void (*f)(int,char*,int), + int (*g)(GdkPixbuf *, GdkPixbuf *, GtkImage *), + GtkWidget *win, + GtkWidget *box, + GtkWidget *msg, + GtkWidget *preview_toggle, + gint max_w, + gint max_h, + GtkWidget *main_preview_area, //FIXME Not used + void *infog, + int threads) +{ + multitracker_t *mt = (multitracker_t*) vj_calloc(sizeof(multitracker_t)); + mt->view = (sequence_view_t**) vj_calloc(sizeof(sequence_view_t*) * MAX_TRACKS ); + mt->preview = NULL; + mt->main_window = win; + mt->main_box = box; + mt->status_bar = msg; + mt->logo = load_logo_image(0,0); + mt->preview_toggle = preview_toggle; + mt->scroll = gtk_scrolled_window_new(NULL,NULL); +// gtk_widget_set_size_request(mt->scroll,50+max_w*2, max_h); + gtk_container_set_border_width(GTK_CONTAINER(mt->scroll),1); + gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(mt->scroll),GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + GtkWidget *grid = gtk_grid_new(); + + gtk_box_pack_start( GTK_BOX( mt->main_box ), mt->scroll , TRUE,TRUE, 0 ); + gtk_widget_show(mt->scroll); + int c = 0; + for( c = 0; c < MAX_TRACKS; c ++ ) + { + mt->view[c] = new_sequence_view( mt, c ); + gtk_grid_attach( GTK_GRID(grid), mt->view[c]->event_box, c, 0, 1, 1 ); + } + + gtk_scrolled_window_add_with_viewport( + GTK_SCROLLED_WINDOW( mt->scroll ), grid ); + + gtk_widget_show(grid); + + mt->master_track = 0; + + mt->preview = gvr_preview_init( MAX_TRACKS, threads ); +// gvr_set_master( mt->preview, mt->master_track ); + + + parent__ = infog; + + return (void*) mt; +} + + +int multitrack_add_track( void *data ) +{ + multitracker_t *mt = (multitracker_t*) data; + int res = 0; + int port_num = 0; + int error = 0; + + char *hostname = mt_new_connection_dialog( mt,&port_num,&error ); + if( error || hostname == NULL ) { + return res; + } + + int track = 0; + + if( gvr_track_connect( mt->preview, hostname, port_num, &track ) ) + { + status_print( mt, "Connection established with veejay runnning on %s port %d", hostname, port_num ); + if( gveejay_user_preview() ) + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(mt->view[track]->toggle), TRUE ); + gtk_widget_set_sensitive_(GTK_WIDGET(mt->view[track]->panel), TRUE ); + gtk_widget_set_sensitive_(GTK_WIDGET(mt->view[track]->toggle), TRUE ); + + res = 1; + } + else + { + status_print( mt, "Unable to open connection with %s : %d", hostname, port_num ); + } + + free( hostname ); + + return res; +} + +void multitrack_close_track( void *data ) +{ + multitracker_t *mt = (multitracker_t*) data; + + if( mt->selected > 0 && mt->selected < MAX_TRACKS ) + { + gvr_track_disconnect( mt->preview, mt->selected ); + mt->view[mt->selected]->status_lock = 1; + gtk_toggle_button_set_active( + GTK_TOGGLE_BUTTON(mt->view[mt->selected]->toggle), FALSE ); + gtk_widget_set_sensitive_(GTK_WIDGET(mt->view[mt->selected]->panel), FALSE ); + gtk_widget_set_sensitive_(GTK_WIDGET(mt->view[mt->selected]->toggle), FALSE ); + gtk_image_clear( GTK_IMAGE(mt->view[mt->selected]->area ) ); + mt->view[mt->selected]->status_lock = 0; + } +} + +void multitrack_disconnect(void *data) +{ + multitracker_t *mt = (multitracker_t*) data; + //release connection to veejay + gvr_track_disconnect( mt->preview, 0 ); +} + +int multrack_audoadd( void *data, char *hostname, int port_num ) +{ + multitracker_t *mt = (multitracker_t*) data; + + int track = 0; + + if(!gvr_track_connect( mt->preview, hostname, port_num, &track ) ) + { + if(!gvr_track_already_open( mt->preview, hostname,port_num)) + return -1; + } + + if(mt->pw > 0 && mt->ph > 0 ) + { + //sequence_preview_size( mt, mt->master_track ); + + /* configure master preview size */ + if(!gvr_track_configure( mt->preview, track, mt->pw,mt->ph) ) + { + veejay_msg(0, "Unable to configure preview %d x %d",mt->pw , mt->ph ); + } + + + int preview = gvr_get_preview_status( mt->preview, mt->master_track ); + + /* set status of preview toggle button in trackview */ + if( track == 0 ) + { + // mt->view[track]->status_lock=1; + // gtk_toggle_button_set_active( + // GTK_TOGGLE_BUTTON( mt->preview_toggle), (preview ? TRUE: FALSE ) ); + // mt->view[track]->status_lock=0; + } + else + { + mt->view[track]->status_lock=1; + gtk_toggle_button_set_active( + GTK_TOGGLE_BUTTON( mt->view[track]->toggle ), (preview ? TRUE: FALSE ) ); + mt->view[track]->status_lock=0; + + } + } + +// mt->master_track = track; + gvr_set_master( mt->preview, track ); + + gtk_widget_set_sensitive_(GTK_WIDGET(mt->view[track]->panel), TRUE ); + + + return track; +} + +int multitrack_locked( void *data) +{ + multitracker_t *mt = (multitracker_t*) data; + + return mt->view[mt->master_track]->status_lock; +} + +void multitrack_configure( void *data, float fps, int video_width, int video_height, int *box_w, int *box_h ) +{ + multitracker_t *mt = (multitracker_t*) data; + mt->fps = fps; + + calculate_img_dimension(video_width,video_height,&(mt->width),&(mt->height),&(mt->aspect_ratio),vj_get_preview_box_w(),vj_get_preview_box_h(),-1); + + *box_w = mt->width; + *box_h = mt->height; + + veejay_msg(VEEJAY_MSG_DEBUG, "Multitrack %d x %d, %2.2f, ratio %f", mt->width,mt->height,mt->fps,mt->aspect_ratio); +} + +void multitrack_set_quality( void *data , int quality ) +{ + multitracker_t *mt = (multitracker_t*) data; + float ratio = 0.0f; + int w = 0; + int h = 0; + + calculate_img_dimension(mt->width,mt->height,&w,&h,&ratio,vj_get_preview_box_w(),vj_get_preview_box_h(),quality); + + veejay_msg(VEEJAY_MSG_DEBUG, + "Preview image dimensions changed to %d x %d",w,h); + + if(!gvr_track_configure( mt->preview, mt->master_track,w,h ) ) + { + veejay_msg(0, "Unable to configure preview %d x %d",w , h ); + } + + mt->pw = w; + mt->ph = h; +} + +void multitrack_set_logo(void *data , GtkWidget *img) +{ + multitracker_t *mt = (multitracker_t*) data; + gtk_image_set_from_pixbuf_( GTK_IMAGE(img), mt->logo ); +} + +void multitrack_toggle_preview( void *data, int track_id, int status, GtkWidget *img ) +{ + multitracker_t *mt = (multitracker_t*) data; + if(track_id == -1 ) + { + gvr_track_toggle_preview( mt->preview, mt->master_track, status ); + veejay_msg(VEEJAY_MSG_INFO, "VeejayGrabber: master preview %s", (status ? "enabled" : "disabled") ); + if( status == 0 ) + multitrack_set_logo( data, img ); + } +} + +void multitrack_release_track(void *data, int id, int release_this ) +{ + multitracker_t *mt = (multitracker_t*) data; + int stream_id = 0; + + //release this: track um + + stream_id = gvr_get_stream_id( mt->preview, release_this ); + if(stream_id > 0) + gvr_queue_mvims( mt->preview, id, VIMS_STREAM_DELETE,stream_id ); +} + +void multitrack_bind_track( void *data, int id, int bind_this ) +{ + multitracker_t *mt = (multitracker_t*) data; + + if( bind_this < 0 || bind_this > MAX_TRACKS ) + return; + + if( id < 0 || id > MAX_TRACKS ) + return; + + char *host = gvr_track_get_hostname( mt->preview, bind_this ); + int port = gvr_track_get_portnum ( mt->preview, bind_this ); + + if( host != NULL && port > 0 ) + gvr_queue_cxvims( mt->preview, id, VIMS_STREAM_NEW_UNICAST, port, (unsigned char*)host ); +} + +void multitrack_update_sequence_image( void *data , int track, GdkPixbuf *img ) +{ + multitracker_t *mt = (multitracker_t*) data; + float ratio = 0.0f; + int w = 0; + int h = 0; + + calculate_img_dimension(mt->width,mt->height, &w, &h, &ratio, 160, 120,0); + + GdkPixbuf *scaled = vj_gdk_pixbuf_scale_simple( img, w, h, GDK_INTERP_BILINEAR ); + gtk_image_set_from_pixbuf( GTK_IMAGE(mt->view[track]->area), scaled); + + g_object_unref( scaled ); +} + +/*! \brief Multi track sequence view button_press_event callback. + * + * \sa new_sequence_view + * + * \param w A pointer of calling widget + * \param event A pointer of the current event + * \param user_data A pointer of the current \c sequence_view_t + * \return Always \c FALSE to propagate the event. + */ +static gboolean seqv_mouse_press_event ( GtkWidget *w, GdkEventButton *event, gpointer user_data ) +{ + sequence_view_t *v = (sequence_view_t*) user_data; + multitracker_t *mt = v->backlink; + + if(event->type == GDK_BUTTON_PRESS) + { + if( !gvr_track_test( mt->preview , v->num ) ) + return FALSE; + + int last_selected = mt->selected; + mt->selected = v->num; + vj_gui_disable(); + + // hostname, port_num from gvr + char *host = gvr_track_get_hostname( mt->preview, v->num ); + int port = gvr_track_get_portnum ( mt->preview, v->num ); + + if(!host || port <= 0 ) + { + vj_gui_enable(); + return FALSE; + } + + vj_gui_cb( 0, host, port ); + + gvr_set_master( mt->preview, v->num ); + if(!gvr_track_configure( mt->preview, v->num, mt->pw,mt->ph) ) + { + veejay_msg(0, "Unable to configure preview %d x %d",mt->pw , mt->ph ); + } + veejay_msg(VEEJAY_MSG_INFO, "Set master to track %d", mt->master_track ); + mt->master_track = v->num; + if( last_selected >= 0 && last_selected < MAX_TRACKS ) + { + gtk_widget_set_state_flags( mt->view[last_selected]->event_box, + GTK_STATE_FLAG_NORMAL, TRUE); + } + gtk_widget_set_state_flags(w, GTK_STATE_FLAG_SELECTED, TRUE); + + vj_gui_enable(); + } + return FALSE; +} diff --git a/veejay-current/reloaded-gtk3/src/multitrack.h b/veejay-current/reloaded-gtk3/src/multitrack.h new file mode 100644 index 00000000..0b9cec78 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/multitrack.h @@ -0,0 +1,31 @@ +#ifndef MTRACK_H +#define MTRACK_H + +void *multitrack_new( + void (*f)(int,char*,int), + int (*g)(GdkPixbuf *, GdkPixbuf *, GtkImage *), + GtkWidget *win,GtkWidget *box,GtkWidget *msg,GtkWidget *button, + gint max_w,gint max_h, + GtkWidget *main_preview_area,void *gui,int threads); +void multitrack_disconnect(void *data); +void multitrack_set_logo(void *data , GtkWidget *img); +int multitrack_add_track( void *data ); +void multitrack_close_track( void *data ); +int multrack_audoadd( void *data, char *hostname, int port_num ); +void multitrack_release_track(void *data, int id, int release_this ); +void multitrack_bind_track( void *data, int id, int bind_this ); +void multitrack_sync_simple_cmd2( void *data, int vims, int arg ); +void *multitrack_sync( void * mt ); +void multitrack_configure( void *data, float fps, int video_width, int video_height, int *bw, int *bh ); +void multitrack_get_preview_dimensions( int w , int h, int *dst_w, int *dst_h ); +void multitrack_update_sequence_image( void *data , int track, GdkPixbuf *img ); +int update_multitrack_widgets( void *data, int *array, int track ); +int multitrack_locked( void *data); +void multitrack_toggle_preview( void *data, int track_id, int status, GtkWidget *img ); +void multitrack_set_quality( void *data , int quality ); +void multitrack_sync_start(void *data); +void multitrack_sync_simple_cmd( void *data, int vims, int arg ); +void multitrack_resize( void *m , int w, int h ); +int mt_set_max_tracks(int tracks); +#endif + diff --git a/veejay-current/reloaded-gtk3/src/sequence.c b/veejay-current/reloaded-gtk3/src/sequence.c new file mode 100644 index 00000000..153bd427 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/sequence.c @@ -0,0 +1,1087 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2006 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "common.h" + +#define RUP8(num)(((num)+8)&~8) + +extern void reloaded_schedule_restart(); +extern void vj_msg(int type, const char format[], ...); + +typedef struct +{ + uint8_t *image_data[16]; + int *status_tokens[16]; + int widths[16]; + int heights[16]; + int active_list[16]; + int frame_list[16]; +} track_sync_t; + +typedef struct +{ + char *hostname; + int port_num; + vj_client *fd; + uint8_t *data_buffer; + uint8_t *tmp_buffer; + uint8_t *status_buffer; + int track_list[16]; + int track_items; //shared + int status_tokens[STATUS_TOKENS]; //shared + int active; + int have_frame; + int grey_scale; + int preview; + int width; + int height; + int prevmode; + int need_track_list; + char *queue[16]; + int n_queued; + int bw; + int is_master; +} veejay_track_t; + +typedef struct +{ + void *lzo; + veejay_track_t **tracks; + int n_tracks; + int state; + track_sync_t *track_sync; +#ifdef STRICT_CHECKING + int locked; + char **locklist[256]; +#endif +} veejay_preview_t; + +static int sendvims( veejay_track_t *v, int vims_id, const char format[], ... ); +static int recvvims( veejay_track_t *v, gint header_len, gint *payload, guchar *buffer ); +static int veejay_get_image_data(veejay_preview_t *vp, veejay_track_t *v ); +static int track_find( veejay_preview_t *vp ); +static int veejay_process_status( veejay_preview_t *vp, veejay_track_t *v ); +static int gvr_preview_process_image( veejay_preview_t *vp, veejay_track_t *v ); +static int track_exists( veejay_preview_t *vp, const char *hostname, int port_num, int *at ); +static int gvr_preview_process_status( veejay_preview_t *vp, veejay_track_t *v ); +void gvr_veejay_grabber_step( void *data ); + +void *gvr_preview_init(int max_tracks, int use_threads) +{ + veejay_preview_t *vp = (veejay_preview_t*) vj_calloc(sizeof( veejay_preview_t )); + //vp->mutex = g_mutex_new(); + vp->tracks = (veejay_track_t**) vj_calloc(sizeof( veejay_track_t*) * max_tracks ); + vp->track_sync = (track_sync_t*) vj_calloc(sizeof( track_sync_t )); + int i; + for( i = 0; i < max_tracks; i++ ) + vp->track_sync->status_tokens[i] = (int*) vj_calloc(sizeof(int) * STATUS_TOKENS); + + vp->n_tracks = max_tracks; + + yuv_init_lib(0,0,0); + + return (void*) vp; +} + +static void gvr_close_connection( veejay_track_t *v ) +{ + if(v) + { + veejay_msg(VEEJAY_MSG_WARNING, "Stopping VeejayGrabber to %s:%d",v->hostname,v->port_num ); + vj_client_close(v->fd); + vj_client_free(v->fd); + if(v->hostname) free(v->hostname); + if(v->status_buffer) free(v->status_buffer); + if(v->data_buffer) free(v->data_buffer); + if(v->tmp_buffer) free(v->tmp_buffer); + free(v); + v= NULL; + } +} + +static int sendvims( veejay_track_t *v, int vims_id, const char format[], ... ) +{ + gchar block[255]; + gchar tmp[255]; + va_list args; + gint n; + if( format == NULL ) + { + g_snprintf( block, sizeof(block)-1, "%03d:;", vims_id ); + n = vj_client_send( v->fd, V_CMD, (unsigned char*) block ); + if( n <= 0 ) { + if( n == -1 && v->is_master ) + reloaded_schedule_restart(); + return 0; + } + return 0; + } + + va_start( args, format ); + vsnprintf( tmp, sizeof(tmp)-1, format, args ); + g_snprintf( block,sizeof(block)-1, "%03d:%s;", vims_id, tmp ); + va_end( args ); + + n = vj_client_send( v->fd, V_CMD,(unsigned char*) block ); + if( n <= 0 ) { + if( n == -1 && v->is_master ) + reloaded_schedule_restart(); + } + return 1; +} + +static int recvvims( veejay_track_t *v, gint header_len, gint *payload, guchar *buffer ) +{ + gint tmp_len = header_len + 1; + unsigned char *tmp = vj_calloc( tmp_len ); + gint len = 0; + gint n = vj_client_read_no_wait( v->fd, V_CMD, tmp, header_len ); + + if( n<= 0 ) + { + if( n == -1 && v->is_master) + reloaded_schedule_restart(); + veejay_msg(VEEJAY_MSG_ERROR,"Reading header of %d bytes: %d", header_len,n ); + free(tmp); + return n; + } + + if( sscanf( (char*)tmp, "%6d%1d", &len,&(v->grey_scale) )<=0) + { + veejay_msg(VEEJAY_MSG_ERROR, "Can't parse header (datastream polluted)"); + free(tmp); + return 0; + } + + if( len <= 0 ) + { + free(tmp); + veejay_msg(VEEJAY_MSG_ERROR, "Frame is empty"); + return 0; + } + + gint bw = 0; + gint bytes_read = len; + unsigned char *buf_ptr = buffer; + + *payload = 0; + + while( bw < len ) + { + n = vj_client_read_no_wait( v->fd, V_CMD, buf_ptr, bytes_read ); + if ( n <= 0 ) + { + if( n == -1 && v->is_master ) + reloaded_schedule_restart(); + veejay_msg(VEEJAY_MSG_ERROR, "Received %d out of %d bytes", bw,len); + free(tmp); + *payload = 0; + return n; + } + bw += n; + + bytes_read -= n; + buf_ptr += bw; + } + *payload = bw; + + free(tmp); + return 1; +} + + +static unsigned char *vims_track_list( veejay_track_t *v, int slen, int *bytes_written ) +{ + unsigned char message[8]; + int tmp_len = slen + 1; + unsigned char *result = NULL; + unsigned char *tmp = vj_calloc( tmp_len ); + if( tmp == NULL ) + { + if( v->is_master ) { + reloaded_schedule_restart(); + } + return NULL; + } + + snprintf( (char*) message,sizeof(message), "%03d:;", VIMS_TRACK_LIST ); + int ret = vj_client_send( v->fd, V_CMD, message ); + if( ret <= 0) + { + if( ret == -1 && v->is_master ) + reloaded_schedule_restart(); + free(tmp); + return NULL; + } + + ret = vj_client_read( v->fd, V_CMD, tmp, slen ); + if( ret <= 0 ) + { + if( ret == -1 && v->is_master ) + reloaded_schedule_restart(); + free(tmp); + return NULL; + } + + int len = 0; + if( sscanf( (char*) tmp, "%d", &len ) != 1 ) + { + if(v->is_master) + reloaded_schedule_restart(); + free(tmp); + return result; + } + + if( len <= 0 || slen <= 0) + { + free(tmp); + return result; + } + + result = (unsigned char*) vj_calloc(sizeof( unsigned char) * (len + 1) ); + if( result == NULL ) { + if(v->is_master) + reloaded_schedule_restart(); + free(tmp); + return result; + } + + int bytes_left = len; + *bytes_written = 0; + + while( bytes_left > 0) + { + int n = vj_client_read( v->fd, V_CMD, result + (*bytes_written), bytes_left ); + if( n <= 0 ) + { + if( n == -1 && v->is_master ) + reloaded_schedule_restart(); + bytes_left = 0; + break; + } + if( n > 0 ) + { + *bytes_written +=n; + bytes_left -= n; + } + } + free(tmp); + + if( bytes_left ) { + free(result); + return NULL; + } + + return result; +} + + +static int veejay_process_status( veejay_preview_t *vp, veejay_track_t *v ) +{ + + unsigned char status_len[6]; + int k = -1; + int n = 0; + while( (k = vj_client_poll( v->fd, V_STATUS )) ) // is there a more recent message? + { + veejay_memset( status_len, 0, sizeof( status_len ) ); + n = vj_client_read(v->fd, V_STATUS, status_len, 5 ); + int bytes= 0; + + if( status_len[0] != 'V' ) { + n = -1; + k = -1; + } + + if( n == -1 && v->is_master ) { + reloaded_schedule_restart(); + break; + } + + if( sscanf( (char*) status_len+1, "%03d", &bytes ) != 1 ) { + veejay_msg(VEEJAY_MSG_ERROR, "Invalid status message."); + bytes = 0; + reloaded_schedule_restart(); + break; + } + + if(bytes > 0 ) + { + veejay_memset( v->status_buffer,0, STATUS_LENGTH ); + n = vj_client_read( v->fd, V_STATUS, v->status_buffer, bytes ); + if( n <= 0 ) { + if( n == -1 && v->is_master ) + reloaded_schedule_restart(); + + break; + } + } + } + if( k == -1 && v->is_master ) + reloaded_schedule_restart(); + + veejay_memset( v->status_tokens,0, sizeof(int) * STATUS_TOKENS); + status_to_arr( (char*) v->status_buffer, v->status_tokens ); + return 1; +} +extern int is_button_toggled(const char *name); + +static int veejay_get_image_data(veejay_preview_t *vp, veejay_track_t *v ) +{ + if(!v->have_frame && (v->width <= 0 || v->height <= 0) ) + return 1; + + gint res = sendvims( v, VIMS_RGB24_IMAGE, "%d %d", v->width,v->height ); + if( res <= 0 ) + { + v->have_frame = 0; + return res; + } + gint bw = 0; + + res = recvvims( v, 7, &bw, v->data_buffer ); + if( res <= 0 || bw <= 0 ) + { + veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image! Only got %d bytes", bw); + v->have_frame = 0; + return res; + } + + int expected_len = (v->width * v->height); + int srcfmt = PIX_FMT_YUVJ420P; //default + + if(v->grey_scale) { + srcfmt = PIX_FMT_GRAY8; + } + else { + expected_len += (v->width*v->height/4); + expected_len += (v->width*v->height/4); + } + + if( bw != expected_len ) + { + veejay_msg(VEEJAY_MSG_WARNING, "Corrupted image. Should be %dx%d but have %d bytes %s", + v->width,v->height,abs(bw - expected_len),( (bw-expected_len<0)? "too few" : "too many") ); + v->have_frame = 0; + return 0; + } + + uint8_t *in = v->data_buffer; + + v->bw = 0; + + VJFrame *src1 = yuv_yuv_template( in, in + (v->width * v->height), in + (v->width * v->height) + (v->width*v->height)/4,v->width,v->height, srcfmt ); + VJFrame *dst1 = yuv_rgb_template( v->tmp_buffer, v->width,v->height, PIX_FMT_BGR24 ); + + yuv_convert_any_ac( src1, dst1, src1->format, dst1->format ); + + v->have_frame = 1; + + free(src1); + free(dst1); + + return bw; +} + + +static int gvr_preview_process_status( veejay_preview_t *vp, veejay_track_t *v ) +{ + if(!v) + return 0; + int tmp1 = 0; + tmp1 = vj_client_poll( v->fd , V_STATUS ); + if(tmp1) + { + int k = veejay_process_status( vp, v ); + if( k == -1 && v->is_master) + reloaded_schedule_restart(); + } + else if( tmp1 == -1 ) + { + if(v->is_master) + reloaded_schedule_restart(); + else + gvr_close_connection(v); + } + return 0; +} + +static int fail_connection = 0; +static int continue_anyway = 0; +static int gvr_preview_process_image( veejay_preview_t *vp, veejay_track_t *v ) +{ + if( v->preview == 0 ) + return 1; + + int n = veejay_get_image_data( vp, v ); + + if(n == 0 ) { + veejay_msg(VEEJAY_MSG_ERROR, "No image data %d x %d" , v->width,v->height); + //@ settle + fail_connection ++; + if( fail_connection > 2 ) { + fail_connection = 0; //@ fail 2 out of 10 images and we break connection + return 0; + } + return 1; + } if( n == -1 ) { + return 0; + } else { + continue_anyway = (continue_anyway + 1) % 10; + if(continue_anyway == 0) + fail_connection = 0; + } + + return 1; +} + +void gvr_set_master(void *data, int master_track ) +{ + veejay_preview_t *vp = (veejay_preview_t*) data; + int i; + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] ) + vp->tracks[i]->is_master = 0; + vp->tracks[master_track]->is_master = 1; +} + +static int track_exists( veejay_preview_t *vp, const char *hostname, int port_num, int *at_track ) +{ + int i; + + for( i = 0; i < vp->n_tracks ; i++ ) + { + if( vp->tracks[i] ) + { + veejay_track_t *v = vp->tracks[i]; + if( strcasecmp( hostname, v->hostname ) == 0 && v->port_num == port_num ) + { + if( at_track ) + *at_track = i; + return 1; + } + } + } + return 0; +} + +int gvr_track_test( void *preview, int track_id ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + if( track_id < 0 || track_id > vp->n_tracks ) + return 0; + return (vp->tracks[track_id] ? 1:0); +} + +static int track_find( veejay_preview_t *vp ) +{ + int i; + int res = -1; + for( i = 0;i < vp->n_tracks ;i ++ ) + { + if( !vp->tracks[i] ) + { + res = i; + break; + } + } + return res; +} + +char* gvr_track_get_hostname( void *preview , int num ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + + if( vp->tracks[num] ) + return vp->tracks[num]->hostname; + return NULL; +} + +int gvr_track_get_portnum( void *preview, int num) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + + if( vp->tracks[num] ) + return vp->tracks[num]->port_num; + return 0; +} + +int gvr_track_already_open( void *preview, const char *hostname, + int port ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + + if(track_exists( vp, hostname, port, NULL ) ) + return 1; + return 0; +} + +int gvr_track_connect( void *preview, char *hostname, int port_num, int *new_track ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int track_num = track_find( vp ); + + if(track_num == -1) + { + vj_msg(0, "All tracks used."); + return 0; + } + if(track_exists( vp, hostname, port_num, new_track ) ) + { + vj_msg(VEEJAY_MSG_WARNING, "Veejay '%s':%d already in track %d", hostname, port_num, *new_track ); + return 0; + } + vj_client *fd = vj_client_alloc(0,0,0); + if(!vj_client_connect( fd, hostname, NULL, port_num ) ) + { + vj_msg(VEEJAY_MSG_ERROR, "Unable to connect to %s:%d", hostname, port_num ); + vj_client_free( fd ); + return 0; + } + + veejay_track_t *vt = (veejay_track_t*) vj_calloc( sizeof(veejay_track_t)); + vt->hostname = strdup(hostname); + vt->port_num = port_num; + vt->active = 1; + vt->fd = fd; + + vt->status_buffer = (uint8_t*) vj_calloc(sizeof(uint8_t) * STATUS_LENGTH); + if(vt->status_buffer == NULL ) { + vj_client_free( fd ); + return 0; + } + + vt->data_buffer = (uint8_t*) vj_calloc( RUP8( MAX_PREVIEW_WIDTH * MAX_PREVIEW_HEIGHT * 3) ); + if(vt->data_buffer == NULL ) { + vj_client_free( fd ); + return 0; + } + + vt->tmp_buffer = (uint8_t*) vj_calloc( RUP8( MAX_PREVIEW_WIDTH * MAX_PREVIEW_HEIGHT * 4) ); + if(vt->tmp_buffer == NULL ) { + vj_client_free( fd ); + return 0; + } + + *new_track = track_num; + + vp->tracks[ track_num ] = vt; + vp->track_sync->active_list[ track_num ] = 1; + return 1; +} + + +static void gvr_single_queue_vims( veejay_track_t *v, int vims_id ) +{ + char message[16]; + + sprintf(message, "%03d:;", vims_id ); + + if( v->n_queued < 16 ) + { + v->queue[ v->n_queued ] = strdup( message ); + v->n_queued ++; + } +} + +static void gvr_multi_queue_vims( veejay_track_t *v, int vims_id, int val ) +{ + char message[16]; + + sprintf(message, "%03d:%d;", vims_id,val ); + + if( v->n_queued < 16 ) + { + v->queue[ v->n_queued ] = strdup( message ); + v->n_queued ++; + } +} +static void gvr_multivx_queue_vims( veejay_track_t *v, int vims_id, int val1,unsigned char *val2 ) +{ + char message[300]; + + sprintf(message, "%03d:%d %s;", vims_id,val1,val2 ); + + if( v->n_queued < 16 ) + { + v->queue[ v->n_queued ] = strdup( message ); + v->n_queued ++; + } +} +static void gvr_multivvv_queue_vims( veejay_track_t *v, int vims_id, int val1,int val2, int val3 ) +{ + char message[16]; + + sprintf(message, "%03d:%d %d %d;", vims_id,val1,val2, val3 ); + + if( v->n_queued < 16 ) + { + v->queue[ v->n_queued ] = strdup( message ); + v->n_queued ++; + } +} + +static void gvr_multiv_queue_vims( veejay_track_t *v, int vims_id, int val1,int val2 ) +{ + char message[16]; + + sprintf(message, "%03d:%d %d;", vims_id,val1,val2 ); + + if( v->n_queued < 16 ) + { + v->queue[ v->n_queued ] = strdup( message ); + v->n_queued ++; + } +} +void gvr_queue_cxvims( void *preview, int track_id, int vims_id, int val1,unsigned char *val2 ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int i; + + if( track_id == -1 ) + { + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + gvr_multivx_queue_vims( vp->tracks[i], vims_id,val1,val2 ); + } + else + { + if( vp->tracks[track_id] && vp->tracks[track_id]->active) + gvr_multivx_queue_vims( vp->tracks[track_id], vims_id,val1,val2 ); + } +} + +void gvr_queue_vims( void *preview, int track_id, int vims_id ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int i; + + if( track_id == -1 ) + { + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + gvr_single_queue_vims( vp->tracks[i], vims_id ); + } + else + { + if( vp->tracks[track_id] && vp->tracks[track_id]->active) + gvr_single_queue_vims( vp->tracks[track_id], vims_id ); + } +} + +void gvr_queue_mvims( void *preview, int track_id, int vims_id, int val ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int i; + + if( track_id == -1 ) + { + for( i = 0; i < vp->n_tracks ; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + gvr_multi_queue_vims( vp->tracks[i], vims_id,val ); + } + else + { + if( vp->tracks[track_id] && vp->tracks[track_id]->active ) + gvr_multi_queue_vims( vp->tracks[track_id], vims_id,val ); + } +} + +void gvr_need_track_list( void *preview, int track_id ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + veejay_track_t *v = vp->tracks[track_id]; + if(v) + v->need_track_list = 1; +} + +void gvr_queue_mmvims( void *preview, int track_id, int vims_id, int val1,int val2 ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int i; + + if( track_id == -1 ) + { + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + gvr_multiv_queue_vims( vp->tracks[i], vims_id,val1,val2 ); + } + else + { + if( vp->tracks[track_id] && vp->tracks[track_id]->active) + gvr_multiv_queue_vims( vp->tracks[track_id], vims_id,val1,val2 ); + } +} + +void gvr_queue_mmmvims( void *preview, int track_id, int vims_id, int val1,int val2, int val3 ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int i; + + if( track_id == -1 ) + { + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + gvr_multivvv_queue_vims( vp->tracks[i], vims_id,val1,val2,val3); + } + else + { + if( vp->tracks[track_id] && vp->tracks[track_id]->active) + gvr_multivvv_queue_vims( vp->tracks[track_id], vims_id,val1,val2,val3 ); + } +} + +void gvr_track_disconnect( void *preview, int track_num ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + + veejay_track_t *v = vp->tracks[ track_num ]; + if(v) + gvr_close_connection( v ); + vp->tracks[ track_num ] = NULL; + vp->track_sync->active_list[ track_num ] = 0; + +} + +int gvr_track_configure( void *preview, int track_num, int wid, int hei ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + + int w = (wid > MAX_PREVIEW_WIDTH ? MAX_PREVIEW_WIDTH : wid ); + int h = (hei > MAX_PREVIEW_HEIGHT ? MAX_PREVIEW_HEIGHT : hei ); + + if( vp->tracks[track_num] ) + { + vp->tracks[ track_num ]->width = w; + vp->tracks[ track_num ]->height = h; + } + + vp->track_sync->widths[track_num] = w; + vp->track_sync->heights[track_num] = h; + + return 1; +} + +int gvr_get_preview_status( void *preview, int track_num ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + if(!vp->tracks[track_num] ) + return 0; + return vp->tracks[track_num]->preview; +} + + +int gvr_track_toggle_preview( void *preview, int track_num, int status ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + vp->tracks[ track_num ]->preview = status; + + vj_msg(VEEJAY_MSG_INFO, "Live view %dx%d with %s:%d on Track %d %s", + vp->tracks[ track_num ]->width, + vp->tracks[ track_num ]->height, + vp->tracks[ track_num ]->hostname, + vp->tracks[ track_num ]->port_num, + track_num, + (status ? "enabled" : "disabled") ); + return status; +} + +static GdkPixbuf **gvr_grab_images(void *preview) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + GdkPixbuf **list = (GdkPixbuf**) vj_calloc( sizeof(GdkPixbuf*) * vp->n_tracks ); + if(!list) + return NULL; + + int i; + + for( i = 0; i < vp->n_tracks; i ++ ) + { + if( vp->tracks[i] && vp->tracks[i]->active && vp->track_sync->widths[i] > 0 && vp->tracks[i]->preview && + vp->tracks[i]->tmp_buffer != NULL ) + { + list[i] =gdk_pixbuf_new_from_data(vp->tracks[i]->tmp_buffer,GDK_COLORSPACE_RGB,FALSE, + 8,vp->tracks[i]->width,vp->tracks[i]->height, + vp->tracks[i]->width*3,NULL,NULL ); + } + } + + return list; +} + +static int *int_dup( int *status ) +{ + int *res = (int*) vj_calloc( sizeof(int) * STATUS_TOKENS ); + int i; + for(i =0; i < STATUS_TOKENS ; i ++ ) + res[i] = status[i]; + return res; +} +// TODO related profil_no_2 +static int **gvr_grab_stati( void *preview ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int **list = (int**) vj_calloc( sizeof(int*) * vp->n_tracks ); + if(!list) + return NULL; + + int i; + + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active) + list[i] = int_dup( vp->tracks[i]->status_tokens ); + return list; +} + +static int *gvr_grab_widths( void *preview ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int *list = (int*) vj_calloc( sizeof(int) * vp->n_tracks ); + if(!list) + return NULL; + + int i; + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + list[i] = vp->track_sync->widths[i]; + + return list; +} +static int *gvr_grab_heights( void *preview ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + int *list = (int*) vj_calloc( sizeof(int) * vp->n_tracks ); + if(!list) + return NULL; + + int i; + for( i = 0; i < vp->n_tracks; i ++ ) + if( vp->tracks[i] && vp->tracks[i]->active ) + list[i] = vp->track_sync->widths[i]; + + return list; +} + +sync_info *gvr_sync( void *preview ) +{ + veejay_preview_t *vp = (veejay_preview_t*) preview; + sync_info *s = (sync_info*) vj_calloc(sizeof(sync_info)); + + gvr_veejay_grabber_step( preview ); + + s->status_list = gvr_grab_stati( preview ); + s->tracks = vp->n_tracks; + s->widths = gvr_grab_widths( preview ); + s->heights = gvr_grab_heights( preview); + s->img_list = gvr_grab_images( preview ); + + return s; +} + + +static void gvr_parse_track_list( veejay_preview_t *vp, veejay_track_t *v, unsigned char *tmp, int len ) +{ + int i = 0; + int items = 0; + unsigned char *ptr = tmp; + + char **z = vj_calloc( sizeof( char * ) * vp->n_tracks ); + + while( i < len ) + { + int k = 0; + char k_str[4]; + strncpy( k_str,(char*) ptr, 3 ); + if( k > 0 ) + { + ptr += 3; + z[items] = strndup( (char*) ptr, k ); + items ++; + ptr += k; + } + i += ( 3 + k ); + } + + if( items > 0 ) + { + for( i = 0; i < items ; i ++ ) + { + int k; + int in_track = -1; + for( k = 0; k < vp->n_tracks ; k ++ ) + { + veejay_track_t *t = vp->tracks[k]; + if(t) + { + char hostname[255]; + int port = 0; + int stream_id = 0; + veejay_memset(hostname,0,255 ); + if( sscanf( (char*) z[i], "%s %d %d", hostname, &port, &stream_id )) + { + if( strcasecmp( hostname, t->hostname ) == 0 && + port == t->port_num ) + in_track = k; + } + } + } + + v->track_list[i] = in_track; + + free( z[i] ); + } + v->track_items = items; + } + + free( z ); +} + +int gvr_get_stream_id( void *data, int id ) +{ + veejay_preview_t *vp = (veejay_preview_t*) data; + + veejay_track_t *v = vp->tracks[id]; + + if(v) + return v->track_list[id]; + return 0; +} + +static void gvr_parse_queue( veejay_track_t *v ) +{ + int i; + + for( i = 0; i < v->n_queued ; i ++ ) + { + if( vj_client_send( v->fd, V_CMD, (unsigned char*) v->queue[i] ) == -1 && + v->is_master ) + reloaded_schedule_restart(); + free( v->queue[i] ); + v->queue[i] = NULL; + } + v->n_queued = 0; +} +static int gvr_veejay( veejay_preview_t *vp , veejay_track_t *v, int track_num ) +{ + int score = 0; + if( v->need_track_list || v->n_queued > 0 ) + { + if( v->need_track_list ) + { + int bw = 0; + unsigned char *tmp = vims_track_list( v, 5, &bw ); + gvr_parse_track_list( vp, v, tmp, bw ); + v->need_track_list = 0; + } + if( v->n_queued > 0 ) + { + gvr_parse_queue( v ); + } + score ++; + } + + v->preview = is_button_toggled( "previewtoggle" ); + + if( gvr_preview_process_image( vp,v )) + score++; + else + { + vj_client_close(v->fd); + int ok = vj_client_connect( v->fd, v->hostname, NULL, v->port_num ); + if( ok <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "VeejayGrabber: Unable to reconnect to %s, Destroying Track %d", + (v->hostname ? v->hostname : ""), + track_num ); + vj_client_free(v->fd); + if(v->hostname) free(v->hostname); + if(v->status_buffer) free(v->status_buffer); + if(v->data_buffer) free(v->data_buffer); + if(v->tmp_buffer) free(v->tmp_buffer); + v->data_buffer = NULL; + v->tmp_buffer = NULL; + vp->tracks[track_num] = NULL; + + if( v->is_master ) + reloaded_schedule_restart(); + free(v); + } + else + { + v->preview = is_button_toggled( "previewtoggle"); + v->active = 1; + vj_msg(VEEJAY_MSG_WARNING, "VeejayGrabber: %s:%d track %d@%dx%d preview: %s", + v->hostname, v->port_num, track_num, v->width,v->height, (v->preview ? "yes" : "no")); + } + } + + return score; +} + +void gvr_veejay_grabber_step( void *data ) +{ + veejay_preview_t *vp = (veejay_preview_t*) data; + int i; + + int try_picture = 0; + + for( i = 0; i < vp->n_tracks ; i ++ ) + { + if( vp->tracks[i] && vp->tracks[i]->active) { + if(gvr_preview_process_status( vp, vp->tracks[i] )) + { + if( gvr_get_preview_status( vp, i ) ) + try_picture ++; + } + } + } + + for( i = 0; i < vp->n_tracks ; i ++ ) + { + if( vp->tracks[i] && vp->tracks[i]->active) + { + if( vp->tracks[i] ) + gvr_veejay( vp, vp->tracks[i],i ); + } + } + +} + + diff --git a/veejay-current/reloaded-gtk3/src/sequence.h b/veejay-current/reloaded-gtk3/src/sequence.h new file mode 100644 index 00000000..58945f59 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/sequence.h @@ -0,0 +1,64 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2006 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef PREVIEWH +#define PREVIEWH +typedef struct +{ + int tracks; + int master; + int *widths; + int *heights; + int **status_list; + GdkPixbuf **img_list; +} sync_info; + +void *gvr_preview_init(int max_tracks, int use_thread); +int gvr_track_connect( void *preview, char *hostname, int port_num, int *track_num ); +void gvr_track_disconnect( void *preview, int track_num ); +int gvr_track_configure( void *preview, int track_num, int w, int h); +int gvr_track_toggle_preview( void *preview, int track_num, int status ); +void gvr_need_track_list( void *preview, int track_id ); + +int gvr_get_stream_id( void *data, int id ); +void gvr_set_master( void *preview, int master_track ); +//format and queue vims messages from extern + +void gvr_queue_mmmvims( void *preview, int track_id, int vims_id, int val1,int val2, int val3 ); +void gvr_queue_mmvims( void *preview, int track_id, int vims_id, int val1,int val2 ); +void gvr_queue_mvims( void *preview, int track_id, int vims_id, int val ); +void gvr_queue_vims( void *preview, int track_id, int vims_id ); + +void gvr_queue_cxvims( void *preview, int track_id, int vims_id, int val1,unsigned char *val2 ); + +int gvr_track_already_open( void *preview, const char *hostname, int port ); + +int gvr_get_preview_status( void *preview, int track_num ); + +char* gvr_track_get_hostname( void *preview , int num ); + +int gvr_track_get_portnum( void *preview, int num); + +int gvr_track_test( void *preview, int track_id ); + +sync_info *gvr_sync( void *preview ); + +#endif + + diff --git a/veejay-current/reloaded-gtk3/src/tracksources.c b/veejay-current/reloaded-gtk3/src/tracksources.c new file mode 100644 index 00000000..468e9949 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/tracksources.c @@ -0,0 +1,198 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +extern void veejay_release_track(int id, int release_this); +extern void veejay_bind_track( int id, int bind_this ); +extern int multitrack_get_sequence_view_id( void *data ); +extern gchar *_utf8str( const char *c_str ); +typedef struct +{ + int track_id; + GtkWidget *view; +} track_view_t; + +static void cell_data_func( + GtkTreeViewColumn *col, GtkCellRenderer *renderer, + GtkTreeModel *model, GtkTreeIter *iter, + gpointer user_data) +{ + gint state; + gtk_tree_model_get(model, iter, 1, &state, -1 ); + + if(state==1) + g_object_set(renderer, "active", TRUE, NULL ); + else + g_object_set(renderer, "active", FALSE, NULL ); + g_object_set( renderer, "activatable", TRUE, NULL ); +} + +static void cell_toggled_callback( GtkCellRenderer *cell, gchar *path_string, gpointer user_data ) +{ + track_view_t *v = (track_view_t*) user_data; + GtkWidget *view = v->view; + GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); + GtkTreePath *path = gtk_tree_path_new_from_string( path_string ); + GtkTreeIter iter; + + gtk_tree_model_get_iter( model, &iter, path ); + gchar *data = NULL; + gtk_tree_model_get( model, &iter,0, &data, -1 ); + + int id_data = -1; // invalid + if(sscanf( data, "%d", &id_data ) == 1 ) + { + if( gtk_cell_renderer_toggle_get_active( GTK_CELL_RENDERER_TOGGLE( cell) ) ) + { + veejay_release_track( v->track_id, id_data); + } + else + { + veejay_bind_track( v->track_id, id_data ); + } + g_free(data); + } + gtk_tree_path_free( path ); +} + +extern int *sequence_get_track_status(void *priv ); + +void update_track_view( int n_tracks, GtkWidget *widget, void *user_data ) +{ + GtkTreeView *view = GTK_TREE_VIEW(widget); + GtkTreeModel *model = gtk_tree_view_get_model( view ); + GtkListStore *store = GTK_LIST_STORE( model ); + GtkTreeIter iter; + + gtk_list_store_clear( GTK_LIST_STORE( model ) ); + + int i; + int id = multitrack_get_sequence_view_id( user_data ); + for( i = 0; i < n_tracks; i ++ ) + { + if(id != i) + { + char name[12]; + snprintf(name,sizeof(name),"%d", i); + gchar *uname = _utf8str( name ); + gtk_list_store_append( store, &iter ); + gtk_list_store_set( + store, &iter, + 0, uname, + 1, 0, + -1 ); + g_free( uname ); + } + } + + + gtk_tree_view_set_model( GTK_TREE_VIEW( widget ), model ); + +} + +GtkWidget *get_track_tree( void *data) +{ + track_view_t *t = (track_view_t*) data; + return t->view; +} + +void *create_track_view(int track_id, int ref_tracks, void *user_data) +{ + GtkCellRenderer *renderer, *wrenderer; + GtkTreeModel *model; + GtkWidget *view; + view = gtk_tree_view_new(); + renderer = gtk_cell_renderer_text_new(); + wrenderer = gtk_cell_renderer_toggle_new(); + + track_view_t *my_view = (track_view_t*) vj_calloc(sizeof(track_view_t)); + + gtk_cell_renderer_toggle_set_active( GTK_CELL_RENDERER_TOGGLE(wrenderer) , FALSE ); + + gtk_tree_view_insert_column_with_attributes( + GTK_TREE_VIEW( view ), + -1, + "T", + renderer, + "text", + 0, + NULL ); + gtk_tree_view_insert_column_with_attributes( + GTK_TREE_VIEW( view ), + -1, + "-", + wrenderer, + "activatable", + 1, + NULL); + +// GtkWidget *col = gtk_tree_view_get_column( GTK_TREE_VIEW(view) , 0 ); + GtkTreeViewColumn *col = gtk_tree_view_get_column( GTK_TREE_VIEW(view),0); + gtk_tree_view_column_set_fixed_width( col , 5 ); + + col = gtk_tree_view_get_column( GTK_TREE_VIEW( view ), 1 ); + gtk_tree_view_column_set_clickable( col , TRUE ); + gtk_tree_view_column_set_fixed_width( col , 20 ); + + gtk_tree_view_column_set_cell_data_func( col, + wrenderer, cell_data_func, NULL,NULL); + + /* build model */ + GtkListStore *store; + GtkTreeIter iter; + + store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_INT ); + int i; + for( i = 0; i < ref_tracks ; i ++ ) + { + if( i != track_id ) + { + char str[16]; + snprintf(str,sizeof(str),"%d",i); + gchar *ustr = _utf8str( str ); + gtk_list_store_append( store, &iter ); + gtk_list_store_set( store, &iter, + 0, ustr, + 1, 0, + -1); + g_free(ustr); + } + } + + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) ); + gtk_tree_selection_set_mode( selection, GTK_SELECTION_NONE ); + my_view->track_id = track_id; + my_view->view = view; + + g_assert( GTK_IS_TREE_VIEW( view ) ); + + model = GTK_TREE_MODEL( store ); + gtk_tree_view_set_model ( GTK_TREE_VIEW( view ), model ); + g_signal_connect( wrenderer, "toggled", + (GCallback) cell_toggled_callback, (gpointer*) my_view); + + + g_object_unref( model ); + + return (void*) my_view; +} diff --git a/veejay-current/reloaded-gtk3/src/tracksources.h b/veejay-current/reloaded-gtk3/src/tracksources.h new file mode 100644 index 00000000..36c86555 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/tracksources.h @@ -0,0 +1,28 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef TRACCKSOURCES_H +#define TRACCKSOURCES_H + +GtkWidget *get_track_tree( void *data); + +void *create_track_view( int id, int ref, void *data ); + +void update_track_view( int n_tracks, GtkWidget *widget, void *user_data ); +#endif diff --git a/veejay-current/reloaded-gtk3/src/utils.c b/veejay-current/reloaded-gtk3/src/utils.c new file mode 100644 index 00000000..237fe883 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/utils.c @@ -0,0 +1,105 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include "yuv4mpeg_intern.h" +#include "yuv4mpeg.h" +#include "mpegconsts.h" +#include "mpegtimecode.h" + +#include +#include + +int status_to_arr( char *status, int *array ) +{ + return sscanf(status, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", + array + 0, + array + 1, + array + 2, + array + 3, + array + 4, + array + 5, + array + 6, + array + 7, + array + 8, + array + 9, + array + 10, + array + 11, + array + 12, + array + 13, + array + 14, + array + 15, + array + 16, + array + 17, + array + 18, + array + 19, + array + 20, + array + 21, + array + 22, + array + 23, + array + 24, + array + 25, + array + 26, + array + 27, + array + 28, + array + 29, + array + 30, + array + 31, + array + 32, + array + 33 + ); +} + +void generator_to_arr( char *line, int *array) +{ + char *p = line; + int i = 0; + while(*p) { + char *end = NULL; + if(p == NULL) + break; + array[i] = strtol(p, &end, 10 ); + if( end == p) + break; + + while(*end == ' ') { + *end++; + if(end == NULL) + break; + } + + p = end; + i++; + } +} + + +char *format_time(int pos, double fps) +{ + char temp[128]; + MPEG_timecode_t tc; + y4m_ratio_t r = mpeg_conform_framerate(fps); + mpeg_timecode(&tc, + pos, + mpeg_framerate_code(r), + fps ); + snprintf(temp,sizeof(temp),"%d:%2.2d:%2.2d:%2.2d",tc.h, tc.m, tc.s, tc.f ); + return strdup(temp); +} + diff --git a/veejay-current/reloaded-gtk3/src/utils.h b/veejay-current/reloaded-gtk3/src/utils.h new file mode 100644 index 00000000..e4d13a3d --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/utils.h @@ -0,0 +1,31 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GVRUTILS +#define GVRUTILS +int status_to_arr( char *status, int *array ); +char *format_time( int pos , double fps); +void generator_to_arr( char *line, int *array); + + +#define MAX_PREVIEW_WIDTH 520 +#define MAX_PREVIEW_HEIGHT 300 + +#endif + diff --git a/veejay-current/reloaded-gtk3/src/videodev_mjpeg.h b/veejay-current/reloaded-gtk3/src/videodev_mjpeg.h new file mode 100644 index 00000000..68fd79c5 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/videodev_mjpeg.h @@ -0,0 +1,118 @@ +/* These are the MJPEG API extensions for the Video4Linux API, + first introduced by the Iomega Buz driver by Rainer Johanni + +*/ + +/* This is identical with the mgavideo internal params struct, + please tell me if you change this struct here ! top-field-first */ + + int APPn; /* Number of APP segment to be written, must be 0..15 */ + int APP_len; /* Length of data in JPEG APPn segment */ + char APP_data[60]; /* Data in the JPEG APPn segment. */ + + int COM_len; /* Length of data in JPEG COM segment */ + char COM_data[60]; /* Data in JPEG COM segment */ + + unsigned long jpeg_markers; /* Which markers should go into the JPEG output. + Unless you exactly know what you do, leave them untouched. + Inluding less markers will make the resulting code + smaller, but there will be fewer aplications + which can read it. + The presence of the APP and COM marker is + influenced by APP0_len and COM_len ONLY! */ +#define JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */ +#define JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */ +#define JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ +#define JPEG_MARKER_COM (1<<6) /* Comment segment */ +#define JPEG_MARKER_APP (1<<7) /* App segment, driver will allways use APP0 */ + + int VFIFO_FB; /* Flag for enabling Video Fifo Feedback. + If this flag is turned on and JPEG decompressing + is going to the screen, the decompress process + is stopped every time the Video Fifo is full. + This enables a smooth decompress to the screen + but the video output signal will get scrambled */ + + /* Misc */ + + char reserved[312]; /* Makes 512 bytes for this structure */ +}; + +struct mjpeg_requestbuffers +{ + unsigned long count; /* Number of buffers for MJPEG grabbing */ + unsigned long size; /* Size PER BUFFER in bytes */ +}; + +struct mjpeg_sync +{ + unsigned long frame; /* Frame (0 - n) for double buffer */ + unsigned long length; /* number of code bytes in buffer (capture only) */ + unsigned long seq; /* frame sequence number */ + struct timeval timestamp; /* timestamp */ +}; + +struct mjpeg_status +{ + int input; /* Input channel, has to be set prior to BUZIOC_G_STATUS */ + int signal; /* Returned: 1 if valid video signal detected */ + int norm; /* Returned: VIDEO_MODE_PAL or VIDEO_MODE_NTSC */ + int color; /* Returned: 1 if color signal detected */ +}; + +/* +Private IOCTL to set up for displaying MJPEG +*/ +#define MJPIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct mjpeg_params) +#define MJPIOC_S_PARAMS _IOWR('v', BASE_VIDIOCPRIVATE+1, struct mjpeg_params) +#define MJPIOC_REQBUFS _IOWR('v', BASE_VIDIOCPRIVATE+2, struct mjpeg_requestbuffers) +#define MJPIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+3, int) +#define MJPIOC_QBUF_PLAY _IOW ('v', BASE_VIDIOCPRIVATE+4, int) +#define MJPIOC_SYNC _IOR ('v', BASE_VIDIOCPRIVATE+5, struct mjpeg_sync) +#define MJPIOC_G_STATUS _IOWR('v', BASE_VIDIOCPRIVATE+6, struct mjpeg_status) diff --git a/veejay-current/reloaded-gtk3/src/vj-api.c b/veejay-current/reloaded-gtk3/src/vj-api.c new file mode 100644 index 00000000..64507dac --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/vj-api.c @@ -0,0 +1,9251 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2004 Niels Elburg + * with contributions by Thomas Rheinhold (2005) + * (initial sampledeck representation in GTK) + * with contributions by Jerome Blanchi (2016-2018) + * (Gtk3 Migration and other stuff) + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mpegconsts.h" +#include "mpegtimecode.h" +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SDL +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +//if gtk2_6 is not defined, 2.4 is assumed. +#ifdef GTK_CHECK_VERSION //FIXME FIXME ! +#if GTK_MINOR_VERSION >= 6 + #define HAVE_GTK2_6 1 +#endif +#if GTK_MINOR_VERSION >= 8 + #define HAVE_GTK2_8 1 +#endif +#endif +#ifdef STRICT_CHECKING +#include +#endif +#define RUP8(num)(((num)+8)&~8) +#ifdef ARCH_X86_64 +static gpointer castIntToGpointer( int val ) +{ + int64_t g_int64_val = (int64_t) val; + return (gpointer) g_int64_val; +} +#else +static gpointer castIntToGpointer( int val) +{ + return (gpointer) val; +} +#endif + +//~ static struct +//~ { + //~ const int id; + //~ const char *name; + //~ const int page; +//~ } crappy_design[] = +//~ { + //~ { 1,"notebook18", 3 }, // On which notebook page is the multitrack view + //~ { 0,NULL, 0 } +//~ }; + +#define MAX_SLOW 25 + +static int beta__ = 0; +static int use_vims_mcast = 0; + +static struct +{ + const char *text; +} tooltips[] = +{ + {"Mouse left: Set in point,\nMouse right: Set out point,\nDouble click: Clear selected,\nMouse middle: Drag selection"}, + {"Mouse left/right: Play slot,\nShift + Mouse left: Put sample in slot.\nYou can also put selected samples."}, + {"Mouse left click: Select slot (sample in slot),\nMouse double click: Play sample in slot,\nShift + Mouse left: Set slot as mixing current mixing channel"}, + {"Select a SRT sequence to edit"}, + {"Double click: add effect to current entry in chain list,\n [+] Shift L: add disabled,\n [+] Ctrl L: add to selected sample"}, + {"Filter the effects list by any string"}, + {"Shift + Mouse left : Toogle selected fx chain"}, + {NULL}, +}; + +static struct +{ + const char *name; +} non_feedback_widgets[] = +{ + { "markerframe" }, + { "vbox633" }, + { "hbox910" }, + { "hbox27" }, + { "sample_bank_hbox" }, + { "button_samplebank_prev" }, + { "button_samplebank_next" }, + { "spin_samplebank_select" }, + { "hbox709" }, + { "sample_panel" }, + { "notebook15" }, + { "vbox623" }, + { "samplegrid_frame" }, + { "panels" }, + { NULL }, +}; + +enum +{ + TOOLTIP_TIMELINE = 0, + TOOLTIP_QUICKSELECT = 1, + TOOLTIP_SAMPLESLOT = 2, + TOOLTIP_SRTSELECT = 3, + TOOLTIP_FXSELECT = 4, + TOOLTIP_FXFILTER = 5, + TOOLTIP_FXCHAINTREE = 6 +}; + +#define FX_PARAMETER_DEFAULT_NAME "" +#define FX_PARAMETER_VALUE_DEFAULT_HINT "" + +enum +{ + STREAM_NO_STREAM = 0, + STREAM_RED = 9, + STREAM_GREEN = 8, + STREAM_GENERATOR = 7, + STREAM_CALI = 6, + STREAM_WHITE = 4, + STREAM_VIDEO4LINUX = 2, + STREAM_DV1394 = 17, + STREAM_NETWORK = 13, + STREAM_MCAST = 14, + STREAM_YUV4MPEG = 1, + STREAM_AVFORMAT = 12, + STREAM_CLONE = 15, + STREAM_VLOOP = 3, + STREAM_PICTURE = 5 +}; + +enum +{ + COLUMN_INT = 0, + COLUMN_STRING0, + COLUMN_STRINGA , + COLUMN_STRINGB, + COLUMN_STRINGC, + N_COLUMNS +}; + +enum +{ + ENTRY_FXID = 0, + ENTRY_ISVIDEO = 1, + ENTRY_NUM_PARAMETERS = 2, + ENTRY_KF_STATUS = 3, + ENTRY_KF_TYPE = 4, + ENTRY_TRANSITION_ENABLED = 5, + ENTRY_TRANSITION_LOOP = 6, + ENTRY_SOURCE = 7, + ENTRY_CHANNEL = 8, + ENTRY_VIDEO_ENABLED = 9, + ENTRY_SUBRENDER_ENTRY = 10, + ENTRY_P0 = 11, + ENTRY_P1 = 12, + ENTRY_P2 = 13, + ENTRY_P3 = 14, + ENTRY_P4 = 15, + ENTRY_P5 = 16, + ENTRY_P6 = 17, + ENTRY_P8 = 18, + ENTRY_P9 = 19, + ENTRY_P10 = 20, + ENTRY_P11 = 21, + ENTRY_P12 = 22, + ENTRY_P13 = 23, + ENTRY_P14 = 24, + ENTRY_P15 = 25, + ENTRY_LAST = 26 + /* + ENTRY_P1 = 16, + ENTRY_P2 = 21, + ENTRY_P3 = 26, + ENTRY_P4 = 31, + ENTRY_P5 = 36, + ENTRY_P6 = 41, + ENTRY_P8 = 46, + ENTRY_P9 = 51, + ENTRY_P10 = 56, + ENTRY_P11 = 61, + ENTRY_P12 = 66, + ENTRY_P13 = 71, + ENTRY_P14 = 76, + ENTRY_P15 = 81, + ENTRY_LAST = 86 */ +}; + +#define ENTRY_PARAMSET ENTRY_P0 + +enum +{ + SL_ID = 0, + SL_DESCR = 1, + SL_TIMECODE = 2 +}; + +enum +{ + HINT_CHAIN = 0, + HINT_EL = 1, + HINT_MIXLIST = 2, + HINT_SAMPLELIST = 3, + HINT_ENTRY = 4, + HINT_SAMPLE = 5, + HINT_SLIST = 6, + HINT_V4L = 7, + HINT_RECORDING = 8, + HINT_RGBSOLID = 9, + HINT_BUNDLES = 10, + HINT_HISTORY = 11, + HINT_MARKER = 12, + HINT_KF = 13, + HINT_SEQ_ACT = 14, + HINT_SEQ_CUR = 15, + HINT_GENERATOR =16, + HINT_MACRO=17, + NUM_HINTS = 18, +}; + +enum +{ + PAGE_CONSOLE =0, + PAGE_FX = 3, + PAGE_EL = 1, + PAGE_SAMPLEEDIT = 2, +}; + +typedef struct +{ + int channel; + int dev; +} stream_templ_t; + +enum +{ + V4L_DEVICE=0, + DV1394_DEVICE=1, +}; + +typedef struct +{ + int selected_chain_entry; + int selected_el_entry; + int selected_vims_entry; + int selected_vims_accel[2]; + int render_record; + int entry_tokens[ENTRY_LAST]; + int iterator; + int selected_effect_id; + int reload_hint[NUM_HINTS]; + gboolean reload_force_avoid; + int playmode; + int sample_rec_duration; + int streams[4096]; + int recording[2]; + int selected_mix_sample_id; + int selected_mix_stream_id; + int selected_rgbkey; + int priout_lock; + int pressed_key; + int pressed_mod; + int keysnoop; + int randplayer; + stream_templ_t strtmpl[2]; // v4l, dv1394 + int selected_parameter_id; // current kf + int selected_vims_type; + char *selected_vims_args; + int cali_duration; + int cali_stage; + int expected_num_samples; + int expected_num_streams; + int real_num_samples; + int real_num_streams; +} veejay_user_ctrl_t; + +typedef struct +{ + float fps; + float ratio; + int num_files; + int *offsets; + int num_frames; + int width; + int height; +} veejay_el_t; + +enum +{ + RUN_STATE_LOCAL = 1, + RUN_STATE_REMOTE = 2, +}; + +typedef struct +{ + gint event_id; + gint params; + gchar *format; + gchar *descr; + gchar *args; +} vims_t; + +typedef struct +{ + gint keyval; + gint state; + gchar *args; + gchar *vims; + gint event_id; +} vims_keys_t; + +static int user_preview = 0; +static int NUM_BANKS = 50; +static int NUM_SAMPLES_PER_PAGE = 12; +static int NUM_SAMPLES_PER_COL = 6; +static int NUM_SAMPLES_PER_ROW = 2; +static int use_key_snoop = 0; + +#define G_MOD_OFFSET 200 +#define SEQUENCE_LENGTH 1024 +#define MEM_SLOT_SIZE 32 + +static vims_t vj_event_list[VIMS_MAX]; +static vims_keys_t vims_keys_list[VIMS_MAX]; +static int vims_verbosity = 0; +#define livido_port_t vevo_port_t +static int cali_stream_id = 0; +static int cali_onoff = 0; +static int geo_pos_[2] = { -1,-1 }; +static vevo_port_t *fx_list_ = NULL; +typedef struct +{ + GtkWidget *title; + GtkWidget *timecode; + GtkWidget *hotkey; +// GtkWidget *edit_button; +// GtkTooltip *tips; + GtkWidget *image; + GtkWidget *frame; + GtkWidget *event_box; + GtkWidget *main_vbox; + GtkWidget *upper_hbox; + GtkWidget *upper_vbox; +} sample_gui_slot_t; + +typedef struct +{ + gint w; + gint h; + gdouble fps; + gint pixel_format; + gint sampling; + gint audio_rate; + gint norm; + gint sync; + gint timer; + gint deinter; + gchar *mcast_osc; + gchar *mcast_vims; + gint osc; + gint vims; +} config_settings_t; + +typedef struct +{ + GtkWidget *frame; + GtkWidget *image; + GtkWidget *event_box; + GtkWidget *main_vbox; + GdkPixbuf *pixbuf_ref; + gint sample_id; + gint sample_type; +} sequence_gui_slot_t; + +typedef struct +{ + gint slot_number; + gint sample_id; + gint sample_type; + gchar *title; + gchar *timecode; + gint refresh_image; + GdkPixbuf *pixbuf; + guchar *rawdata; +} sample_slot_t; + +typedef struct +{ + gint seq_start; + gint seq_end; + gint w; + gint h; + sequence_gui_slot_t **gui_slot; + sample_slot_t *selected; + gint envelope_size; +} sequence_envelope; + +typedef struct +{ + sample_slot_t *sample; +} sequence_slot_t; + + +typedef struct +{ + gint bank_number; + gint page_num; + sample_slot_t **slot; + sample_gui_slot_t **gui_slot; +} sample_bank_t; + +typedef struct +{ + char *hostname; + int port_num; + int state; // IDLE, PLAYING, RECONNECT, STOPPED + struct timeval p_time; + int w_state; // watchdog state + int w_delay; +} watchdog_t; + +typedef struct +{ + GtkBuilder *main_window; + vj_client *client; + int status_tokens[STATUS_TOKENS]; /* current status tokens */ + int *history_tokens[4]; /* list last known status tokens */ + int status_passed; + int status_lock; + int slider_lock; + int parameter_lock; + int entry_lock; + int sample[2]; + int selection[3]; + gint status_pipe; + int sensitive; + int launch_sensitive; + struct timeval alarm; + struct timeval timer; +// GIOChannel *channel; + GdkVisual *color_map; + gint connecting; +// gint logging; + gint streamrecording; + gint samplerecording; +// gint cpumeter; + gint cachemeter; + gint image_w; + gint image_h; + veejay_el_t el; + veejay_user_ctrl_t uc; + GList *effect_info; + GList *devlist; + GList *chalist; + GList *editlist; + GList *elref; + long window_id; + int run_state; + int play_direction; + int load_image_slot; + GtkWidget *sample_bank_pad; + GtkWidget *quick_select; + GtkWidget *sample_sequencer; + sample_bank_t **sample_banks; + sample_slot_t *selected_slot; + sample_slot_t *selection_slot; + sample_gui_slot_t *selected_gui_slot; + sample_gui_slot_t *selection_gui_slot; + sequence_envelope *sequence_view; + sequence_envelope *sequencer_view; + int sequencer_col; + int sequencer_row; + int sequence_playing; + gint current_sequence_slot; +// GtkKnob *audiovolume_knob; +// GtkKnob *speed_knob; + int image_dimensions[2]; +// guchar *rawdata; + int prev_mode; + GtkWidget *tl; + GtkWidget *curve; + config_settings_t config; + int status_frame; + int key_id; + GdkRGBA *normal; + gboolean key_now; + void *mt; + watchdog_t watch; + int vims_line; + void *midi; + struct timeval time_last; + uint8_t *cali_buffer; +} vj_gui_t; + +enum +{ + STATE_STOPPED = 0, + STATE_RECONNECT = 1, + STATE_PLAYING = 2, + STATE_CONNECT = 3, + STATE_DISCONNECT = 4, + STATE_BUSY = 5, + STATE_LOADING = 6, + STATE_WAIT_FOR_USER = 7, + STATE_QUIT = 8, +}; + +enum +{ + FXC_ID = 0, + FXC_FXID = 1, + FXC_FXSTATUS = 2, + FXC_KF = 3, + FXC_MIXING = 4, + FXC_SUBRENDER = 5, + FXC_N_COLS = 6, +}; + +enum { + MACRO_FRAME = 0, + MACRO_DUP = 1, + MACRO_LOOP = 2, + MACRO_MSG_SEQ = 3, + MACRO_VIMS = 4, + MACRO_VIMS_DESCR = 5, +}; + +enum +{ + V4L_NUM=0, + V4L_NAME=1, + V4L_SPINBOX=2, + V4L_LOCATION=3, +}; + +enum +{ + VIMS_ID=0, + VIMS_KEY=1, + VIMS_MOD=2, + VIMS_DESCR=3, + VIMS_PARAMS=4, + VIMS_FORMAT=5, + VIMS_CONTENTS=6, +}; + +enum +{ + VIMS_LIST_ITEM_ID=0, + VIMS_LIST_ITEM_DESCR=1 +}; + +typedef struct +{ + const char *text; +} widget_name_t; + +typedef struct +{ + GtkListStore *list; + GtkTreeModelSort *sorted; + GtkTreeModelFilter *filtered; +} effectlist_models; + +typedef struct +{ + effectlist_models stores[3]; + gchar *filter_string; +} effectlist_data; + +static widget_name_t *slider_box_names_ = NULL; +static widget_name_t *slider_names_ = NULL; +static widget_name_t *param_names_ = NULL; +static widget_name_t *param_incs_ = NULL; +static widget_name_t *param_decs_ = NULL; +static widget_name_t *param_kfs_ = NULL; +static widget_name_t *gen_names_ = NULL; +static widget_name_t *gen_box_names_ = NULL; +static widget_name_t *gen_incs_ = NULL; +static widget_name_t *gen_decs_ = NULL; +static effectlist_data fxlist_data; + +#define MAX_PATH_LEN 1024 +#define VEEJAY_MSG_OUTPUT 4 +#define GENERATOR_PARAMS 11 + +#define SEQUENCER_COL 10 +#define SEQUENCER_ROW 10 +static guint macro_line[4] = { 0,0,0,0 }; + +static vj_gui_t *info = NULL; +void *get_ui_info() { return (void*) info; } +void reloaded_schedule_restart(); +/* global pointer to the sample-bank */ + +/* global pointer to the effects-source-list */ +static GtkWidget *effect_sources_tree = NULL; +static GtkListStore *effect_sources_store = NULL; +static GtkTreeModel *effect_sources_model = NULL; + + +static GtkWidget *cali_sourcetree = NULL; +static GtkListStore *cali_sourcestore = NULL; +static GtkTreeModel *cali_sourcemodel = NULL; + +/* global pointer to the editlist-tree */ +static GtkWidget *editlist_tree = NULL; +static GtkListStore *editlist_store = NULL; +static GtkTreeModel *editlist_model = NULL; +//void gtk_configure_window_cb( GtkWidget *w, GdkEventConfigure *ev, gpointer data ); +static int get_slider_val(const char *name); +void vj_msg(int type, const char format[], ...); +//static void vj_msg_detail(int type, const char format[], ...); +void msg_vims(char *message); +static void multi_vims(int id, const char format[],...); +static void single_vims(int id); +static gdouble get_numd(const char *name); +static void vj_kf_select_parameter(int id); +static int get_nums(const char *name); +static gchar *get_text(const char *name); +static void put_text(const char *name, char *text); +static void set_toggle_button(const char *name, int status); +static void update_slider_gvalue(const char *name, gdouble value ); +static void update_slider_value(const char *name, gint value, gint scale); +static void update_slider_range(const char *name, gint min, gint max, gint value, gint scaled); +//static void update_knob_range( GtkWidget *w, gdouble min, gdouble max, gdouble value, gint scaled ); +static void update_spin_range(const char *name, gint min, gint max, gint val); +static void update_spin_incr(const char *name, gdouble step, gdouble page); +//static void update_knob_value(GtkWidget *w, gdouble value, gdouble scale ); +static void update_spin_value(const char *name, gint value); +static void update_label_i(const char *name, int num, int prefix); +static void update_label_f(const char *name, float val); +static void update_label_str(const char *name, gchar *text); +static void update_globalinfo(int *his, int p, int k); +static gint load_parameter_info(); +static void load_v4l_info(); +static void reload_editlist_contents(); +static void load_effectchain_info(); +static void set_feedback_status(); +static void load_effectlist_info(); +static void load_sequence_list(); +static void load_generator_info(); +static void load_samplelist_info(gboolean with_reset_slotselection); +static void load_editlist_info(); +static void set_pm_page_label(int sample_id, int type); +static void notebook_set_page(const char *name, int page); +static void hide_widget(const char *name); +static void show_widget(const char *name); +#ifndef STRICT_CHECKING +static void disable_widget_( const char *name ); +static void enable_widget_(const char *name ); +#define enable_widget(a) enable_widget_(a) +#define disable_widget(a) disable_widget_(a) +#else +static void disable_widget_( const char *name, const char *function, int line ); +static void enable_widget_(const char *name, const char *function, int line ); +#define enable_widget(a) enable_widget_(a,__FUNCTION__,__LINE__ ) +#define disable_widget(a) disable_widget_(a,__FUNCTION__,__LINE__) +#endif +static void setup_tree_spin_column(const char *tree_name, int type, const char *title); +static void setup_tree_text_column( const char *tree_name, int type, const char *title, int expand ); +static void setup_tree_pixmap_column( const char *tree_name, int type, const char *title ); +gchar *_utf8str( const char *c_str ); +static gchar *recv_vims(int len, int *bytes_written); +static gchar *recv_vims_args(int slen, int *bytes_written, int *arg0, int *arg1); +static GdkPixbuf *update_pixmap_entry( int status ); +static gboolean chain_update_row(GtkTreeModel * model, GtkTreePath * path, GtkTreeIter * iter,gpointer data); +int resize_primary_ratio_y(); +int resize_primary_ratio_x(); +static void update_rgbkey(); +static int count_textview_buffer(const char *name); +static void clear_textview_buffer(const char *name); +static void init_recorder(int total_frames, gint mode); +static void reload_bundles(); +static void update_rgbkey_from_slider(); +static gchar *get_textview_buffer(const char *name); +static void create_slot(gint bank_nr, gint slot_nr, gint w, gint h); +static void setup_samplebank(gint c, gint r, GtkWidget *pad, gint *image_w, gint *image_h); +static int add_sample_to_sample_banks( int bank_page,sample_slot_t *slot ); +static void update_sample_slot_data(int bank_num, int slot_num, int id, gint sample_type, gchar *title, gchar *timecode); +static gboolean on_slot_activated_by_mouse (GtkWidget *widget, GdkEventButton *event, gpointer user_data); +static void add_sample_to_effect_sources_list(gint id, gint type, gchar *title, gchar *timecode); +static void set_activation_of_slot_in_samplebank(gboolean activate); +static int bank_exists( int bank_page, int slot_num ); +static int find_bank_by_sample(int sample_id, int sample_type, int *slot ); +static int add_bank( gint bank_num ); +static void set_selection_of_slot_in_samplebank(gboolean active); +static void remove_sample_from_slot(); +static void create_ref_slots(int envelope_size); +static void create_sequencer_slots(int x, int y); +//void setup_knobs(); +void free_samplebank(void); +void reset_samplebank(void); +int verify_bank_capacity(int *bank_page_, int *slot_, int sample_id, int sample_type ); +static void widget_get_rect_in_screen (GtkWidget *widget, GdkRectangle *r); +static void update_curve_widget( GtkWidget *curve ); +/* not used */ /* static void update_curve_accessibility(const char *name); */ +static void reset_tree(const char *name); +static void reload_srt(); +static void reload_fontlist(); +static void indicate_sequence( gboolean active, sequence_gui_slot_t *slot ); +static void set_textview_buffer(const char *name, gchar *utf8text); +void interrupt_cb(); +int get_and_draw_frame(int type, char *wid_name); +GdkPixbuf *vj_gdk_pixbuf_scale_simple( GdkPixbuf *src, int dw, int dh, GdkInterpType inter_type ); +static void vj_kf_refresh(); +static void vj_kf_reset(); +void reload_macros(); +/* not used */ /* static int vj_kf_is_displayed(); */ + +void reset_cali_images( int type, char *wid_name ); + +gboolean disable_sample_image = FALSE; + +void set_disable_sample_image(gboolean status) +{ + disable_sample_image = status; +} + +static gchar* strduplastn(gchar *title) { + gchar *reversed = g_strreverse(title); + gchar *part = g_strndup(reversed,12); + gchar *reverse = g_strreverse(part); + gchar *result = g_strdup(reverse); + g_free(part); + return result; +} + +GtkWidget *glade_xml_get_widget_( GtkBuilder *m, const char *name ) +{ + GtkWidget *widget = GTK_WIDGET (gtk_builder_get_object( m , name )); + if(!widget) + { + return NULL; + } +#ifdef STRICT_CHECKING + assert( widget != NULL ); +#endif + return widget; +} + +void gtk_notebook_set_current_page__( GtkWidget *w, gint num, const char *f, int line ) +{ + gtk_notebook_set_current_page( GTK_NOTEBOOK(w), num ); +} + +void gtk_widget_set_size_request__( GtkWidget *w, gint iw, gint h, const char *f, int line ) +{ + gtk_widget_set_size_request(w, iw, h ); +} + +#ifndef STRICT_CHECKING +#define gtk_widget_set_size_request_(a,b,c) gtk_widget_set_size_request(a,b,c) +#define gtk_notebook_set_current_page_(a,b) gtk_notebook_set_current_page(a,b) +#else +#define gtk_widget_set_size_request_(a,b,c) gtk_widget_set_size_request__(a,b,c,__FUNCTION__,__LINE__) +#define gtk_notebook_set_current_page_(a,b) gtk_notebook_set_current_page__(a,b,__FUNCTION__,__LINE__) +#endif + +static struct +{ + gchar *text; +} text_msg_[] = +{ + { "Running realtime" }, + { NULL }, +}; + +enum { + TEXT_REALTIME = 0 +}; + +static struct +{ + const char *name; +} capt_label_set[] = +{ + { "label333" }, //brightness + { "label334" }, //contrast + { "label336" }, //hue + { "label777" }, //saturation + { "label29" }, //temperature + { "label337"}, //gamma + { "label25" }, //sharpness + { "label20" }, //gain + { "label21" }, //red balance + { "label22" }, //blue balance + { "label23" }, //green balance + { "label20" }, //gain + { "label26" }, //bl_compensate + { "label34" }, //whiteness + { "label33" }, //blacklevel + { "label31" }, //exposure + { "label24" }, //autowhitebalance + { "label27" }, //autogain + { "label28" }, //autohue + { "label30" }, //fliph + { "label32" }, //flipv + { NULL }, +}; + +static struct +{ + const char *name; +} capt_card_set[] = +{ + { "v4l_brightness" }, + { "v4l_contrast" }, + { "v4l_hue" }, + { "v4l_saturation" }, + { "v4l_temperature"}, + { "v4l_gamma" }, + { "v4l_sharpness" }, + { "v4l_gain" }, + { "v4l_redbalance" }, + { "v4l_bluebalance" }, + { "v4l_greenbalance" }, + { "v4l_gain" }, + { "v4l_backlightcompensation"}, + { "v4l_whiteness"}, + { "v4l_black_level" }, + { "v4l_exposure" }, + { "check_autowhitebalance"}, + { "check_autogain" }, + { "check_autohue" }, + { "check_flip" }, + { "check_flipv"}, + { NULL }, +}; +#define CAPT_CARD_SLIDERS 16 +#define CAPT_CARD_BOOLS 5 + +static int preview_box_w_ = MAX_PREVIEW_WIDTH; +static int preview_box_h_ = MAX_PREVIEW_HEIGHT; + +static void *bankport_ = NULL; + +int vj_get_preview_box_w() +{ + return preview_box_w_; +} + +int vj_get_preview_box_h() +{ + return preview_box_h_; +} + +#ifdef STRICT_CHECKING +static void gtk_image_set_from_pixbuf__( GtkImage *w, GdkPixbuf *p, const char *f, int l ) +{ + assert( GTK_IS_IMAGE(w) ); + gtk_image_set_from_pixbuf(w, p); +} + +static void gtk_widget_set_sensitive___( GtkWidget *w, gboolean state, const char *f, int l ) +{ + assert( GTK_IS_WIDGET(w) ); + gtk_widget_set_sensitive(w, state ); +} +#endif + +static void select_slot(int pm); + +#ifdef STRICT_CHECKING +#define gtk_widget_set_sensitive_( w,p ) gtk_widget_set_sensitive___( w,p,__FUNCTION__,__LINE__ ) +#define gtk_image_set_from_pixbuf_(w,p) gtk_image_set_from_pixbuf__( w,p, __FUNCTION__,__LINE__ ) +#else +#define gtk_widget_set_sensitive_( w,p ) gtk_widget_set_sensitive( w,p ) +#define gtk_image_set_from_pixbuf_(w,p) gtk_image_set_from_pixbuf( w,p ) +#endif + +static struct +{ + const char *name; +} uiwidgets[] = +{ + {"veejay_box"}, + {NULL} +}; + +static struct +{ + const char *name; +} plainwidgets[] = +{ + {"video_navigation_buttons"}, + {"button_084"}, + {"button_083"}, + {"button_samplestart"}, + {"button_sampleend"}, + {"speed_slider"}, + {"slow_slider"}, + {"vjframerate"}, + {"markerframe"}, + {NULL} +}; + +static struct +{ + const char *name; +} samplewidgets[] = +{ + {"sample_loop_box"}, + {"button_084"}, + {"button_083"}, + {"video_navigation_buttons"}, + {"button_samplestart"}, + {"button_sampleend"}, + {"speed_slider"}, + {"slow_slider"}, + {"button_200"}, // mask button + {"frame_fxtree"}, + {"frame_fxtree3"}, + {"fxpanel"}, + {"panels"}, + {"vjframerate"}, + {"scrolledwindow49"}, // srt stuff + {"samplegrid_frame"}, + {"markerframe"}, + {NULL} +}; + +static struct +{ + const char *name; +} streamwidgets[] = +{ + {"button_200"}, // mask button + {"frame_fxtree"}, + {"frame_fxtree3"}, + {"fxpanel"}, + {"panels"}, + {"scrolledwindow49"}, // srt stuff + {"samplegrid_frame"}, + {NULL}, +}; + +enum +{ + TC_SAMPLE_L = 0, + TC_SAMPLE_F = 1, + TC_SAMPLE_S = 2, + TC_SAMPLE_M = 3, + TC_SAMPLE_H = 4, + TC_STREAM_F = 5, + TC_STREAM_M = 6, + TC_STREAM_H = 7 +}; + +static sample_slot_t *find_slot_by_sample( int sample_id , int sample_type ); +static sample_gui_slot_t *find_gui_slot_by_sample( int sample_id , int sample_type ); + +gchar *_utf8str(const char *c_str) +{ + gsize bytes_read = 0; + gsize bytes_written = 0; + GError *error = NULL; + if(!c_str) + return NULL; + char *result = (char*) g_locale_to_utf8( c_str, -1, &bytes_read, &bytes_written, &error ); + + if(error) + { + g_free(error); + if( result ) + g_free(result); + result = NULL; + } + + return result; +} + +/*! \brief Return the widget current state foreground color. + * + * \param w A pointer of calling widget + + * \return A pointer to GdkRGBA + */ +GdkRGBA *widget_get_fg(GtkWidget *w ) +{ + if(!w) + return NULL; + GtkStyleContext *sc = gtk_widget_get_style_context(w); + GdkRGBA *color = (GdkRGBA*)vj_calloc(sizeof(GdkRGBA)); + gtk_style_context_get_color ( sc, gtk_style_context_get_state (sc), + color ); + return color; +} + +static void scan_devices( const char *name) +{ + GtkWidget *tree = glade_xml_get_widget_(info->main_window,name); + GtkListStore *store; + GtkTreeIter iter; + + reset_tree(name); + gint len = 0; + single_vims( VIMS_DEVICE_LIST ); + gchar *text = recv_vims(6,&len); + if(len <= 0|| !text ) + { + veejay_msg(VEEJAY_MSG_WARNING, "No capture devices found on veejay server"); + return; + } + GtkTreeModel *model = gtk_tree_view_get_model + (GTK_TREE_VIEW(tree)); + + store = GTK_LIST_STORE(model); + + gint offset =0; + gint i = 0; + gchar *ptr = text + offset; + while( offset < len ) + { + char tmp[4]; + + gchar *name = NULL; + gdouble gchannel = 1.0; + gchar *loca = NULL; + + gint name_len=0; + gint loc_len=0; + + strncpy(tmp,ptr+offset,3); + tmp[3] = '\0'; + offset += 3; + name_len = atoi( tmp ); + if(name_len <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Reading name of capture device: '%s'",ptr+offset ); + return; + } + name = strndup( ptr + offset, name_len ); + offset += name_len; + strncpy( tmp, ptr + offset, 3 ); + tmp[3] = '\0'; + offset += 3; + + loc_len = atoi( tmp ); + if( loc_len <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Reading location of capture device"); + return; + } + loca = strndup( ptr + offset, loc_len ); + offset += loc_len; + gchar *thename = _utf8str( name ); + gchar *theloca = _utf8str( loca ); + + gtk_list_store_append( store, &iter); + gtk_list_store_set(store, &iter, + V4L_NUM, i, + V4L_NAME, thename, + V4L_SPINBOX, gchannel, + V4L_LOCATION, theloca, + -1); + + g_free(thename); + g_free(theloca); + + free(loca); + free(name); + i ++; + } + free(text); + + gtk_tree_view_set_model(GTK_TREE_VIEW(tree), model ); +} + +static void scan_generators( const char *name) +{ + GtkWidget *tree = glade_xml_get_widget_(info->main_window,name); + GtkListStore *store; + GtkTreeIter iter; + + reset_tree(name); + gint len = 0; + single_vims( VIMS_GET_GENERATORS ); + gchar *text = recv_vims(5,&len); + if(len <= 0|| !text ) + { + veejay_msg(VEEJAY_MSG_WARNING, "No generators found on veejay server"); + return; + } + GtkTreeModel *model = gtk_tree_view_get_model + (GTK_TREE_VIEW(tree)); + + store = GTK_LIST_STORE(model); + + gint offset =0; + gint i = 0; + gchar *ptr = text + offset; + while( offset < len ) + { + char tmp[4]; + + gchar *name = NULL; + gint name_len=0; + + strncpy(tmp,ptr+offset,3); + tmp[3] = '\0'; + offset += 3; + name_len = atoi( tmp ); + if(name_len <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Reading name of generator: '%s'",ptr+offset ); + return; + } + name = strndup( ptr + offset, name_len ); + offset += name_len; + gchar *thename = _utf8str( name ); + + gtk_list_store_append( store, &iter); + gtk_list_store_set(store, &iter,0,thename,-1); + + g_free(thename); + + free(name); + i ++; + } + free(text); + + gtk_tree_view_set_model(GTK_TREE_VIEW(tree), model ); +} + + +static void set_tooltip_by_widget(GtkWidget *w, const char *text) +{ + gtk_widget_set_tooltip_text( w,text ); +} + +static void set_tooltip(const char *name, const char *text) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) { +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); +#endif + return; + } + gtk_widget_set_tooltip_text( w,text ); +} + +void on_devicelist_row_activated(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model(treeview); + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gint channel = info->uc.strtmpl[0].channel; + gint num = info->uc.strtmpl[0].dev; + + multi_vims( VIMS_STREAM_NEW_V4L,"%d %d", + num, + channel + ); + } +} + +gboolean device_selection_func( GtkTreeSelection *sel, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata ) +{ + GtkTreeIter iter; + GValue val = { 0, }; + if( gtk_tree_model_get_iter( model, &iter, path ) ) + { + gint num = 0; + //gtk_tree_model_get(model, &iter, V4L_NUM,&num, -1 ); + gchar *file = NULL; + gtk_tree_model_get( model, &iter, V4L_LOCATION, &file, -1 ); + sscanf( file, "/dev/video%d", &num ); + if(! path_currently_selected ) + { + gtk_tree_model_get_value(model, &iter, V4L_SPINBOX, &val); + info->uc.strtmpl[0].dev = num; + info->uc.strtmpl[0].channel = (int) g_value_get_float(&val); + } + g_free(file); + } + return TRUE; +} + +static void setup_v4l_devices() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_v4ldevices"); + GtkListStore *store = gtk_list_store_new( 4, G_TYPE_INT, G_TYPE_STRING, G_TYPE_FLOAT, + G_TYPE_STRING ); + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + GtkTreeSelection *sel = gtk_tree_view_get_selection( GTK_TREE_VIEW( tree ) ); + gtk_tree_selection_set_mode( sel, GTK_SELECTION_SINGLE ); + gtk_tree_selection_set_select_function( sel, device_selection_func, NULL,NULL ); + +// gtk_tree_view_set_fixed_height_mode( GTK_TREE_VIEW(tree), TRUE ); + + g_object_unref( G_OBJECT( store )); + setup_tree_text_column( "tree_v4ldevices", V4L_NUM, "#",0 ); + setup_tree_text_column( "tree_v4ldevices", V4L_NAME, "Device Name",0); + setup_tree_spin_column( "tree_v4ldevices", V4L_SPINBOX, "Channel"); + setup_tree_text_column( "tree_v4ldevices", V4L_LOCATION, "Location",0); + + g_signal_connect( tree, "row-activated", + (GCallback) on_devicelist_row_activated, NULL ); + + //scan_devices( "tree_v4ldevices" ); +} + +gboolean vims_macro_selection_func( GtkTreeSelection *sel, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data) +{ + GtkTreeIter iter; + if( gtk_tree_model_get_iter( model, &iter, path) ) { + + guint frame_num = 0, dup_num = 0, loop_num = 0, seq_no = 0; + + gchar *message = NULL; + gtk_tree_model_get( model, &iter, MACRO_FRAME, &frame_num, -1); + gtk_tree_model_get( model, &iter, MACRO_DUP, &dup_num, -1); + gtk_tree_model_get( model, &iter, MACRO_MSG_SEQ, &seq_no, -1); + gtk_tree_model_get( model, &iter, MACRO_LOOP, &loop_num, -1); + gtk_tree_model_get( model, &iter, MACRO_VIMS, &message, -1 ); + + macro_line[0] = frame_num; + macro_line[1] = dup_num; + macro_line[2] = loop_num; + macro_line[3] = seq_no; + + update_spin_value( "macro_frame_position", frame_num ); + update_spin_value( "macro_dup_position", dup_num ); + update_spin_value( "macro_loop_position", loop_num ); + put_text( "macro_vims_message", message ); + + g_free(message); + } + return TRUE; +} + +static void setup_macros() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "macro_macros" ); + GtkListStore *store = gtk_list_store_new( 6, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING ); + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store) ); + GtkTreeSelection *sel = gtk_tree_view_get_selection( GTK_TREE_VIEW(tree) ); + gtk_tree_selection_set_mode( sel, GTK_SELECTION_SINGLE ); + gtk_tree_selection_set_select_function( sel, vims_macro_selection_func, NULL,NULL ); + + g_object_unref( G_OBJECT(store) ); + + setup_tree_text_column( "macro_macros", MACRO_FRAME, "Frame",0 ); + setup_tree_text_column( "macro_macros", MACRO_DUP, "Dup",0); + setup_tree_text_column( "macro_macros", MACRO_LOOP, "Loop",0); + setup_tree_text_column( "macro_macros", MACRO_MSG_SEQ, "#",0); + setup_tree_text_column( "macro_macros", MACRO_VIMS, "VIMS Message",0); + setup_tree_text_column( "macro_macros", MACRO_VIMS_DESCR, "Description",0); +} + +#define SAMPLE_MAX_PARAMETERS 32 + +static gchar* format_selection_time(int start, int end); + +typedef struct +{ + int id; + int nl; + long n1; + long n2; + int tf; +} el_ref; + +typedef struct +{ + int pos; + char *filename; + char *fourcc; + int num_frames; +} el_constr; + +typedef struct { + char **description; +} value_hint; + +typedef struct { + int defaults[SAMPLE_MAX_PARAMETERS]; + int min[SAMPLE_MAX_PARAMETERS]; + int max[SAMPLE_MAX_PARAMETERS]; + char description[150]; + char *param_description[SAMPLE_MAX_PARAMETERS]; + value_hint *hints[SAMPLE_MAX_PARAMETERS]; + int id; + int is_video; + int num_arg; + int has_rgb; + int is_gen; +} effect_constr; + +int _effect_is_gen(int effect_id) +{ + int n = g_list_length(info->effect_info); + int i; + if(effect_id < 0) return -1; + for(i=0; i <= n; i++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if(ec != NULL) + { + if(ec->id == effect_id) return ec->is_gen; + } + } + return 0; +} + +int _effect_get_mix(int effect_id) +{ + int n = g_list_length(info->effect_info); + int i; + if(effect_id < 0) return -1; + for(i=0; i <= n; i++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if(ec != NULL) + { + if(ec->id == effect_id) return ec->is_video; + } + } + return 0; +} + +int _effect_get_rgb(int effect_id) +{ + int n = g_list_length(info->effect_info); + int i; + if(effect_id < 0) return -1; + for(i=0; i <= n; i++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if(ec != NULL) + { + if(ec->id == effect_id) return ec->has_rgb; + } + } + return 0; +} + +/* + * Return the number of parameters from an effect identifier + * + * FIXME return too much parameter for some generator + */ +int _effect_get_np(int effect_id) +{ + int n = g_list_length(info->effect_info); + int i; + if(effect_id < 0) return -1; + for(i=0; i <= n; i++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if(ec != NULL) + { + if(ec->id == effect_id) return ec->num_arg; + } + } + return 0; +} + +int _effect_get_minmax( int effect_id, int *min, int *max, int index ) +{ + int n = g_list_length(info->effect_info); + int i; + if(effect_id < 0) return 0; + for(i=0; i <= n; i++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if(ec != NULL) + { + if(ec->id == effect_id) + { + if( index > ec->num_arg ) + return 0; + *min = ec->min[index]; + *max = ec->max[index]; + return 1; + } + } + } + return 0; +} + +char *_effect_get_param_description(int effect_id, int param) +{ + int n = g_list_length( info->effect_info ); + int i; + for(i = 0;i <= n ; i++) + { + effect_constr *ec = g_list_nth_data(info->effect_info, i); + if(ec != NULL) + { + if(effect_id == ec->id ) + return ec->param_description[param]; + } + } + return FX_PARAMETER_DEFAULT_NAME; +} + +char *_effect_get_description(int effect_id) +{ + int n = g_list_length( info->effect_info ); + int i; + for(i = 0;i <= n ; i++) + { + effect_constr *ec = g_list_nth_data(info->effect_info, i); + if(ec != NULL) + { + if(effect_id == ec->id ) + return ec->description; + } + } + return FX_PARAMETER_DEFAULT_NAME; +} + +char *_effect_get_hint(int effect_id, int p, int v) +{ + int n = g_list_length( info->effect_info ); + int i; + for(i = 0;i <= n ; i++) + { + effect_constr *ec = g_list_nth_data(info->effect_info, i); + if(ec == NULL) + continue; + + if(effect_id == ec->id ) + { + if( ec->hints[p] == NULL) + break; + + return ec->hints[p]->description[v]; + } + } + return FX_PARAMETER_VALUE_DEFAULT_HINT; +} + +el_constr *_el_entry_new( int pos, char *file, int nf , char *fourcc) +{ + el_constr *el = g_new( el_constr , 1 ); + el->filename = strdup( file ); + el->num_frames = nf; + el->pos = pos; + el->fourcc = strdup(fourcc); + return el; +} + +void _el_entry_free( el_constr *entry ) +{ + if(entry) + { + if(entry->filename) free(entry->filename); + if(entry->fourcc) free(entry->fourcc); + free(entry); + } +} + +void _el_entry_reset( ) +{ + if(info->editlist != NULL) + { + int n = g_list_length( info->editlist ); + int i; + for( i = 0; i <= n ; i ++) + _el_entry_free( g_list_nth_data( info->editlist, i ) ); + g_list_free(info->editlist); + info->editlist=NULL; + } +} + +int _el_get_nframes( int pos ) +{ + int n = g_list_length( info->editlist ); + int i; + for( i = 0; i <= n ; i ++) + { + el_constr *el = g_list_nth_data( info->editlist, i ); + if(!el) return 0; + if(el->pos == pos) + return el->num_frames; + } + return 0; +} + +el_ref *_el_ref_new( int row_num,int nl, long n1, long n2, int tf) +{ + el_ref *el = vj_malloc(sizeof(el_ref)); + el->id = row_num; + el->nl = nl; + el->n1 = n1; + el->n2 = n2; + el->tf = tf; + return el; +} + +void _el_ref_free( el_ref *entry ) +{ + if(entry) free(entry); +} + +void _el_ref_reset() +{ + if(info->elref != NULL) + { + int n = g_list_length( info->elref ); + int i; + for(i = 0; i < n; i ++ ) + { + el_ref *edl = g_list_nth_data(info->elref, i ); + if(edl) + free(edl); + } + g_list_free(info->elref); + info->elref = NULL; + } +} + +int _el_ref_end_frame( int row_num ) +{ + int n = g_list_length( info->elref ); + int i; + for ( i = 0 ; i <= n; i ++ ) + { + el_ref *el = g_list_nth_data( info->elref, i ); + if(el->id == row_num ) + { +// int offset = info->el.offsets[ el->nl ]; +// return (offset + el->n1 + el->n2 ); + return (el->tf + el->n2 - el->n1); + } + } + return 0; +} + +int _el_ref_start_frame( int row_num ) +{ + int n = g_list_length( info->elref ); + int i; + for ( i = 0 ; i <= n; i ++ ) + { + el_ref *el = g_list_nth_data( info->elref, i ); + if(el->id == row_num ) + { +// int offset = info->el.offsets[ el->nl ]; +// return (offset + el->n1 ); +// printf("Start pos of row %d : %d = n1, %d = n2, %d = tf\n", +// row_num,el->n1,el->n2, el->tf ); + return (el->tf); + } + } + return 0; +} + +char *_el_get_fourcc( int pos ) +{ + int n = g_list_length( info->editlist ); + int i; + for( i = 0; i <= n; i ++ ) + { + el_constr *el = g_list_nth_data( info->editlist, i ); + if(el->pos == pos) + return el->fourcc; + } + return NULL; +} + + +char *_el_get_filename( int pos ) +{ + int n = g_list_length( info->editlist ); + int i; + for( i = 0; i <= n; i ++ ) + { + el_constr *el = g_list_nth_data( info->editlist, i ); + if(el->pos == pos) + return el->filename; + } + return NULL; +} + +effect_constr* _effect_new( char *effect_line ) +{ + effect_constr *ec; + int descr_len = 0; + int p,q; + char len[4]; + //char line[100]; + int offset = 0; + + veejay_memset(len,0,sizeof(len)); + + if(!effect_line) return NULL; + + strncpy(len, effect_line, 3); + sscanf(len, "%03d", &descr_len); + if(descr_len <= 0) return NULL; + + ec = vj_calloc( sizeof(effect_constr)); + strncpy( ec->description, effect_line+3, descr_len ); + + sscanf(effect_line+(descr_len+3), "%03d%1d%1d%1d%02d", &(ec->id),&(ec->is_video),&(ec->has_rgb),&(ec->is_gen), &(ec->num_arg)); + offset = descr_len + 11; + for(p=0; p < ec->num_arg; p++) + { + int len = 0; + int n = sscanf(effect_line+offset,"%06d%06d%06d%03d", + &(ec->min[p]), &(ec->max[p]),&(ec->defaults[p]),&len ); + if( n <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR,"Parse error in FX list" ); + break; + } + ec->param_description[p] = (char*) vj_calloc(sizeof(char) * (len+1) ); + strncpy( ec->param_description[p], effect_line + offset + 6 + 6 + 6 + 3, len ); + offset += 3; + offset += len; + offset+=18; + } + + for(p=0; p < ec->num_arg; p++) + { + int hint_len = 0; + int n = sscanf( effect_line + offset, "%03d", &hint_len ); + if( n <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR,"Parse error in FX list hints"); + break; + } + + offset += 3; + + if(hint_len == 0) + continue; + + ec->hints[p] = (value_hint*) vj_calloc(sizeof(value_hint)); + ec->hints[p]->description = (char**) vj_calloc(sizeof(char*) * (ec->max[p]+2) ); + for(q = 0; q <= ec->max[p]; q ++ ) + { + int value_hint = 0; + n = sscanf( effect_line + offset, "%03d", &value_hint ); + if( n != 1) { + veejay_msg(VEEJAY_MSG_ERROR,"Parse error in FX list value hint"); + break; + } + + offset += 3; + ec->hints[p]->description[q] = (char*) vj_calloc(sizeof(char) * value_hint + 1 ); + strncpy( ec->hints[p]->description[q], effect_line + offset, value_hint ); + offset += value_hint; + } + } + + return ec; +} + +void _effect_free( effect_constr *effect ) +{ + if(effect) + { + int p; + for( p = 0; p < effect->num_arg; p ++ ) { + free( effect->param_description[p] ); + } + if( effect->hints ) { + for( p = 0; p < effect->num_arg; p ++ ) { + if( effect->hints[p] == NULL ) + continue; + int q; + for( q = 0; effect->hints[p]->description[q] != NULL; q ++ ) { + free( effect->hints[p]->description[q] ); + } + free( effect->hints[p]->description ); + free( effect->hints[p] ); + } + } + + free(effect); + } +} + +void _effect_reset(void) +{ + if( info->effect_info != NULL) + { + int n = g_list_length(info->effect_info); + int i; + for( i = 0; i <=n ; i ++ ) + _effect_free( g_list_nth_data( info->effect_info , i ) ); + g_list_free( info->effect_info ); + info->effect_info = NULL; + } +} + +static gchar *get_relative_path(char *path) +{ + return _utf8str( basename( path )); +} + +gchar *dialog_save_file(const char *title ) +{ + GtkWidget *parent_window = glade_xml_get_widget_(info->main_window, + "gveejay_window" ); + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + GTK_WINDOW(parent_window), + GTK_FILE_CHOOSER_ACTION_SAVE, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, + NULL); +#ifdef HAVE_GTK2_8 + gtk_file_chooser_set_do_overwrite_confirmation( GTK_FILE_CHOOSER(dialog), TRUE ); +#endif + gtk_file_chooser_set_filename( GTK_FILE_CHOOSER(dialog), "veejay-samplelist.sl" ); + + if( gtk_dialog_run( GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + gchar *file = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) ); + gtk_widget_destroy(dialog); + return file; + } + gtk_widget_destroy(dialog); + return NULL; +} + +static void clear_progress_bar( const char *name, gdouble val ) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(w), val ); +} + +static struct +{ + const char *descr; + const char *filter; +} content_file_filters[] = { + { "AVI Files (*.avi)", "*.avi", }, + { "Digital Video Files (*.dv)", "*.dv" }, + { "Edit Decision List Files (*.edl)", "*.edl" }, + { "PNG (Portable Network Graphics) (*.png)", "*.png" }, + { "JPG (Joint Photographic Experts Group) (*.jpg)", "*.jpg" }, + { NULL, NULL }, +}; + +static void add_file_filters(GtkWidget *dialog, int type ) +{ + GtkFileFilter *filter = NULL; + + if(type == 0 ) + { + int i; + for( i = 0; content_file_filters[i].descr != NULL ; i ++ ) + { + filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter, content_file_filters[i].descr); + gtk_file_filter_add_pattern( filter, content_file_filters[i].filter); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter ); + } + } + if(type == 1 ) + { + filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter, "Sample List Files (*.sl)"); + gtk_file_filter_add_pattern( filter, "*.sl"); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter); + } + if(type == 2 ) + { + filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter, "Action Files (*.xml)"); + gtk_file_filter_add_pattern( filter, "*.xml"); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter); + } + if(type == 3 ) + { + filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter, "YUV4MPEG files (*.yuv)"); + gtk_file_filter_add_pattern( filter, "*.yuv" ); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter); + } + + filter = gtk_file_filter_new(); + gtk_file_filter_set_name( filter, "All Files (*.*)"); + gtk_file_filter_add_pattern( filter, "*"); + gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter); +} + + +gchar *dialog_open_file(const char *title, int type) +{ + static gchar *_file_path = NULL; + + GtkWidget *parent_window = glade_xml_get_widget_( + info->main_window, "gveejay_window" ); + GtkWidget *dialog = gtk_file_chooser_dialog_new(title, + GTK_WINDOW(parent_window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + add_file_filters(dialog, type ); + gchar *file = NULL; + if( _file_path ) + { + gtk_file_chooser_set_current_folder_uri(GTK_FILE_CHOOSER(dialog), _file_path); + g_free(_file_path); + _file_path = NULL; + } + + if( gtk_dialog_run( GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) + { + file = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) ); + _file_path = gtk_file_chooser_get_current_folder_uri(GTK_FILE_CHOOSER(dialog)); + } + gtk_widget_destroy(GTK_WIDGET(dialog)); + return file; +} + +static char *produce_os_str() +{ + char os_str[512]; + char cpu_type[32]; + char *simd = vj_calloc( 128 ); +#ifdef ARCH_X86 + sprintf(cpu_type,"x86"); +#endif +#ifdef ARCH_X86_64 + sprintf(cpu_type, "x86-64"); +#endif +#ifdef ARCH_PPC + sprintf(cpu_type, "ppc"); +#endif +#ifdef ARCH_MIPS + sprintf(cpu_type, "mips"); +#endif +#ifdef HAVE_ASM_MMX + strcat( simd, "MMX "); +#endif +#ifdef HAVE_ASM_MMX2 + strcat( simd, "MMX2 "); +#endif +#ifdef HAVE_ASM_SSE + strcat( simd, "SSE " ); +#endif +#ifdef HAVE_ASM_SSE2 + strcat( simd, "SSE2" ); +#endif +#ifdef HAVE_ASM_CMOV + strcat( simd, "cmov" ); +#endif +#ifdef HAVE_ASM_3DNOW + strcat( simd, "3DNow"); +#endif +#ifdef ARCH_PPC +#ifdef HAVE_ALTIVEC + strcat( simd, "altivec"); +#else + strcat( simd, "no optimizations"); +#endif +#endif +#ifdef ARCH_MIPS + strcat( simd, "no optimizations"); +#endif + sprintf(os_str,"Arch: %s with %s", + cpu_type, simd ); + + return strdup( os_str ); +} + +void about_dialog() +{ + const gchar *artists[] = + { + "Matthijs v. Henten (glade, pixmaps) ", + "Dursun Koca (V-logo)", + NULL + }; + + const gchar *authors[] = + { + "Developed by:", + "Matthijs v. Henten ", + "Dursun Koca", + "Niels Elburg ", + "\n", + "Contributions by:", + "Thomas Reinhold ", + "Toni ", + "d/j/a/y (GTK3 port)", + NULL + }; + + const gchar *web = + { + "http://www.veejayhq.net" + }; + + char blob[1024]; + char *os_str = produce_os_str(); + const gchar *donate = + { + "You can donate cryptocoins!\n"\ + "Bitcoin: 1PUNRsv8vDt1upTx9tTpY5sH8mHW1DTrKJ\n" + "or via PayPal: veejayhq@gmail.com\n" + }; + + sprintf(blob, "Veejay - A visual instrument and realtime video sampler for GNU/Linux\n%s\n%s", os_str, donate ); + + free(os_str); + + const gchar *license = + { + "This program is Free Software; You can redistribute it and/or modify\n" \ + "under the terms of the GNU General Public License as published by\n" \ + "the Free Software Foundation; either version 2, or (at your option)\n"\ + "any later version.\n\n"\ + "This program is distributed in the hope it will be useful,\n"\ + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"\ + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"\ + "See the GNU General Public License for more details.\n\n"\ + "For more information , see also: http://www.gnu.org\n" + }; + +#ifdef HAVE_GTK2_6 + char path[MAX_PATH_LEN]; + veejay_memset( path,0, sizeof(path)); + get_gd( path, NULL, "veejay-logo.png" ); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file + ( path, NULL ); + GtkWidget *about = g_object_new( + GTK_TYPE_ABOUT_DIALOG, + "program_name", "reloaded", + "name", VEEJAY_CODENAME, + "version", VERSION, + "copyright", "(C) 2004 - 2015 N. Elburg et all.", + "comments", "The graphical interface for Veejay", + "website", web, + "authors", authors, + "artists", artists, + "comments", blob, + "license", license, + "logo", pixbuf, NULL ); + g_object_unref(pixbuf); + + g_signal_connect( about , "response", G_CALLBACK( gtk_widget_destroy),NULL); + gtk_window_present( GTK_WINDOW( about ) ); +#endif +} + +gboolean dialogkey_snooper( GtkWidget *w, GdkEventKey *event, gpointer user_data) +{ + GtkWidget *entry = (GtkWidget*) user_data; + + if( !gtk_widget_is_focus( entry ) ) + { + return FALSE; + } +#ifdef HAVE_SDL + if(event->type == GDK_KEY_PRESS) + { + gchar tmp[100]; + info->uc.pressed_key = gdk2sdl_key( event->keyval ); + info->uc.pressed_mod = gdk2sdl_mod( event->state ); + gchar *text = gdkkey_by_id( event->keyval ); + gchar *mod = gdkmod_by_id( event->state ); + + if( text ) + { + if(!mod || strncmp(mod, " ", 1 ) == 0 ) + snprintf(tmp, sizeof(tmp),"%s", text ); + else + snprintf(tmp, sizeof(tmp), "%s + %s", mod,text); + + gchar *utf8_text = _utf8str( tmp ); + gtk_entry_set_text( GTK_ENTRY(entry), utf8_text); + g_free(utf8_text); + } + } +#endif + return FALSE; +} + +#ifdef HAVE_SDL +static gboolean key_handler( GtkWidget *w, GdkEventKey *event, gpointer user_data) +{ + if(event->type != GDK_KEY_PRESS) + return FALSE; + + int gdk_keyval = gdk2sdl_key( event->keyval ); + int gdk_state = gdk2sdl_mod( event->state ); + if( gdk_keyval >= 0 && gdk_state >= 0 ) + { + char *message = vims_keys_list[(gdk_state * G_MOD_OFFSET)+gdk_keyval].vims; + if(message) + msg_vims(message); + } + return FALSE; +} +#endif + +static int check_format_string( char *args, char *format ) +{ + if(!format || !args ) + return 0; + char dirty[128]; + int n = sscanf( args, format, &dirty,&dirty, &dirty,&dirty, &dirty,&dirty, &dirty,&dirty, &dirty,&dirty ); + return n; +} + +int prompt_keydialog(const char *title, char *msg) +{ + if(!info->uc.selected_vims_entry ) + return 0; + info->uc.pressed_mod = 0; + info->uc.pressed_key = 0; + + char pixmap[1024]; + veejay_memset(pixmap,0,sizeof(pixmap)); + get_gd( pixmap, NULL, "icon_keybind.png"); + + GtkWidget *mainw = glade_xml_get_widget_(info->main_window, "gveejay_window"); + GtkWidget *dialog = gtk_dialog_new_with_buttons(title, + GTK_WINDOW( mainw ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, + GTK_RESPONSE_REJECT, + GTK_STOCK_OK, + GTK_RESPONSE_ACCEPT, + NULL); + + GtkWidget *keyentry = gtk_entry_new(); + gtk_entry_set_text( GTK_ENTRY(keyentry), ""); + gtk_editable_set_editable( GTK_EDITABLE(keyentry), FALSE ); + gtk_dialog_set_default_response( GTK_DIALOG(dialog), GTK_RESPONSE_REJECT ); + gtk_window_set_resizable( GTK_WINDOW(dialog), FALSE ); + + g_signal_connect(G_OBJECT(dialog), "response", + G_CALLBACK( gtk_widget_hide ), G_OBJECT(dialog ) ); + + GtkWidget *hbox1 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 12 ); + gtk_container_set_border_width( GTK_CONTAINER( hbox1 ), 6 ); + GtkWidget *hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 12 ); + gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 6 ); + + GtkWidget *icon = gtk_image_new_from_file( pixmap ); + + GtkWidget *label = gtk_label_new( msg ); + gtk_container_add( GTK_CONTAINER( hbox1 ), icon ); + gtk_container_add( GTK_CONTAINER( hbox1 ), label ); + gtk_container_add( GTK_CONTAINER( hbox1 ), keyentry ); + + GtkWidget *pentry = NULL; + + if(vj_event_list[ info->uc.selected_vims_entry ].params) + { + //@ put in default args + char *arg_str = vj_event_list[ info->uc.selected_vims_entry ].args; + pentry = gtk_entry_new(); + GtkWidget *arglabel = gtk_label_new("Arguments:"); + + if(arg_str) + gtk_entry_set_text( GTK_ENTRY(pentry), arg_str ); + gtk_editable_set_editable( GTK_EDITABLE(pentry), TRUE ); + gtk_container_add( GTK_CONTAINER(hbox1), arglabel ); + gtk_container_add( GTK_CONTAINER(hbox1), pentry ); + } +#ifdef HAVE_SDL + if( info->uc.selected_vims_entry ) + { + char tmp[100]; + char *str_mod = sdlmod_by_id( info->uc.pressed_mod ); + char *str_key = sdlkey_by_id( info->uc.pressed_key ); + int key_combo_ok = 0; + + if(str_mod && str_key ) + { + snprintf(tmp,100,"VIMS %d : %s + %s", + info->uc.selected_vims_entry, str_mod, str_key ); + key_combo_ok = 1; + }else if ( str_key ) + { + snprintf(tmp, 100,"VIMS %d: %s", info->uc.selected_vims_entry,str_key); + key_combo_ok = 1; + } + + if( key_combo_ok ) + { + gtk_entry_set_text( GTK_ENTRY(keyentry), tmp ); + } + } +#endif + + GtkWidget* content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_add( GTK_CONTAINER(content_area), hbox1 ); + gtk_container_add( GTK_CONTAINER(content_area), hbox2 ); + + gtk_widget_show_all( dialog ); + + int id = gtk_key_snooper_install( dialogkey_snooper, keyentry); + int n = gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_key_snooper_remove( id ); + + if(pentry) + { + gchar *args = (gchar*) gtk_entry_get_text( GTK_ENTRY(pentry)); + int np = check_format_string( args, vj_event_list[ info->uc.selected_vims_entry ].format ); + + if( np == vj_event_list[ info->uc.selected_vims_entry ].params ) + { + if(info->uc.selected_vims_args ) + free(info->uc.selected_vims_args ); + + info->uc.selected_vims_args = strdup( args ); + } + } + + gtk_widget_destroy(dialog); + + return n; +} + +void message_dialog( const char *title, char *msg ) +{ + GtkWidget *mainw = glade_xml_get_widget_(info->main_window, "gveejay_window"); + GtkWidget *dialog = gtk_dialog_new_with_buttons(title, + GTK_WINDOW( mainw ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_OK, + GTK_RESPONSE_NONE, + NULL); + GtkWidget *label = gtk_label_new( msg ); + g_signal_connect_swapped(dialog, "response", + G_CALLBACK(gtk_widget_destroy),dialog); + GtkWidget* content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_container_add(GTK_CONTAINER(content_area), label ); + gtk_widget_show_all(dialog); +} + + +int +prompt_dialog(const char *title, char *msg) +{ + GtkWidget *mainw = glade_xml_get_widget_(info->main_window, "gveejay_window"); + GtkWidget *dialog = gtk_dialog_new_with_buttons(title, + GTK_WINDOW( mainw ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_NO, + GTK_RESPONSE_REJECT, + GTK_STOCK_YES, + GTK_RESPONSE_ACCEPT, + NULL); + gtk_dialog_set_default_response( GTK_DIALOG(dialog), GTK_RESPONSE_REJECT ); + gtk_window_set_resizable( GTK_WINDOW(dialog), FALSE ); + g_signal_connect(G_OBJECT(dialog), "response", + G_CALLBACK( gtk_widget_hide ), G_OBJECT(dialog ) ); + GtkWidget *hbox1 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 12 ); + gtk_container_set_border_width( GTK_CONTAINER( hbox1 ), 6 ); + GtkWidget *icon = gtk_image_new_from_stock( GTK_STOCK_DIALOG_QUESTION, + GTK_ICON_SIZE_DIALOG ); + GtkWidget *label = gtk_label_new( msg ); + gtk_container_add( GTK_CONTAINER( hbox1 ), icon ); + gtk_container_add( GTK_CONTAINER( hbox1 ), label ); + gtk_container_add( GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox1 ); + gtk_widget_show_all( dialog ); + + int n = gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + + return n; +} + + +int +error_dialog(const char *title, char *msg) +{ + GtkWidget *mainw = glade_xml_get_widget_(info->main_window, "gveejay_window"); + GtkWidget *dialog = gtk_dialog_new_with_buttons(title, + GTK_WINDOW( mainw ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_OK, + GTK_RESPONSE_OK, + NULL); + gtk_dialog_set_default_response( GTK_DIALOG(dialog), GTK_RESPONSE_OK ); + gtk_window_set_resizable( GTK_WINDOW(dialog), FALSE ); + g_signal_connect(G_OBJECT(dialog), "response", + G_CALLBACK( gtk_widget_hide ), G_OBJECT(dialog ) ); + GtkWidget *hbox1 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 12 ); + gtk_container_set_border_width( GTK_CONTAINER( hbox1 ), 6 ); + GtkWidget *icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_ERROR, + GTK_ICON_SIZE_DIALOG ); + GtkWidget *label = gtk_label_new( msg ); + gtk_container_add( GTK_CONTAINER( hbox1 ), icon ); + gtk_container_add( GTK_CONTAINER( hbox1 ), label ); + gtk_container_add( GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox1 ); + gtk_widget_show_all( dialog ); + + int n = gtk_dialog_run(GTK_DIALOG(dialog)); + + gtk_widget_destroy(dialog); + + return n; +} + +void veejay_quit( ) +{ + if( prompt_dialog("Quit veejay", "Close Veejay ? All unsaved work will be lost." ) + == GTK_RESPONSE_REJECT ) + return; + single_vims( 600 ); + +// clear_progress_bar( "cpumeter",0.0 ); + clear_progress_bar( "connecting",0.0 ); + clear_progress_bar( "samplerecord_progress",0.0 ); + clear_progress_bar( "streamrecord_progress",0.0 ); + clear_progress_bar( "seq_rec_progress",0.0); + exit(0); +} + +static int running_g_ = 1; +static int restart_ = 0; + +int gveejay_restart() +{ + return restart_; +} + +gboolean gveejay_running() +{ + if(!running_g_) + return FALSE; + return TRUE; +} + +gboolean gveejay_relaunch() +{ + return (info->watch.state == STATE_QUIT ? FALSE: TRUE); +} + +gboolean gveejay_quit( GtkWidget *widget, gpointer user_data) +{ + if(!running_g_) + return FALSE; + + if( info->watch.state == STATE_PLAYING) + { + if( prompt_dialog("Quit Reloaded", "Are you sure?" ) == GTK_RESPONSE_REJECT) + return TRUE; + } + + running_g_ = 0; + info->watch.state = STATE_QUIT; + + return FALSE; +} + +/* Free the slot */ +static void free_slot( sample_slot_t *slot ) +{ + if(slot) + { + if(slot->title) free(slot->title); + if(slot->timecode) free(slot->timecode); + free(slot); + } + slot = NULL; +} + +/* Allocate some memory and create a temporary slot */ +sample_slot_t *create_temporary_slot( gint slot_id, gint id, gint type, gchar *title, gchar *timecode ) +{ + sample_slot_t *slot = (sample_slot_t*) vj_calloc(sizeof(sample_slot_t)); + if(id>0) + { + slot->sample_id = id; + slot->sample_type = type; + slot->timecode = strduplastn(timecode); + //slot->title = strduplastn(title); + slot->title = strdup(title); + slot->slot_number = slot_id; + } + return slot; +} + +int is_current_track(char *host, int port ) +{ + char *remote = get_text( "entry_hostname" ); + int num = get_nums( "button_portnum" ); + if( strncasecmp( remote, host, strlen(host)) == 0 && port == num ) + return 1; + return 0; +} + +void gveejay_popup_err( const char *type, char *msg ) +{ + message_dialog( type, msg ); +} + +void donatenow(); +void reportbug(); +void update_gui(); + +int veejay_get_sample_image(int id, int type, int wid, int hei) +{ + multi_vims( VIMS_GET_SAMPLE_IMAGE, "%d %d %d %d", id, type, wid, hei ); + uint8_t *data_buffer = (uint8_t*) vj_malloc( sizeof(uint8_t) * RUP8(wid * hei * 3)); + int sample_id = 0; + int sample_type =0; + gint bw = 0; + gchar *data = recv_vims_args( 12, &bw, &sample_id, &sample_type ); + if( data == NULL || bw <= 0 ) + { + veejay_msg(VEEJAY_MSG_WARNING, "Can't get a preview image! Only got %d bytes", bw); + if( data_buffer ) + free(data_buffer); + if( data ) + free(data); + return 0; + } + + int expected_len = (wid * hei); + expected_len += (wid*hei/4); + expected_len += (wid*hei/4); + + if( bw != expected_len ) + { + if(data_buffer) + free(data_buffer); + if( data ) + free(data); + return 0; + } + + uint8_t *in = (uint8_t*)data; + uint8_t *out = data_buffer; + + VJFrame *src1 = yuv_yuv_template( in, in + (wid * hei), in + (wid * hei) + (wid*hei)/4,wid,hei,PIX_FMT_YUV420P ); + VJFrame *dst1 = yuv_rgb_template( out, wid,hei,PIX_FMT_BGR24 ); + + yuv_convert_any_ac( src1, dst1, src1->format, dst1->format ); + + GdkPixbuf *img = gdk_pixbuf_new_from_data(out, + GDK_COLORSPACE_RGB, + FALSE, + 8, + wid, + hei, + wid*3, + NULL, + NULL ); + + if( img == NULL ) + return 0; + +/* int poke_slot= 0; int bank_page = 0; + verify_bank_capacity( &bank_page , &poke_slot, sample_id, sample_type); + if(bank_page >= 0 ) + { + if( info->sample_banks[bank_page]->slot[poke_slot]->sample_id <= 0 ) + { + sample_slot_t *tmp_slot = create_temporary_slot(poke_slot,sample_id,sample_type, "PREVIEW","00:00:00" ); + add_sample_to_sample_banks(bank_page, tmp_slot ); + free_slot(tmp_slot); +} + } */ + + sample_slot_t *slot = find_slot_by_sample( sample_id, sample_type ); + sample_gui_slot_t *gui_slot = find_gui_slot_by_sample( sample_id, sample_type ); + + if( slot && gui_slot ) + { + slot->pixbuf = vj_gdk_pixbuf_scale_simple(img,wid,hei, GDK_INTERP_NEAREST); + if( slot->pixbuf) + { + gtk_image_set_from_pixbuf_( GTK_IMAGE( gui_slot->image ), slot->pixbuf ); + g_object_unref( slot->pixbuf ); + slot->pixbuf = NULL; + } + } + + free(data_buffer); + free(data); + g_object_unref(img); + + free(src1); + free(dst1); + + + return bw; +} + +void gveejay_new_slot(int mode) +{ + if( mode == MODE_STREAM ) { + info->uc.expected_num_streams = info->uc.real_num_streams + 1; + } + else { + info->uc.expected_num_samples = info->uc.real_num_samples + 1; + } +} + +#include "callback.c" +enum +{ + COLOR_RED=0, + COLOR_BLUE=1, + COLOR_GREEN=2, + COLOR_BLACK=3, + COLOR_NUM +}; + +void vj_msg(int type, const char format[], ...) +{ + if( type == VEEJAY_MSG_DEBUG && vims_verbosity == 0 ) + return; + + char tmp[1024]; + char buf[1024]; + char prefix[20]; + va_list args; + + va_start( args,format ); + vsnprintf( tmp, sizeof(tmp), format, args ); + + switch(type) + { + case 2: + sprintf(prefix,"Info : "); + break; + case 1: + sprintf(prefix,"Warning: "); + break; + case 0: + sprintf(prefix,"Error : "); + break; + case 3: + sprintf(prefix,"Debug : "); + break; + case 4: + sprintf(prefix, " "); + break; + } + + snprintf(buf, sizeof(buf), "%s %s\n",prefix,tmp ); + gsize nr,nw; + gchar *text = g_locale_to_utf8( buf, -1, &nr, &nw, NULL); + text[strlen(text)-1] = '\0'; + + GtkWidget *sb = glade_xml_get_widget_( info->main_window, "statusbar"); + gtk_statusbar_push( GTK_STATUSBAR(sb),0, text ); + + g_free( text ); + va_end(args); +} + +void msg_vims(char *message) +{ + if(!info->client) + return; + int n = vj_client_send(info->client, V_CMD, (unsigned char*)message); + if( n <= 0 ) + reloaded_schedule_restart(); +} + +int get_loop_value() +{ + if( is_button_toggled( "loop_none" ) ) + return 0; + + if( is_button_toggled( "loop_normal" )) + return 1; + + if( is_button_toggled( "loop_pingpong" )) + return 2; + + if (is_button_toggled("loop_random")) + return 3; + + if( is_button_toggled( "loop_oncenop" )) + return 4; + + return 1; // loop normal +} + +static void multi_vims(int id, const char format[],...) +{ + char block[1024]; + char tmp[1024]; + va_list args; + if(!info->client) + return; + va_start(args, format); + vsnprintf(tmp, sizeof(tmp)-1, format, args ); + snprintf(block, sizeof(block)-1, "%03d:%s;",id,tmp); + va_end(args); + + if(vj_client_send( info->client, V_CMD, (unsigned char*) block)<=0 ) + reloaded_schedule_restart(); +} + +static void single_vims(int id) +{ + char block[10]; + if(!info->client) + return; + sprintf(block, "%03d:;",id); + if(vj_client_send( info->client, V_CMD, (unsigned char*) block)<=0 ) + reloaded_schedule_restart(); +} + +static gchar *recv_vims_args(int slen, int *bytes_written, int *arg0, int *arg1) +{ + int tmp_len = slen+1; + unsigned char tmp[tmp_len]; + veejay_memset(tmp,0,sizeof(tmp)); + int ret = vj_client_read( info->client, V_CMD, tmp, slen ); + if( ret == -1 ) + reloaded_schedule_restart(); + int len = 0; + if( sscanf( (char*)tmp, "%06d", &len ) != 1 ) + return NULL; + if( sscanf( (char*)tmp + 6, "%04d", arg0 ) != 1 ) + return NULL; + if( sscanf( (char*)tmp + 10, "%02d", arg1) != 1 ) + return NULL; + unsigned char *result = NULL; + if( ret <= 0 || len <= 0 || slen <= 0) + return (gchar*)result; + result = (unsigned char*) vj_calloc(sizeof(unsigned char) * RUP8(len + 1 + 16) ); + *bytes_written = vj_client_read( info->client, V_CMD, result, len ); + if( *bytes_written == -1 ) + reloaded_schedule_restart(); + return (gchar*) result; +} + +static gchar *recv_vims(int slen, int *bytes_written) +{ + int tmp_len = slen+1; + unsigned char tmp[tmp_len]; + veejay_memset(tmp,0,sizeof(tmp)); + int ret = vj_client_read( info->client, V_CMD, tmp, slen ); + if( ret == -1 ) + reloaded_schedule_restart(); + int len = 0; + if( sscanf( (char*)tmp, "%d", &len ) != 1 ) + return NULL; + unsigned char *result = NULL; + if( ret <= 0 || len <= 0 || slen <= 0) + return (gchar*)result; + result = (unsigned char*) vj_calloc(sizeof(unsigned char) * (len + 1) ); + *bytes_written = vj_client_read( info->client, V_CMD, result, len ); + if( *bytes_written == -1 ) + reloaded_schedule_restart(); + return (gchar*) result; +} + +static gdouble get_numd(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name); + if(!w) return 0; + return (gdouble) gtk_spin_button_get_value( GTK_SPIN_BUTTON( w ) ); +} + +static int get_slider_val(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) return 0; + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + return (gint) gtk_adjustment_get_value (a); +} + +static void vj_kf_reset() +{ + reset_curve( info->curve ); + set_toggle_button( "curve_chain_toggleentry", 0 ); + set_toggle_button( "curve_toggleentry_param", 0); + update_label_str( "curve_parameter",FX_PARAMETER_DEFAULT_NAME); +} + +/* not used +static int vj_kf_is_displayed() +{ + GtkWidget *ww = glade_xml_get_widget_( info->main_window, "notebook18" ); + int deckpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(ww)); + if(deckpage == 1) + return 1; + return 0; +} +*/ + +static void vj_kf_refresh() +{ + int *entry_tokens = &(info->uc.entry_tokens[0]); + if( entry_tokens[ENTRY_FXID] > 0 ) { + enable_widget( "frame_fxtree3" ); + update_curve_widget(info->curve); + } + else { + set_toggle_button( "curve_toggleentry_param", 0 ); + disable_widget( "frame_fxtree3" ); + vj_kf_reset(); + } +} + +static void vj_kf_select_parameter(int num) +{ + sample_slot_t *s = info->selected_slot; + if(!s) + { + update_label_str( "curve_parameter", FX_PARAMETER_DEFAULT_NAME); + return; + } + int *entry_tokens = &(info->uc.entry_tokens[0]); + + info->uc.selected_parameter_id = num; + + gchar *name = _utf8str(_effect_get_param_description(entry_tokens[ENTRY_FXID],info->uc.selected_parameter_id)); + update_label_str( "curve_parameter", name ); + g_free(name); + + reset_curve( info->curve ); + update_curve_widget( info->curve ); +} + +static void update_curve_widget(GtkWidget *curve) +{ + sample_slot_t *s = info->selected_slot; + if(!s ) return; + int i = info->uc.selected_chain_entry; /* chain entry */ + int id = info->uc.entry_tokens[ENTRY_FXID]; + int blen = 0; + int lo = 0, hi = 0, curve_type=0; + int p = -1; + int status = 0; + + multi_vims( VIMS_SAMPLE_KF_GET, "%d %d",i,info->uc.selected_parameter_id ); + + unsigned char *blob = (unsigned char*) recv_vims( 8, &blen ); + if( blob && blen > 0 ) + { + p = set_points_in_curve_ext( curve, blob,id,i, &lo,&hi, &curve_type,&status ); + if( p >= 0 ) + { + info->uc.selected_parameter_id = p; + switch( curve_type ) + { + case GTK3_CURVE_TYPE_SPLINE: + set_toggle_button( "curve_typespline", 1 ); + break; + case GTK3_CURVE_TYPE_FREE: + set_toggle_button( "curve_typefreehand",1 ); + break; + default: set_toggle_button( "curve_typelinear", 1 ); + break; + } + set_toggle_button( "curve_toggleentry_param", status ); + } + } + + if( lo == hi && hi == 0 ) + { + if( info->status_tokens[PLAY_MODE] == MODE_SAMPLE ) + { + lo = info->status_tokens[SAMPLE_START]; + hi = info->status_tokens[SAMPLE_END]; + } + else + { + lo = 0; + hi = info->status_tokens[SAMPLE_MARKER_END]; + } + } + update_spin_range( "curve_spinstart", lo, hi, lo ); + update_spin_range( "curve_spinend", lo, hi, hi ); + if(blob) free(blob); +} + +/* Not used +static void update_curve_accessibility(const char *name) +{ + sample_slot_t *s = info->selected_slot; + if(!s ) return; + + if( info->status_tokens[PLAY_MODE] == MODE_PLAIN ) + { + disable_widget( "frame_fxtree3" ); + } + else + { + enable_widget( "frame_fxtree3" ); + } +} +*/ + +static int get_nums(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (spin): '%s'",name); + return 0; + } + return (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON( w ) ); +} + +static int count_textview_buffer(const char *name) +{ + GtkWidget *view = glade_xml_get_widget_( info->main_window, name ); + if(view) + { + GtkTextBuffer *tb = NULL; + tb = gtk_text_view_get_buffer( GTK_TEXT_VIEW(view) ); + return gtk_text_buffer_get_char_count( tb ); + } + return 0; +} + +static void clear_textview_buffer(const char *name) +{ + GtkWidget *view = glade_xml_get_widget_( info->main_window, name ); + if(!view) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (textview): '%s'",name); + return; + } + if(view) + { + GtkTextBuffer *tb = NULL; + tb = gtk_text_view_get_buffer( GTK_TEXT_VIEW(view) ); + GtkTextIter iter1,iter2; + gtk_text_buffer_get_start_iter( tb, &iter1 ); + gtk_text_buffer_get_end_iter( tb, &iter2 ); + gtk_text_buffer_delete( tb, &iter1, &iter2 ); + } +} + +static gchar *get_textview_buffer(const char *name) +{ + GtkWidget *view = glade_xml_get_widget_( info->main_window,name ); + if(!view) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (textview): '%s'",name); + return NULL; + } + if(view) + { + GtkTextBuffer *tb = NULL; + tb = gtk_text_view_get_buffer( GTK_TEXT_VIEW(view) ); + GtkTextIter iter1,iter2; + + gtk_text_buffer_get_start_iter(tb, &iter1); + gtk_text_buffer_get_end_iter( tb, &iter2); + gchar *res = gtk_text_buffer_get_text( tb, &iter1,&iter2 , TRUE ); + return res; + } + return NULL; +} + +static void set_textview_buffer(const char *name, gchar *utf8text) +{ + GtkWidget *view = glade_xml_get_widget_( info->main_window, name ); + if(!view) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (textview): '%s'",name); + return; + } + if(view) + { + GtkTextBuffer *tb = gtk_text_view_get_buffer( + GTK_TEXT_VIEW(view) ); + gtk_text_buffer_set_text( tb, utf8text, -1 ); + } +} + +static gchar *get_text(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (text): '%s'",name); + return NULL; + } + return (gchar*) gtk_entry_get_text( GTK_ENTRY(w)); +} + +static void put_text(const char *name, char *text) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (text): '%s'",name); + return; + } + if(w) + { + gchar *utf8_text = _utf8str( text ); + gtk_entry_set_text( GTK_ENTRY(w), utf8_text ); + g_free(utf8_text); + } +} + +int is_button_toggled(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (togglebutton): '%s'",name); + return 0; + } + + if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(w) ) == TRUE ) + return 1; + return 0; +} +static void set_toggle_button(const char *name, int status) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (togglebutton): '%s'",name); + return; + } + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), (status==1 ? TRUE: FALSE)); + +} + + +static void update_slider_gvalue(const char *name, gdouble value) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (slider): '%s'",name); + return; + } + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gtk_adjustment_set_value( a, value ); +} + +static void update_slider_value(const char *name, gint value, gint scale) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (slider): '%s'",name); + return; + } + gdouble gvalue; + if(scale) + gvalue = (gdouble) value / (gdouble) scale; + else + gvalue = (gdouble) value; + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gtk_adjustment_set_value( a, gvalue ); +} + +static void update_spin_incr( const char *name, gdouble step, gdouble page ) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (spin): '%s'",name); + return; + } +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_DEBUG, "SpinButton: %s, step=%g,page=%g",name,step,page); +#endif + gtk_spin_button_set_increments(GTK_SPIN_BUTTON(w),step,page ); +} + +static void update_spin_range(const char *name, gint min, gint max, gint val) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (spin): '%s'",name); + return; + } + + gtk_spin_button_set_range( GTK_SPIN_BUTTON(w), (gdouble)min, (gdouble) max ); + gtk_spin_button_set_value( GTK_SPIN_BUTTON(w), (gdouble)val); +} + +/*static int get_mins(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) return 0; + GtkAdjustment *adj = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON(w) ); + return (int) adj->lower; +} + +static int get_maxs(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) return 0; + GtkAdjustment *adj = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON(w) ); + return (int) adj->upper; +}*/ + +static void update_spin_value(const char *name, gint value ) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (spin): '%s'",name); + return; + } +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_DEBUG, "SpinButton: %s, value=%d",name,value); +#endif + + gtk_spin_button_set_value( GTK_SPIN_BUTTON(w), (gdouble) value ); +} + +static void update_slider_range(const char *name, gint min, gint max, gint value, gint scaled) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, name ); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (slider): '%s'",name); + return; + } + + if(min == max) { + return; + } + + GtkRange *range = GTK_RANGE(w); + if(!scaled) + { + gtk_range_set_range(range, (gdouble) min, (gdouble) max ); + gtk_range_set_value(range, value ); + } + else + { + gdouble gmin =0.0; + gdouble gmax =100.0; + gdouble gval = gmax / value; + gtk_range_set_range(range, gmin, gmax); + gtk_range_set_value(range, gval ); + } + + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( w )); + gtk_range_set_adjustment(range, a ); +} + +static void update_label_i(const char *name, int num, int prefix) +{ + GtkWidget *label = glade_xml_get_widget_( + info->main_window, name); + if(!label) { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (label): '%s'",name); + return; + } + char str[20]; + if(prefix) + g_snprintf( str,sizeof(str), "%09d", num ); + else + g_snprintf( str,sizeof(str), "%d", num ); + gchar *utf8_value = _utf8str( str ); + gtk_label_set_text( GTK_LABEL(label), utf8_value); + g_free( utf8_value ); +} + +static void update_label_f(const char *name, float val ) +{ + GtkWidget *label = glade_xml_get_widget_( info->main_window, name); + if(!label) + { + veejay_msg(VEEJAY_MSG_ERROR, "No such widget (label): '%s'",name); + return; + } + char value[10]; + snprintf( value, sizeof(value)-1, "%2.2f", val ); + + gchar *utf8_value = _utf8str( value ); + gtk_label_set_text( GTK_LABEL(label), utf8_value ); + g_free(utf8_value); +} + +static void update_label_str(const char *name, gchar *text) +{ + GtkWidget *label = glade_xml_get_widget_( + info->main_window, name); +#ifdef STRICT_CHECKING + if(!label) veejay_msg(VEEJAY_MSG_ERROR, "No such widget (label): '%s'",name); + assert( label != NULL ); +#else + if(!label ||!text) return; +#endif + gchar *utf8_text = _utf8str( text ); + if(!utf8_text) return; + gtk_label_set_text( GTK_LABEL(label), utf8_text); + g_free(utf8_text); +} + +static void label_set_markup(const char *name, gchar *str) +{ + GtkWidget *label = glade_xml_get_widget_( + info->main_window, name); + if(!label) + return; + + gtk_label_set_markup( GTK_LABEL(label), str ); +} + +static void selection_get_paths(GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, gpointer data) +{ + GSList **paths = data; + *paths = g_slist_prepend(*paths, gtk_tree_path_copy(path)); +} + +GSList *gui_tree_selection_get_paths(GtkTreeView *view) +{ + GtkTreeSelection *sel; + GSList *paths; + + /* get paths of selected rows */ + paths = NULL; + sel = gtk_tree_view_get_selection(view); + gtk_tree_selection_selected_foreach(sel, selection_get_paths, &paths); + + return paths; +} + +static void update_colorselection() +{ + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "colorselection"); + GdkColor color; + + color.red = 255 * info->status_tokens[STREAM_COL_R]; + color.green = 255 * info->status_tokens[STREAM_COL_G]; + color.blue = 255 * info->status_tokens[STREAM_COL_B]; + + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( colorsel ), + &color ); +} + +int resize_primary_ratio_y() +{ + float ratio = (float)info->el.width / (float)info->el.height; + float result = (float) get_nums( "priout_width" ) / ratio; + return (int) result; +} + +int resize_primary_ratio_x() +{ + float ratio = (float)info->el.height / (float)info->el.width; + float result = (float) get_nums( "priout_height" ) / ratio; + return (int) result; +} + +static void update_rgbkey() +{ + if(!info->entry_lock) + { + info->entry_lock =1; + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "rgbkey"); + GdkColor color; + /* update from entry tokens (delivered by GET_CHAIN_ENTRY */ + int *p = &(info->uc.entry_tokens[0]); + + color.red = 255 * p[ENTRY_P1]; + color.green = 255 * p[ENTRY_P2]; + color.blue = 255 * p[ENTRY_P3]; + + gtk_color_selection_set_current_color( + GTK_COLOR_SELECTION( colorsel ), + &color ); + info->entry_lock = 0; + } +} + +static void update_rgbkey_from_slider() +{ + if(!info->entry_lock) + { + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "rgbkey"); + info->entry_lock = 1; + GdkColor color; + + color.red = 255 * ( get_slider_val( "slider_p1" ) ); + color.green = 255 * ( get_slider_val( "slider_p2" ) ); + color.blue = 255 * ( get_slider_val( "slider_p3" ) ); + + gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( colorsel ), + &color ); + info->entry_lock = 0; + } +} + +int update_gveejay() +{ + return vj_midi_handle_events( info->midi ); +} + +static GdkPixbuf *update_pixmap_entry( int status ) +{ + char path[MAX_PATH_LEN]; + char filename[MAX_PATH_LEN]; + + snprintf(filename,sizeof(filename), "fx_entry_%s.png", + ( status == 1 ? "on" : "off" )); + get_gd(path,NULL, filename); + + GError *error = NULL; + GdkPixbuf *icon = gdk_pixbuf_new_from_file(path, &error); + if(error) + return 0; + return icon; +} + +static gboolean chain_update_row(GtkTreeModel * model, + GtkTreePath * path, + GtkTreeIter * iter, + gpointer data) +{ + vj_gui_t *gui = (vj_gui_t*) data; + if(!gui->selected_slot) + return FALSE; + int entry = info->uc.selected_chain_entry; + gint gentry = 0; + gtk_tree_model_get (model, iter, + FXC_ID, &gentry, -1); + + if(gentry == entry) + { + int effect_id = gui->uc.entry_tokens[ ENTRY_FXID ]; + if( effect_id <= 0 ) + { + gtk_list_store_set( GTK_LIST_STORE(model),iter, FXC_ID, entry, -1 ); + disable_widget( "fx_m1" ); + disable_widget( "fx_m2" ); + disable_widget( "fx_m3" ); + disable_widget( "fx_m4" ); + } + else + { + gchar *descr = _utf8str( _effect_get_description( effect_id )); + char tmp[128]; + if( _effect_get_mix( effect_id ) ) + { + snprintf(tmp,sizeof(tmp),"%s %d", (gui->uc.entry_tokens[ENTRY_SOURCE] == 0 ? "Sample " : "T " ), + gui->uc.entry_tokens[ENTRY_CHANNEL]); + enable_widget( "fx_m4" ); + enable_widget( "fx_m3" ); + enable_widget( "transition_enabled" ); + enable_widget( "transition_loop" ); + enable_widget( "subrender_entry_toggle" ); + } + else + { + snprintf(tmp,sizeof(tmp),"%s"," "); + disable_widget( "fx_m4" ); + disable_widget( "fx_m3" ); + disable_widget( "transition_enabled" ); + disable_widget( "transition_loop" ); + disable_widget( "subrender_entry_toggle" ); + } + + gchar *mixing = _utf8str(tmp); + GdkPixbuf *toggle = update_pixmap_entry( gui->uc.entry_tokens[ENTRY_VIDEO_ENABLED] ); + GdkPixbuf *kf_toggle = update_pixmap_entry( gui->uc.entry_tokens[ENTRY_KF_STATUS] ); + GdkPixbuf *subrender_toggle = update_pixmap_entry( gui->uc.entry_tokens[ENTRY_SUBRENDER_ENTRY]); + gtk_list_store_set( GTK_LIST_STORE(model),iter, + FXC_ID, entry, + FXC_FXID, descr, + FXC_FXSTATUS, toggle, + FXC_KF, kf_toggle, + FXC_MIXING, mixing, + FXC_SUBRENDER, subrender_toggle, + -1 ); + g_free(descr); + g_free(mixing); + g_object_unref( kf_toggle ); + g_object_unref( toggle ); + g_object_unref( subrender_toggle ); + + enable_widget( "fx_m1" ); + enable_widget( "fx_m2" ); + + /* if( gui->uc.entry_tokens[FADE_METHOD] <= 1 || + gui->uc.entry_tokens[FADE_ENTRY] != info->uc.selected_chain_entry ) + set_toggle_button( "fx_mnone",1 ); */ + + } + } + return FALSE; +} + +/* Cut from global_info() + This function updates the sample/stream editor if the current playing stream/sample + matches with the selected sample slot */ +static void update_record_tab(int pm) +{ + if(pm == MODE_STREAM) + { + update_spin_value( "spin_streamduration" , 1 ); + gint n_frames = get_nums( "spin_streamduration" ); + char *time = format_time(n_frames, (double) info->el.fps); + update_label_str( "label_streamrecord_duration", time ); + free(time); + } + if(pm == MODE_SAMPLE) + { + update_spin_value( "spin_sampleduration", 1 ); + // combo_samplecodec + gint n_frames = sample_calctime(); + char *time = format_time( n_frames,(double) info->el.fps ); + update_label_str( "label_samplerecord_duration", time ); + free(time); + } +} + +static void update_current_slot(int *history, int pm, int last_pm) +{ + gint update = 0; + gint fx_anim = 0; + + if( pm != last_pm || info->status_tokens[CURRENT_ID] != history[CURRENT_ID] ) + { + int k; + update = 1; + update_record_tab( pm ); + + if( info->status_tokens[STREAM_TYPE] == STREAM_VIDEO4LINUX ) + { + info->uc.reload_hint[HINT_V4L] = 1; + for(k = 0; capt_card_set[k].name != NULL; k ++ ) + { + show_widget( capt_card_set[k].name ); + show_widget( capt_label_set[k].name ); + } + } + else + { + for(k = 0; capt_card_set[k].name != NULL ; k ++ ) + { + hide_widget( capt_card_set[k].name ); + hide_widget( capt_label_set[k].name ); + } + } + + switch(info->status_tokens[STREAM_TYPE]) + { + case STREAM_GENERATOR: + show_widget("frame_fxtree1"); + enable_widget("frame_fxtree1"); + hide_widget("notebook16"); + break; + case STREAM_WHITE: + hide_widget("frame_fxtree1"); + disable_widget("frame_fxtree1"); + show_widget("notebook16"); + notebook_set_page("notebook16",1 ); + break; + case STREAM_VIDEO4LINUX: + hide_widget("frame_fxtree1"); + disable_widget("frame_fxtree1"); + show_widget("notebook16"); + notebook_set_page("notebook16",0 ); + break; + default: + hide_widget( "frame_fxtree1"); + disable_widget("frame_fxtree1"); + hide_widget( "notebook16"); + break; + } + + info->uc.reload_hint[HINT_HISTORY] = 1; + info->uc.reload_hint[HINT_CHAIN] = 1; + info->uc.reload_hint[HINT_ENTRY] = 1; + + put_text( "entry_samplename", "" ); + set_pm_page_label( info->status_tokens[CURRENT_ID], pm ); + + fx_anim = 1; + } + if( info->status_tokens[CURRENT_ENTRY] != history[CURRENT_ENTRY] || + info->uc.reload_hint[HINT_ENTRY] == 1 ) + { + info->uc.selected_chain_entry = info->status_tokens[CURRENT_ENTRY]; + if(info->uc.selected_chain_entry < 0 || info->uc.selected_chain_entry >= MAX_CHAIN_LEN ) + info->uc.selected_chain_entry = 0; + info->uc.reload_hint[HINT_ENTRY] = 1; + load_parameter_info(); + if( info->status_tokens[CURRENT_ENTRY] != history[CURRENT_ENTRY] ) + update_label_str( "value_friendlyname",FX_PARAMETER_VALUE_DEFAULT_HINT ); + fx_anim = 1; + } + + /* Actions for stream */ + if( ( info->status_tokens[CURRENT_ID] != history[CURRENT_ID] || pm != last_pm ) && pm == MODE_STREAM ) + { + /* Is a solid color stream */ + if( info->status_tokens[STREAM_TYPE] == STREAM_WHITE ) + { + if( ( history[STREAM_COL_R] != info->status_tokens[STREAM_COL_R] ) || + ( history[STREAM_COL_G] != info->status_tokens[STREAM_COL_G] ) || + ( history[STREAM_COL_B] != info->status_tokens[STREAM_COL_B] ) ) + { + info->uc.reload_hint[HINT_RGBSOLID] = 1; + } + } + + if( info->status_tokens[STREAM_TYPE] == STREAM_GENERATOR ) + { + info->uc.reload_hint[HINT_GENERATOR] = 1; + } + + char *time = format_time( info->status_frame,(double)info->el.fps ); + update_label_str( "label_curtime", time ); + free(time); + fx_anim = 1; + update_label_str( "playhint", "Streaming"); + } + + /* Actions for sample */ + if( pm == MODE_SAMPLE ) + { + int marker_go = 0; + /* Update marker bounds */ + if( (history[SAMPLE_MARKER_START] != info->status_tokens[SAMPLE_MARKER_START]) ) + { + update = 1; + gint nm = info->status_tokens[SAMPLE_MARKER_START]; + if(nm >= 0) + { + gdouble in = (1.0 / (gdouble)info->status_tokens[TOTAL_FRAMES]) * nm; + timeline_set_in_point( info->tl, in ); + marker_go = 1; + } + else + { + if(pm == MODE_SAMPLE) + { + timeline_set_in_point( info->tl, 0.0 ); + marker_go = 1; + } + } + char *dur = format_time( info->status_tokens[SAMPLE_MARKER_END] - info->status_tokens[SAMPLE_MARKER_START], + (double)info->el.fps ); + update_label_str( "label_markerduration", dur ); + free(dur); + } + + if( (history[SAMPLE_MARKER_END] != info->status_tokens[SAMPLE_MARKER_END]) ) + { + gint nm = info->status_tokens[SAMPLE_MARKER_END]; + if(nm > 0 ) + { + gdouble out = (1.0/ (gdouble)info->status_tokens[TOTAL_FRAMES]) * nm; + + timeline_set_out_point( info->tl, out ); + marker_go = 1; + } + else + { + if(pm == MODE_SAMPLE) + { + timeline_set_out_point(info->tl, 1.0 ); + marker_go = 1; + } + } + update = 1; + } + + if( marker_go ) + { + info->uc.reload_hint[HINT_MARKER] = 1; + } + + if( history[SAMPLE_LOOP] != info->status_tokens[SAMPLE_LOOP]) + { + switch( info->status_tokens[SAMPLE_LOOP] ) + { + case 0: + set_toggle_button( "loop_none", 1 ); + break; + case 1: + set_toggle_button( "loop_normal", 1 ); + break; + case 2: + set_toggle_button("loop_pingpong", 1 ); + break; + case 3: + set_toggle_button("loop_random", 1 ); + break; + case 4: + set_toggle_button("loop_oncenop", 1 ); + break; + } + } + + gint speed = info->status_tokens[SAMPLE_SPEED]; + + if( history[SAMPLE_SPEED] != info->status_tokens[SAMPLE_SPEED] ) + { + speed = info->status_tokens[SAMPLE_SPEED]; + update_slider_value( "speed_slider", speed, 0 ); + + if( speed < 0 ) info->play_direction = -1; else info->play_direction = 1; + if( speed < 0 ) speed *= -1; + update_spin_value( "spin_samplespeed", speed); + + if( pm == MODE_SAMPLE ) { + if( speed == 0 ) + update_label_str( "playhint", "Paused" ); + else + update_label_str( "playhint", "Playing"); + } + } + + if( history[FRAME_DUP] != info->status_tokens[FRAME_DUP] ) + { + update_spin_value( "spin_framedelay", info->status_tokens[FRAME_DUP]); + update_slider_value("slow_slider", info->status_tokens[FRAME_DUP],0); + } + + /* veejay keeps sample limits , dont use update_spin_range for spin_samplestart and spin_sampleend */ + if( (history[SAMPLE_START] != info->status_tokens[SAMPLE_START] || get_nums("spin_samplestart") != info->status_tokens[SAMPLE_START])) + { + update = 1; + } + if( (history[SAMPLE_END] != info->status_tokens[SAMPLE_END] || get_nums("spin_sampleend") != info->status_tokens[SAMPLE_END]) ) + { + update = 1; + } + + if( (history[SUBRENDER] != info->status_tokens[SUBRENDER] || is_button_toggled( "toggle_subrender") != info->status_tokens[SUBRENDER]) ) + { + set_toggle_button( "toggle_subrender", info->status_tokens[SUBRENDER] ); + } + + if( history[FADE_ALPHA] != info->status_tokens[FADE_ALPHA] || info->status_tokens[FADE_ALPHA] != is_button_toggled( "toggle_fademethod" )) + { + set_toggle_button( "toggle_fademethod", info->status_tokens[FADE_ALPHA]); + } + + if( info->status_tokens[FADE_ENTRY] >= 0 ) + { + if( info->status_tokens[FADE_METHOD] == 0 && !is_button_toggled( "fx_mnone" )) + { + set_toggle_button( "fx_mmone", 1 ); + } else if (info->status_tokens[FADE_METHOD] == 1 && !is_button_toggled( "fx_m1" )) + { + set_toggle_button( "fx_m1",1 ); + } else if (info->status_tokens[FADE_METHOD] == 2 && !is_button_toggled( "fx_m2" )) + { + set_toggle_button( "fx_m2",1 ); + } else if (info->status_tokens[FADE_METHOD] == 3 && !is_button_toggled( "fx_m3" )) + { + set_toggle_button( "fx_m3",1); + } else if (info->status_tokens[FADE_METHOD] == 4 && !is_button_toggled( "fx_m4" )) + { + set_toggle_button( "fx_m4",1); + } + } else + { + set_toggle_button( "fx_mnone", 1 ); + } + + if(update) + { + speed = info->status_tokens[SAMPLE_SPEED]; + if(speed < 0 ) info->play_direction = -1; else info->play_direction = 1; + + gint len = info->status_tokens[SAMPLE_END] - info->status_tokens[SAMPLE_START]; + + int speed = info->status_tokens[SAMPLE_SPEED]; + if(speed < 0 ) info->play_direction = -1; else info->play_direction = 1; + if(speed < 0 ) speed *= -1; + + update_spin_range( "spin_samplespeed", -1 * len, len, speed ); + + update_spin_value( "spin_samplestart", info->status_tokens[SAMPLE_START]); + update_spin_value( "spin_sampleend", info->status_tokens[SAMPLE_END]); + + gint n_frames = sample_calctime(); + + timeline_set_length( info->tl, + (gdouble) n_frames , info->status_tokens[FRAME_NUM]- info->status_tokens[SAMPLE_START] ); + + update_spin_range( "spin_text_start", 0, n_frames ,0); + update_spin_range( "spin_text_end", 0, n_frames,n_frames ); + + } + } + + if( pm == MODE_SAMPLE|| pm == MODE_STREAM ) + if( history[CHAIN_FADE] != info->status_tokens[CHAIN_FADE] ) + { + double val = (double) info->status_tokens[CHAIN_FADE]; + update_slider_value( "manualopacity", val,0 ); + } + + if( fx_anim ) { + set_toggle_button("kf_none",1); + reset_curve(info->curve); + } +} + + +static void on_vims_messenger (void) +{ + GtkTextIter start, end; + GtkTextBuffer* buffer; + GtkTextView* t= NULL; + gchar *str = NULL; + static int wait = 0; + t = GTK_TEXT_VIEW(GTK_WIDGET(glade_xml_get_widget_ + (info->main_window,"vims_messenger_textview"))); + buffer = gtk_text_view_get_buffer(t); + + if(info->vims_line >= gtk_text_buffer_get_line_count(buffer)) + { + info->vims_line = 0; + } + + if(is_button_toggled( "vims_messenger_play" )) + { + if(wait) + { + wait--; + } + else + { + gtk_text_buffer_get_iter_at_line(buffer, &start, info->vims_line); + end = start; + + gtk_text_iter_forward_sentence_end(&end); + str = gtk_text_buffer_get_text (buffer, &start, &end, TRUE); + + if(strlen(str) <= 0) { + vj_msg(VEEJAY_MSG_INFO, "Nothing to do at line %d", info->vims_line); + info->vims_line++; + return; + } + + if(str[0] == '+') + { + str[0] = ' '; + g_strstrip(str); + wait = atoi(str); + vj_msg(VEEJAY_MSG_INFO, "Next VIMS message in %d frames", wait); + } + else + { + msg_vims( str ); + vj_msg(VEEJAY_MSG_INFO, "Sent VIMS message '%s' (line %d)",str, info->vims_line ); + } + info->vims_line++; + } + } +} + +static int total_frames_ = 0; + +int get_total_frames() +{ + return total_frames_; +} +/* +static char *bugbuffer_ = NULL; +static int bugoffset_ = 0; + +gboolean capture_data (GIOChannel *source, GIOCondition condition, gpointer data ) +{ + int fd = g_io_channel_unix_get_fd( source ); + GIOStatus ret; + GError *err = NULL; + gchar *msg; + gsize len; + + if (condition & G_IO_HUP) + g_error ("Read end of pipe died!\n"); + + ret = g_io_channel_read_line (source, &msg, &len, NULL, &err); + if (ret == G_IO_STATUS_ERROR) + g_error ("Error reading: %s\n", err->message); + + memcpy( bugbuffer_ + (sizeof(char) * bugoffset_) , msg , len ); + + bugoffset_ += len; + + g_free (msg); + return TRUE; +} +*/ +void reportbug () +{ + char l[3] = { 'e','n', '\0'}; + char *lang = getenv("LANG"); + char URL[1024]; + + if(lang) { + l[0] = lang[0]; + l[1] = lang[1]; + } +/* char veejay_homedir[1024]; + char body[1024]; + char subj[100]; + gchar **argv = (gchar**) malloc ( sizeof(gchar*) * 5 ); + int i; + argv[0] = malloc( sizeof(char) * 100 ); + memset( argv[0], 0, sizeof(char) * 100 ); + argv[2] = NULL; + +// snprintf(subj,sizeof(subj),"reloaded %s has a problem", VERSION); + snprintf(veejay_homedir, sizeof(veejay_homedir),"%s/.veejay/", home ); + sprintf(argv[0], "%s/report_problem.sh" ,veejay_homedir); + argv[1] = strdup( veejay_homedir ); + + if( bugoffset_ > 0 ) { + free(bugbuffer_); + bugoffset_= 0; + bugbuffer_ = NULL; + } + +// GError error = NULL; + gint stdout_pipe = 0; + gint pid =0; + gboolean ret = g_spawn_async_with_pipes( + NULL, + argv, + NULL, + G_SPAWN_LEAVE_DESCRIPTORS_OPEN & G_SPAWN_STDERR_TO_DEV_NULL, + NULL, + NULL, + &pid, + NULL, + &stdout_pipe, + NULL, + NULL ); + if( !ret ) { + veejay_msg(VEEJAY_MSG_ERROR, "Error executing bug report tool"); + return; + } + + GIOChannel *chan = g_io_channel_unix_new( stdout_pipe ); + bugbuffer_ = (char*) malloc(sizeof(char) * 32000 ); + memset(bugbuffer_, 0, sizeof(char) * 32000); + guint retb = g_io_add_watch( chan, G_IO_IN, capture_data, NULL ); +*/ +// if( prompt_dialog("Report a problem", "" ) +// == GTK_RESPONSE_ACCEPT ) + snprintf(URL , sizeof(URL), + "firefox \"http://groups.google.com/group/veejay-discussion/post?hl=%s\" &",l ); + + puts(URL); + + if( system(URL) <= 0 ) { + veejay_msg(VEEJAY_MSG_ERROR, "Unable to open browser to veejay homepage"); + } +} + +void donatenow() +{ + char URL[512]; + snprintf(URL , sizeof(URL), + "firefox \"http://www.veejayhq.net/contributing\" &" ); + + if( system(URL) <= 0 ) { + veejay_msg(VEEJAY_MSG_ERROR, "Unable to open browser to veejay homepage"); + } +} + +static void reset_fxtree() +{ + int i; + for(i = 0; i < 3; i ++ ) + { + gtk_list_store_clear(fxlist_data.stores[i].list); + } + +} + +static void reset_tree(const char *name) +{ + GtkWidget *tree_widget = glade_xml_get_widget_( info->main_window,name ); + GtkTreeModel *tree_model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree_widget) ); + + + if(GTK_IS_TREE_MODEL_SORT(tree_model)) { + GtkTreeModel *child_model = gtk_tree_model_sort_get_model( GTK_TREE_MODEL_SORT(tree_model) ); + + gtk_list_store_clear( GTK_LIST_STORE( child_model ) ); + } + else { + if( GTK_IS_LIST_STORE(tree_model) ) { +/*! + * invalidate selection callback to prevent undesirable calls, clear the list + * and finally restore selection callback. + */ + GtkTreeSelection *selection; + GtkTreeSelectionFunc selection_func; + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_widget)); + selection_func = gtk_tree_selection_get_select_function(selection); + gtk_tree_selection_set_select_function(selection, NULL, NULL, NULL); + gtk_list_store_clear(GTK_LIST_STORE(tree_model)); + gtk_tree_selection_set_select_function(selection, selection_func, NULL, NULL); + } + else { + veejay_msg(0,"%s: wrong tree model type" ,__FUNCTION__); + } + } +} + +// load effect controls + +gboolean view_entry_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gint name = 0; + + gtk_tree_model_get(model, &iter, FXC_ID, &name, -1); + if (!path_currently_selected && name != info->uc.selected_chain_entry) + { + multi_vims( VIMS_CHAIN_SET_ENTRY, "%d", name ); + if( !is_button_toggled( "fx_mnone" )) { + multi_vims( VIMS_CHAIN_FADE_ENTRY,"%d %d",0, name ); + } + update_label_i( "label_fxentry", name, 0 ); + vj_midi_learning_vims_msg( info->midi, NULL, VIMS_CHAIN_SET_ENTRY,name ); + return TRUE; /*the state of the node may be toggled*/ + } + return TRUE; + } + + return FALSE; /* the state of the node should be left unchanged */ +} + +gboolean cali_sources_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gchar *name = NULL; + + if( info->uc.cali_stage != 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "%d", info->uc.cali_stage); + return TRUE; + } + + gtk_tree_model_get(model, &iter, FXC_ID, &name, -1); + + if (!path_currently_selected) + { + gint id = 0; + sscanf(name+1, "[ %d]", &id); + if(name[0] != 'S') + { + cali_stream_id = id; + update_label_str("current_step_label","Please take an image with the cap on the lens."); + GtkWidget *nb = glade_xml_get_widget_(info->main_window, "cali_notebook"); + gtk_notebook_next_page( GTK_NOTEBOOK(nb)); + } + if(name) g_free(name); + } + } + return TRUE; /* allow selection state to change */ +} + +gboolean view_sources_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gchar *name = NULL; + + gtk_tree_model_get(model, &iter, FXC_ID, &name, -1); + + if (!path_currently_selected) + { + gint id = 0; + sscanf(name+1, "[ %d]", &id); + if(name[0] == 'S') + { + info->uc.selected_mix_sample_id = id; + info->uc.selected_mix_stream_id = 0; + } + else + { + info->uc.selected_mix_sample_id = 0; + info->uc.selected_mix_stream_id = id; + } + } + + if(name) g_free(name); + } + + return TRUE; /* allow selection state to change */ +} + +static void cell_data_func_dev (GtkTreeViewColumn *col, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + gpointer data) +{ + gchar buf[32]; + GValue val = {0, }; + gtk_tree_model_get_value(model, iter, V4L_SPINBOX, &val); + g_snprintf(buf, sizeof(buf), "%.0f",g_value_get_float(&val)); + g_object_set(cell, "text", buf, NULL); +} + +static void on_dev_edited (GtkCellRendererText *celltext, + const gchar *string_path, + const gchar *new_text, + gpointer data) +{ + GtkTreeModel *model = GTK_TREE_MODEL(data); + GtkTreeIter iter; + gfloat oldval = 0.0; + gfloat newval = 0.0; + + gtk_tree_model_get_iter_from_string(model, &iter, string_path); + + gtk_tree_model_get(model, &iter, V4L_SPINBOX, &oldval, -1); + if (sscanf(new_text, "%f", &newval) != 1) + g_warning("in %s: problem converting string '%s' into float.\n", __FUNCTION__, new_text); + + gtk_list_store_set(GTK_LIST_STORE(model), &iter, V4L_SPINBOX, newval, -1); +} + + +static void setup_tree_spin_column( const char *tree_name, int type, const char *title) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, tree_name ); + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + renderer = gui_cell_renderer_spin_new(0.0, 3.0 , 1.0, 1.0, 1.0, 1.0, 0.0); + column = gtk_tree_view_column_new(); + gtk_tree_view_column_set_title(column, title ); + gtk_tree_view_column_pack_start(column, renderer, TRUE); + gtk_tree_view_column_set_cell_data_func( column, renderer, + cell_data_func_dev, NULL,NULL ); + gtk_tree_view_append_column( GTK_TREE_VIEW(tree), column); + g_object_set(renderer, "editable", TRUE, NULL); + + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + g_signal_connect(renderer, "edited", G_CALLBACK(on_dev_edited), model ); + +} + +static void setup_tree_text_column( const char *tree_name, int type, const char *title,int len ) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, tree_name ); + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + renderer = gtk_cell_renderer_text_new(); + column = gtk_tree_view_column_new_with_attributes( title, renderer, "text", type, NULL ); + gtk_tree_view_append_column( GTK_TREE_VIEW( tree ), column ); + + if(len) + { + veejay_msg(VEEJAY_MSG_DEBUG, "Tree %s ,Title %s, width=%d", tree_name,title, len ); + gtk_tree_view_column_set_min_width( column, len); + } +} + +static void setup_tree_pixmap_column( const char *tree_name, int type, const char *title ) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, tree_name ); + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; + + renderer = gtk_cell_renderer_pixbuf_new(); + column = gtk_tree_view_column_new_with_attributes( title, renderer, "pixbuf", type, NULL ); + gtk_tree_view_append_column( GTK_TREE_VIEW( tree ), column ); +} + +void server_files_selection_func (GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + model = gtk_tree_view_get_model(treeview); + + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gchar *name = NULL; + gtk_tree_model_get(model, &iter, 0, &name, -1); + + multi_vims(VIMS_EDITLIST_ADD_SAMPLE, "0 %s" , name ); + vj_msg(VEEJAY_MSG_INFO, "Tried to open %s",name); + g_free(name); + } +} + +void generators_selection_func(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + model = gtk_tree_view_get_model(treeview); + + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gchar *name = NULL; + gtk_tree_model_get(model, &iter, 0, &name, -1); + + multi_vims(VIMS_STREAM_NEW_GENERATOR, "0 %s" , name ); + vj_msg(VEEJAY_MSG_INFO, "Tried to open %s",name); + g_free(name); + + gveejay_new_slot(MODE_STREAM); + + gtk_widget_hide( glade_xml_get_widget_(info->main_window, "generator_window") ); + } +} + +static void setup_generators() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "generators"); + GtkListStore *store = gtk_list_store_new( 1, G_TYPE_STRING ); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + g_object_unref( G_OBJECT( store )); + + setup_tree_text_column( "generators", 0, "Filename",0 ); + + g_signal_connect( tree, "row-activated", (GCallback) generators_selection_func, NULL); +} + +static void setup_server_files(void) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "server_files"); + GtkListStore *store = gtk_list_store_new( 1, G_TYPE_STRING ); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + g_object_unref( G_OBJECT( store )); + + setup_tree_text_column( "server_files", 0, "Filename",0 ); + + g_signal_connect( tree, "row-activated", (GCallback) server_files_selection_func, NULL); +} + +static void load_v4l_info() +{ + int values[21]; + int len = 0; + + veejay_memset(values,-1,sizeof(values)); + + multi_vims( VIMS_STREAM_GET_V4L, "%d", (info->selected_slot == NULL ? 0 : info->selected_slot->sample_id )); + gchar *answer = recv_vims(3, &len); + if(len > 0 && answer ) + { + int res = sscanf(answer, "%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d%05d", + &values[0],&values[1],&values[2],&values[3],&values[4],&values[5], + &values[6],&values[7],&values[8],&values[9],&values[10],&values[11], + &values[12],&values[13],&values[14],&values[15],&values[16],&values[17],&values[18],&values[19],&values[20]); + if(res < 21 ) + { + free(answer); + return; + } + + int i; + int n = CAPT_CARD_SLIDERS; + for(i = 0; i < n; i ++ ) + { + if( values[i] < 0 ) { + hide_widget( capt_card_set[i].name ); + hide_widget( capt_label_set[i].name ); + } + else { + show_widget( capt_card_set[i].name ); + show_widget( capt_label_set[i].name); + update_slider_gvalue( capt_card_set[i].name, (gdouble)values[i]/65535.0 ); + } + } + n += CAPT_CARD_BOOLS; + for( ; i < n; i ++ ) { + if( values[i] < 0 ) { + hide_widget( capt_card_set[i].name ); + hide_widget( capt_label_set[i].name ); + } + else { + show_widget( capt_card_set[i].name ); + show_widget( capt_label_set[i].name); + set_toggle_button( capt_card_set[i].name, values[i] ); + } + } + free(answer); + } +} + +static gint load_parameter_info() +{ + int *p = &(info->uc.entry_tokens[0]); + int len = 0; + int i = 0; + + veejay_memset( p, 0, sizeof(info->uc.entry_tokens)); + + multi_vims( VIMS_CHAIN_GET_ENTRY, "%d %d", 0, info->uc.selected_chain_entry ); + + gchar *answer = recv_vims(3,&len); + if(len <= 0 || answer == NULL ) + { + if(answer) free(answer); + veejay_memset(p,0,sizeof(info->uc.entry_tokens)); + if(info->uc.selected_rgbkey ) + disable_widget("rgbkey"); + return 0; + } + + char *ptr; + char *token = strtok_r( answer," ", &ptr ); + if(!token) { + veejay_msg(VEEJAY_MSG_ERROR,"Invalid reply from %d", VIMS_CHAIN_GET_ENTRY ); + return 0; + } + p[i] = atoi(token); + while( (token = strtok_r( NULL, " ", &ptr ) ) != NULL ) + { + i++; + p[i] = atoi( token ); + } + + info->uc.selected_rgbkey = _effect_get_rgb( p[0] ); + if(info->uc.selected_rgbkey) + { + enable_widget( "rgbkey"); + update_rgbkey(); + } + else + { + disable_widget( "rgbkey"); + info->uc.selected_rgbkey = 0; + } + + set_toggle_button( "curve_chain_toggleentry", p[ENTRY_KF_STATUS] ); +//FIXME: +/* + if(info->status_tokens[PLAY_MODE] == MODE_SAMPLE ) + { + update_spin_range( "curve_spinstart", + info->status_tokens[SAMPLE_START], + info->status_tokens[SAMPLE_END], p[ENTRY_KF_START] ); + update_spin_range( "curve_spinend", info->status_tokens[SAMPLE_START], + info->status_tokens[SAMPLE_END] ,p[ENTRY_KF_END] ); + } + else + { + int nl = info->status_tokens[SAMPLE_MARKER_END]; + update_spin_range( "curve_spinstart", 0, nl, p[ENTRY_KF_START] ); + update_spin_range( "curve_spinend", 0,nl, p[ENTRY_KF_END] ); + }*/ + + update_label_str( "curve_parameter", FX_PARAMETER_DEFAULT_NAME); + + switch( p[ENTRY_KF_TYPE] ) + { + case GTK3_CURVE_TYPE_SPLINE: + set_toggle_button( "curve_typespline", 1 ); + break; + case GTK3_CURVE_TYPE_FREE: + set_toggle_button( "curve_typefreehand",1 ); + break; + default: + case GTK3_CURVE_TYPE_LINEAR: + set_toggle_button( "curve_typelinear", 1 ); + break; + break; + } + + + set_toggle_button("subrender_entry_toggle", p[ENTRY_SUBRENDER_ENTRY]); + update_spin_value("transition_loop", p[ENTRY_TRANSITION_LOOP] ); + set_toggle_button("transition_enabled", p[ENTRY_TRANSITION_ENABLED] ); + + free(answer); + return 1; +} + +static void load_generator_info() +{ + int args[GENERATOR_PARAMS+1]; + gint fxlen = 0; + multi_vims( VIMS_GET_STREAM_ARGS,"%d",0 ); + gchar *fxtext = recv_vims(3,&fxlen); + + veejay_memset(args,0,sizeof(args)); + generator_to_arr(fxtext, args); + + int np = _effect_get_np( args[0] ); + int i; + + for( i = 0; i < np ; i ++ ) + { + enable_widget( gen_box_names_[i].text ); + + gchar *tt1 = _utf8str(_effect_get_param_description( args[0],i)); + set_tooltip( gen_names_[i].text, tt1 ); + + gint min=0,max=0,value = 0; + value = args[1 + i]; + + if( _effect_get_minmax( args[0], &min,&max, i )) + { + update_slider_range( gen_names_[i].text,min,max, value, 0); + } + g_free(tt1); + } + + for( i = np; i < GENERATOR_PARAMS; i ++ ) + { + gint min = 0, max = 1, value = 0; + update_slider_range( gen_names_[i].text, min,max, value, 0 ); + + disable_widget( gen_box_names_[i].text ); + set_tooltip( gen_names_[i].text, NULL ); + } + + free(fxtext); +} + +/****************************************************** + * get_col_number_from_tree_view_column() + * + * Returns column number or -1 if not found or on error + ******************************************************/ +/* Actually not used +gint get_treeview_col_number_from_column (GtkTreeViewColumn *col) +{ + GList *cols; + gint num; + + g_return_val_if_fail ( col != NULL, -1 ); + g_return_val_if_fail ( col->tree_view != NULL, -1 ); + + cols = gtk_tree_view_get_columns(GTK_TREE_VIEW(col->tree_view)); + num = g_list_index(cols, (gpointer) col); + g_list_free(cols); + + return num; +} +*/ + +/****************************************************** + * + * EFFECT CHAIN + * + ******************************************************/ + +/****************************************************** + * setup_effectchain_info() + * setup tree effect chain model and selection mode + * + ******************************************************/ +static void setup_effectchain_info( void ) +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_chain"); + GtkListStore *store = gtk_list_store_new( FXC_N_COLS, G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF,GDK_TYPE_PIXBUF,G_TYPE_STRING, GDK_TYPE_PIXBUF ); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + g_object_unref( G_OBJECT( store )); + + setup_tree_text_column( "tree_chain", FXC_ID, "#",0 ); + setup_tree_text_column( "tree_chain", FXC_FXID, "Effect",0 ); //FIXME + setup_tree_pixmap_column( "tree_chain", FXC_FXSTATUS, "Run"); + setup_tree_pixmap_column( "tree_chain", FXC_KF , "Anim" ); // TODO parameter interpolation on/off per entry + setup_tree_text_column( "tree_chain", FXC_MIXING, "Channel",0); + setup_tree_pixmap_column( "tree_chain", FXC_SUBRENDER, "Subrender"); + GtkTreeSelection *selection; + + // selection stuff + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + gtk_tree_selection_set_select_function(selection, view_entry_selection_func, NULL, NULL); + + // signal stuff (button press) + g_signal_connect(GTK_TREE_VIEW(tree), "button-press-event", + (GCallback) on_effectchain_button_pressed, NULL); +} + + +/****************************************************** + * load_effectchain_info() + * load effect chain from server (VIMS transmition) + * to the fx chain tree view + * + ******************************************************/ +static void load_effectchain_info() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_chain"); + + set_tooltip_by_widget (tree, tooltips[TOOLTIP_FXCHAINTREE].text); + + GtkListStore *store; + gchar toggle[4]; + guint arr[VIMS_CHAIN_LIST_ENTRY_VALUES]; + GtkTreeIter iter; + gint offset=0; + + gint fxlen = 0; + multi_vims( VIMS_CHAIN_LIST,"%d",0 ); + gchar *fxtext = recv_vims(3,&fxlen); + + reset_tree( "tree_chain" ); + update_label_str( "value_friendlyname",FX_PARAMETER_VALUE_DEFAULT_HINT ); + + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + store = GTK_LIST_STORE(model); + + // no fx, clean list and return + if(fxlen <= 0 ) + { + int i; + for( i = 0; i < SAMPLE_MAX_EFFECTS; i ++ ) + { + gtk_list_store_append(store,&iter); + gtk_list_store_set(store,&iter, FXC_ID, i ,-1); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + } + return; + } + + if(fxlen == 5 ) + offset = fxlen; + + gint last_index =0; + + while( offset < fxlen ) + { + char line[VIMS_CHAIN_LIST_ENTRY_LENGTH+1]; + veejay_memset(arr,0,sizeof(arr)); + veejay_memset(line,0,sizeof(line)); + + strncpy( line, fxtext + offset, VIMS_CHAIN_LIST_ENTRY_LENGTH ); + int n_tokens = sscanf( line, VIMS_CHAIN_LIST_ENTRY_FORMAT, + &arr[0],&arr[1],&arr[2],&arr[3],&arr[4],&arr[5],&arr[6], &arr[7], &arr[8]); + if( n_tokens != VIMS_CHAIN_LIST_ENTRY_VALUES ) { + veejay_msg(0,"Error parsing FX chain response"); + break; + } + + // clean list until next entry + while( last_index < arr[0] ) + { + gtk_list_store_append( store, &iter ); + gtk_list_store_set( store, &iter, FXC_ID, last_index,-1); + last_index ++; + } + + // time to fill current entry + char *name = _effect_get_description( arr[1] ); + snprintf(toggle,sizeof(toggle),"%s",arr[3] == 1 ? "on" : "off" ); + + if( last_index == arr[0]) + { + gchar *utf8_name = _utf8str( name ); + char tmp[128]; + if( _effect_get_mix( arr[1] ) ) { + snprintf(tmp,sizeof(tmp),"%s %d", (arr[5] == 0 ? "Sample " : "T " ), + arr[6]); + } + else { + snprintf(tmp,sizeof(tmp),"%s"," "); + } + gchar *mixing = _utf8str(tmp); + + gtk_list_store_append( store, &iter ); + GdkPixbuf *toggle = update_pixmap_entry( arr[3] ); + GdkPixbuf *kf_togglepf = update_pixmap_entry( arr[7] ); + GdkPixbuf *subrender_toggle = update_pixmap_entry(arr[8]); + gtk_list_store_set( store, &iter, + FXC_ID, arr[0], + FXC_FXID, utf8_name, + FXC_FXSTATUS, toggle, + FXC_KF, kf_togglepf, + FXC_MIXING,mixing, + FXC_SUBRENDER, subrender_toggle, -1 ); + last_index ++; + g_free(utf8_name); + g_free(mixing); + g_object_unref( toggle ); + g_object_unref( kf_togglepf ); + g_object_unref( subrender_toggle ); + } + offset += VIMS_CHAIN_LIST_ENTRY_LENGTH; + } + + // finally clean list end + while( last_index < SAMPLE_MAX_EFFECTS ) + { + gtk_list_store_append( store, &iter ); + gtk_list_store_set( store, &iter, + FXC_ID, last_index , -1 ); + last_index ++; + } + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + free(fxtext); +} + + +/****************************************************** + * + * EFFECTS LISTS + * + ******************************************************/ + +enum +{ +// FX_ID = 0, + FX_STRING = 0, + FX_NUM, +}; + +gboolean view_fx_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gchar *name = NULL; + gtk_tree_model_get(model, &iter, FX_STRING, &name, -1); + + if (!path_currently_selected) + { + int value = 0; + vevo_property_get( fx_list_, name, 0, &value ); + if(value) + { + info->uc.selected_effect_id = value; + } + } + g_free(name); + } + + return TRUE; /* allow selection state to change */ +} + +static guint effectlist_add_mask = 0; +static const guint FXLIST_ADD_DISABLED = 1 << 1; +static const guint FXLIST_ADD_TO_SELECTED = 1 << 2; + +gboolean on_effectlist_row_key_pressed (GtkWidget *widget, GdkEventKey *event, gpointer user_data) +{ + if(event->type & GDK_KEY_PRESS){ + switch(event->keyval){ + case GDK_KEY_Shift_L: + effectlist_add_mask |= FXLIST_ADD_DISABLED; + break; + case GDK_KEY_Control_L: + effectlist_add_mask |= FXLIST_ADD_TO_SELECTED; + break; + } + } + return FALSE; +} + +gboolean on_effectlist_row_key_released (GtkWidget *widget, GdkEventKey *event, gpointer user_data) +{ + if(event->type & GDK_KEY_RELEASE){ + switch(event->keyval){ + case GDK_KEY_Shift_L: + effectlist_add_mask &= !(FXLIST_ADD_DISABLED); + break; + case GDK_KEY_Control_L: + effectlist_add_mask &= !(FXLIST_ADD_TO_SELECTED); + break; + } + } + return FALSE; +} + +void on_effectlist_row_activated(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + model = gtk_tree_view_get_model(treeview); + + if(gtk_tree_model_get_iter(model,&iter,path)) { + gint gid =0; + gchar *name = NULL; + gtk_tree_model_get(model,&iter, FX_STRING, &name, -1); + if(vevo_property_get( fx_list_, name, 0, &gid ) == 0 ) { + guint slot = 0; + if((effectlist_add_mask & FXLIST_ADD_TO_SELECTED) && info->selection_slot) + slot = info->selection_slot->sample_id; + multi_vims(VIMS_CHAIN_ENTRY_SET_EFFECT, "%d %d %d %d", + slot, info->uc.selected_chain_entry,gid, !(effectlist_add_mask & FXLIST_ADD_DISABLED) ); + info->uc.reload_hint[HINT_ENTRY] = 1; + char trip[100]; + snprintf(trip,sizeof(trip), "%03d:%d %d %d %d;", VIMS_CHAIN_ENTRY_SET_EFFECT,slot,info->uc.selected_chain_entry, gid, !(effectlist_add_mask & FXLIST_ADD_DISABLED) ); + vj_midi_learning_vims( info->midi, NULL, trip, 0 ); + update_label_str( "value_friendlyname", FX_PARAMETER_VALUE_DEFAULT_HINT ); + info->uc.reload_hint[HINT_CHAIN] = 1; + } + g_free(name); + } +} + +gint sort_iter_compare_func( GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer userdata) +{ + gint sortcol = GPOINTER_TO_INT(userdata); + gint ret = 0; + + if(sortcol == FX_STRING) + { + gchar *name1=NULL; + gchar *name2=NULL; + gtk_tree_model_get(model,a, FX_STRING, &name1, -1 ); + gtk_tree_model_get(model,b, FX_STRING, &name2, -1 ); + if( name1 == NULL || name2 == NULL ) + { + if( name1==NULL && name2==NULL) + { + return 0; + } + ret = (name1 == NULL) ? -1 : 1; + } + else + { + ret = g_utf8_collate(name1,name2); + } + if(name1) g_free(name1); + if(name2) g_free(name2); + } + return ret; +} + +gint sort_vims_func(GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer userdata) +{ + gint sortcol = GPOINTER_TO_INT(userdata); + gint ret = 0; + + if(sortcol == VIMS_ID) + { + gchar *name1 = NULL; + gchar *name2 = NULL; + + gtk_tree_model_get(model,a, VIMS_ID, &name1, -1 ); + gtk_tree_model_get(model,b, VIMS_ID, &name2, -1 ); + if( name1 == NULL || name2 == NULL ) + { + if( name1==NULL && name2== NULL) + { + return 0; + } + ret = (name1==NULL) ? -1 : 1; + } + else + { + ret = g_utf8_collate(name1,name2); + } + if(name1) g_free(name1); + if(name2) g_free(name2); + } + return ret; +} + + +//EffectListData* get_effectlistdata + +static gboolean effect_row_visible (GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) +{ + effectlist_data *fxlistdata = (effectlist_data*) user_data; + gboolean value=TRUE; + if(fxlistdata != NULL && fxlistdata->filter_string != NULL) { + if(strlen(fxlistdata->filter_string)) { + value=FALSE; + gchar *idstr = NULL; + gtk_tree_model_get(model, iter, SL_ID, &idstr, -1); + if((idstr != NULL) && strcasestr(idstr, fxlistdata->filter_string) != NULL) { + value = TRUE; + } + g_free (idstr); + } + } + return value; +} + + +/****************************************************** + * setup_effectlist_info() + * prepare the views of effects lists + * + * Three treeview : fxlist mixlist, alphalist + * + ******************************************************/ +void setup_effectlist_info() +{ + int i; + GtkWidget *trees[3]; + trees[0] = glade_xml_get_widget_( info->main_window, "tree_effectlist"); + trees[1] = glade_xml_get_widget_( info->main_window, "tree_effectmixlist"); + trees[2] = glade_xml_get_widget_( info->main_window, "tree_alphalist" ); + + set_tooltip_by_widget (trees[0], tooltips[TOOLTIP_FXSELECT].text); + set_tooltip_by_widget (trees[1], tooltips[TOOLTIP_FXSELECT].text); + set_tooltip_by_widget (trees[2], tooltips[TOOLTIP_FXSELECT].text); + + fx_list_ = (vevo_port_t*) vpn( 200 ); + + for(i = 0; i < 3; i ++ ) + { + fxlist_data.stores[i].list = gtk_list_store_new( 1, G_TYPE_STRING ); + + fxlist_data.stores[i].filtered = GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (GTK_TREE_MODEL (fxlist_data.stores[i].list), NULL)); + fxlist_data.stores[i].sorted = GTK_TREE_MODEL_SORT (gtk_tree_model_sort_new_with_model (GTK_TREE_MODEL (fxlist_data.stores[i].filtered))); + + fxlist_data.filter_string = NULL; + gtk_tree_model_filter_set_visible_func (fxlist_data.stores[i].filtered, + effect_row_visible, + &fxlist_data, NULL); + + GtkTreeSortable *sortable = GTK_TREE_SORTABLE(fxlist_data.stores[i].list); + gtk_tree_sortable_set_sort_func(sortable, FX_STRING, + sort_iter_compare_func, + GINT_TO_POINTER(FX_STRING),NULL); + + gtk_tree_sortable_set_sort_column_id(sortable, FX_STRING, GTK_SORT_ASCENDING); + gtk_tree_view_set_headers_visible( GTK_TREE_VIEW(trees[i]), FALSE ); + + gtk_tree_view_set_model( GTK_TREE_VIEW(trees[i]),GTK_TREE_MODEL( fxlist_data.stores[i].sorted)); + g_object_unref( G_OBJECT( fxlist_data.stores[i].list )); + } + + setup_tree_text_column( "tree_effectlist", FX_STRING, "Effect",0 ); + setup_tree_text_column( "tree_effectmixlist", FX_STRING, "Effect",0 ); + setup_tree_text_column( "tree_alphalist", FX_STRING, "Alpha",0); + + for(i = 0; i < 3; i ++ ) + { + g_signal_connect( trees[i],"row-activated", (GCallback) on_effectlist_row_activated, NULL ); + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(trees[i])); + gtk_tree_selection_set_select_function(selection, view_fx_selection_func, NULL, NULL); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + + g_signal_connect( G_OBJECT(trees[i]), "key_press_event", G_CALLBACK( on_effectlist_row_key_pressed ), NULL ); + g_signal_connect( G_OBJECT(trees[i]), "key-release-event", G_CALLBACK( on_effectlist_row_key_released ), NULL ); + } + + GtkWidget *entry_filterfx = glade_xml_get_widget_( info->main_window, "filter_effects"); + set_tooltip_by_widget (entry_filterfx, tooltips[TOOLTIP_FXFILTER].text); + g_signal_connect(G_OBJECT(entry_filterfx), + "changed", + G_CALLBACK( on_filter_effects_changed ), + &fxlist_data ); + +} + +void set_feedback_status() +{ + int len = 0; + single_vims(VIMS_GET_FEEDBACK); + gchar *answer = recv_vims(3,&len); + if(answer == NULL) + return; + + int status = atoi(answer); + + set_toggle_button("feedbackbutton", status); + + g_free(answer); +} + +/****************************************************** + * load_effectlist_info() + * load the effects information from the server + * (VIMS transmission) to the treeviews + * + ******************************************************/ +void load_effectlist_info() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_effectlist"); + GtkWidget *tree2 = glade_xml_get_widget_( info->main_window, "tree_effectmixlist"); + GtkWidget *tree3 = glade_xml_get_widget_( info->main_window, "tree_alphalist"); + GtkListStore *store,*store2,*store3; + char line[4096]; + + GtkTreeIter iter; + gint i,offset=0; + gint fxlen = 0; + single_vims( VIMS_EFFECT_LIST ); + gchar *fxtext = recv_vims(6,&fxlen); + + _effect_reset(); + + reset_fxtree(); + + store = fxlist_data.stores[0].list; + store2 = fxlist_data.stores[1].list; + store3 = fxlist_data.stores[2].list; + + while( offset < fxlen ) + { + char tmp_len[4]; + veejay_memset(tmp_len,0,sizeof(tmp_len)); + strncpy(tmp_len, fxtext + offset, 3 ); + int len = atoi(tmp_len); + offset += 3; + if(len > 0) + { + effect_constr *ec; + veejay_memset( line,0,sizeof(line)); + strncpy( line, fxtext + offset, len ); + + ec = _effect_new(line); + if(ec) info->effect_info = g_list_append( info->effect_info, ec ); + } + offset += len; + } + + fxlen = g_list_length( info->effect_info ); + for( i = 0; i < fxlen; i ++) + { + effect_constr *ec = g_list_nth_data( info->effect_info, i ); + if( ec->is_gen ) + continue; + gchar *name = _utf8str( _effect_get_description( ec->id ) ); + + if( name != NULL) + { + // tree_alphalist + if( strncasecmp( "alpha:" , ec->description, 6 ) == 0 ) + { + gtk_list_store_append( store3, &iter ); + int len = strlen( ec->description ); + char *newName = vj_calloc( len ); + veejay_memcpy(newName,ec->description+6, len-6 ); + gtk_list_store_set( store3,&iter, FX_STRING, newName, -1 ); + vevo_property_set( fx_list_, newName, VEVO_ATOM_TYPE_INT,1,&(ec->id)); + free(newName); + } + else + { + // tree_effectmixlist + if( _effect_get_mix(ec->id) > 0 ) + { + gtk_list_store_append( store2, &iter ); + gtk_list_store_set( store2, &iter, FX_STRING, name, -1 ); + vevo_property_set( fx_list_, name, VEVO_ATOM_TYPE_INT, 1, &(ec->id)); + } + else + { + // tree_effectlist + gtk_list_store_append( store, &iter ); + gtk_list_store_set( store, &iter, FX_STRING, name, -1 ); + vevo_property_set( fx_list_, name, VEVO_ATOM_TYPE_INT, 1, &(ec->id)); + } + } + } + g_free(name); + } + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(fxlist_data.stores[0].sorted)); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree2), GTK_TREE_MODEL(fxlist_data.stores[1].sorted)); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree3), GTK_TREE_MODEL(fxlist_data.stores[2].sorted)); + free(fxtext); +} + +void on_effectlist_sources_row_activated(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + model = gtk_tree_view_get_model(treeview); + + + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gchar *idstr = NULL; + gtk_tree_model_get(model,&iter, SL_ID, &idstr, -1); + gint id = 0; + if( sscanf( idstr+1, "[ %d]", &id ) ) + { + // set source / channel + multi_vims( VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL, + "%d %d %d %d", + 0, + info->uc.selected_chain_entry, + ( idstr[0] == 'T' ? 1 : 0 ), + id ); + vj_msg(VEEJAY_MSG_INFO, "Set source channel to %d, %d", info->uc.selected_chain_entry,id ); + + char trip[100]; + snprintf(trip, sizeof(trip), "%03d:%d %d %d %d",VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL, + 0, + info->uc.selected_chain_entry, + ( idstr[0] == 'T' ? 1 : 0 ), + id ); + vj_midi_learning_vims( info->midi, NULL, trip, 0 ); + } + if(idstr) g_free(idstr); + } +} + +/****************************************************** + * + * SAMPLES LIST + * + ******************************************************/ + +/* Return a bank page and slot number to place sample in */ +int verify_bank_capacity(int *bank_page_, int *slot_, int sample_id, int sample_type ) +{ + int poke_slot = 0; + int bank_page = find_bank_by_sample( sample_id, sample_type, &poke_slot ); + + if(bank_page == -1) { + veejay_msg(VEEJAY_MSG_ERROR, "No slot found for (%d,%d)",sample_id,sample_type); + return -1; + } + + if( !bank_exists(bank_page, poke_slot)) + add_bank( bank_page ); + + *bank_page_ = bank_page; + *slot_ = poke_slot; + +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_DEBUG, "(type=%d,id=%d) needs new slot, suggesting page %d, slot %d", + sample_type, sample_id, bank_page, poke_slot ); + +// if( info->sample_banks[bank_page] ) +// assert( info->sample_banks[bank_page]->slot[poke_slot]->sample_id <= 0 ); +#endif + + return 1; +} + +void setup_samplelist_info() +{ + effect_sources_tree = glade_xml_get_widget_( info->main_window, "tree_sources"); + effect_sources_store = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); + + gtk_tree_view_set_headers_visible( GTK_TREE_VIEW(effect_sources_tree), FALSE ); + + gtk_tree_view_set_model( GTK_TREE_VIEW(effect_sources_tree), GTK_TREE_MODEL(effect_sources_store)); + g_object_unref( G_OBJECT( effect_sources_store )); + effect_sources_model = gtk_tree_view_get_model( GTK_TREE_VIEW(effect_sources_tree )); + effect_sources_store = GTK_LIST_STORE(effect_sources_model); + + setup_tree_text_column( "tree_sources", SL_ID, "Id",0 ); + setup_tree_text_column( "tree_sources", SL_TIMECODE, "Length" ,0); + + GtkTreeSelection *selection; + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(effect_sources_tree)); + gtk_tree_selection_set_select_function(selection, view_sources_selection_func, NULL, NULL); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + + g_signal_connect( effect_sources_tree, "row-activated", (GCallback) on_effectlist_sources_row_activated, (gpointer*)"tree_sources"); + + cali_sourcetree = glade_xml_get_widget_(info->main_window, "cali_sourcetree"); + cali_sourcestore= gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); + + gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( cali_sourcetree), FALSE ); + gtk_tree_view_set_model( GTK_TREE_VIEW(cali_sourcetree), GTK_TREE_MODEL(cali_sourcestore)); + g_object_unref( G_OBJECT(cali_sourcestore)); + + cali_sourcemodel = gtk_tree_view_get_model( GTK_TREE_VIEW(cali_sourcetree )); + cali_sourcestore = GTK_LIST_STORE(cali_sourcemodel); + + setup_tree_text_column( "cali_sourcetree", SL_ID, "Id",0 ); + setup_tree_text_column( "cali_sourcetree", SL_TIMECODE, "Length" ,0); + + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(cali_sourcetree)); + gtk_tree_selection_set_select_function(sel, cali_sources_selection_func, NULL, NULL); + gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE); + +// g_signal_connect( cali_sourcetree, "row-activated", (GCallback) on_effectlist_sources_row_activated, (gpointer*)"tree_sources"); +} + +static uint8_t *ref_trashcan[3] = { NULL,NULL,NULL }; +static GdkPixbuf *pix_trashcan[3] = { NULL,NULL,NULL }; + +void reset_cali_images( int type, char *wid_name ) +{ + GtkWidget *dstImage = glade_xml_get_widget_( info->main_window, wid_name ); + + if( pix_trashcan[type] != NULL ) { + g_object_unref( pix_trashcan[type] ); + pix_trashcan[type] = NULL; + } + if( ref_trashcan[type] != NULL ) { + free( ref_trashcan[type] ); + ref_trashcan[type] = NULL; + } + gtk_image_clear( GTK_IMAGE(dstImage) ); +} + +int get_and_draw_frame(int type, char *wid_name) +{ + GtkWidget *dstImage = glade_xml_get_widget_( info->main_window, wid_name ); + if(dstImage == 0 ) { + veejay_msg(VEEJAY_MSG_ERROR, "No widget '%s'",wid_name); + return 0; + } + + multi_vims( VIMS_CALI_IMAGE, "%d %d", cali_stream_id,type); + + int bw = 0; + gchar *buf = recv_vims( 3, &bw ); + + if( bw <= 0 ) + { + veejay_msg(VEEJAY_MSG_ERROR, "Unable to get calibration image."); + return 0; + } + + int len = 0; + int uvlen = 0; + int w = 0; + int h = 0; + int tlen = 0; + if( sscanf(buf,"%08d%06d%06d%06d%06d",&tlen, &len, &uvlen,&w,&h) != 5 ) { + free(buf); + veejay_msg(VEEJAY_MSG_ERROR,"Error reading calibration data header" ); + return 0; + } + + uint8_t *out = (uint8_t*) vj_malloc(sizeof(uint8_t) * (w*h*3)); + uint8_t *srcbuf = (uint8_t*) vj_malloc(sizeof(uint8_t) * len ); + + int res = vj_client_read(info->client, V_CMD, srcbuf, tlen ); + if( res <= 0 ) { + free(out); + free(srcbuf); + free(buf); + veejay_msg(VEEJAY_MSG_ERROR, "Error while receiving calibration image."); + return 0; + } + + VJFrame *src = yuv_yuv_template(srcbuf, + srcbuf, + srcbuf, + w, + h, + PIX_FMT_GRAY8 ); + + VJFrame *dst = yuv_rgb_template( out, w,h,PIX_FMT_BGR24 ); + + yuv_convert_any_ac( src,dst, src->format, dst->format ); + + GdkPixbuf *pix = gdk_pixbuf_new_from_data(out, + GDK_COLORSPACE_RGB, + FALSE, + 8, + w, + h, + w*3, + NULL, + NULL ); + + if( ref_trashcan[type] != NULL ) + { + free(ref_trashcan[type]); + ref_trashcan[type]=NULL; + } + if( pix_trashcan[type] != NULL ) + { + g_object_unref( pix_trashcan[type] ); + pix_trashcan[type] = NULL; + } + + gtk_image_set_from_pixbuf_( GTK_IMAGE( dstImage ), pix ); + + // gdk_pixbuf_unref( pix ); + + free(src); + free(dst); + free(buf); +// free(out); + free(srcbuf); + + ref_trashcan[type] = out; + pix_trashcan[type] = pix; + + return 1; +} + +static void select_slot( int pm ) +{ + if( pm == MODE_SAMPLE || pm == MODE_STREAM ) + { + int b = 0; int p = 0; + /* falsify activation */ + if(info->status_tokens[CURRENT_ID] > 0) + { + if(verify_bank_capacity( &b, &p, info->status_tokens[CURRENT_ID], info->status_tokens[STREAM_TYPE] )) + { + if( info->selected_slot ) + { + if ( info->selected_slot->sample_type != pm || info->selected_slot->sample_id != + info->status_tokens[CURRENT_ID] ) { + set_activation_of_slot_in_samplebank(FALSE); + } + } + info->selected_slot = info->sample_banks[b]->slot[p]; + info->selected_gui_slot = info->sample_banks[b]->gui_slot[p]; + set_activation_of_slot_in_samplebank(TRUE); + } + /*bank_page = find_bank_by_sample( info->status_tokens[CURRENT_ID], pm, &poke_slot ); + + info->selected_slot= info->sample_banks[bank_page]->slot[poke_slot]; + info->selected_gui_slot= info->sample_banks[bank_page]->gui_slot[poke_slot];*/ + } + } + else + { + set_activation_of_slot_in_samplebank(FALSE); + info->selected_slot = NULL; + info->selected_gui_slot = NULL; + } +} + +static void load_sequence_list() +{ + single_vims( VIMS_SEQUENCE_LIST ); + gint len = 0; + gchar *text = recv_vims( 6, &len ); + if( len <= 0 || text == NULL ) + return; + + int playing=0; + int size =0; + int active=0; + + sscanf( text, "%04d%04d%4d",&playing,&size,&active ); + int nlen = len - 12; + int offset = 0; + int id = 0; + gchar *in = text + 12; + while( offset < nlen ) + { + int sample_id = 0; + int type = 0; + char seqtext[32]; + sscanf( in + offset, "%04d%02d", &sample_id, &type ); + offset += 6; + if( sample_id > 0 ) + { + sprintf(seqtext,"%c%d",( type == 0 ? 'S' : 'T' ), sample_id); + gtk_label_set_text( + GTK_LABEL(info->sequencer_view->gui_slot[id]->image), + seqtext ); + } + else + { + gtk_label_set_text( + GTK_LABEL(info->sequencer_view->gui_slot[id]->image), + NULL ); + } + + id ++; + } + free(text); +} + +static void load_samplelist_info(gboolean with_reset_slotselection) +{ + char line[300]; + char source[255]; + char descr[255]; + gint offset=0; + if( cali_onoff == 1 ) + reset_tree( "cali_sourcetree"); + + if( with_reset_slotselection ) + { + reset_samplebank(); + reset_tree( "tree_sources" ); + } + + int load_from = info->uc.expected_num_samples; + if( load_from < 0 ) + load_from = 0; + + + multi_vims( VIMS_SAMPLE_LIST,"%d", (with_reset_slotselection ? 0 : load_from) ); + gint fxlen = 0; + gchar *fxtext = recv_vims(8,&fxlen); + + if(fxlen > 0 && fxtext != NULL) + { + while( offset < fxlen ) + { + char tmp_len[8] = { 0 }; + strncpy(tmp_len, fxtext + offset, 3 ); + int len = atoi(tmp_len); + offset += 3; + if(len > 0) + { + veejay_memset( line,0,sizeof(line)); + veejay_memset( descr,0,sizeof(descr)); + strncpy( line, fxtext + offset, len ); + int values[4] = { 0,0,0,0 }; + sscanf( line, "%05d%09d%09d%03d",&values[0], &values[1], &values[2], &values[3]); + strncpy( descr, line + 5 + 9 + 9 + 3 , values[3] ); + gchar *title = _utf8str( descr ); + gchar *timecode = format_selection_time( 0,(values[2]-values[1]) ); + int int_id = values[0]; + int poke_slot= 0; int bank_page = -1; + verify_bank_capacity( &bank_page , &poke_slot, int_id, values[1]); + if(bank_page >= 0 ) + { + if( info->sample_banks[bank_page]->slot[poke_slot]->sample_id <= 0 ) + { + sample_slot_t *tmp_slot = create_temporary_slot(poke_slot,int_id,0, title,timecode ); + add_sample_to_sample_banks(bank_page, tmp_slot ); + add_sample_to_effect_sources_list( int_id,0, title, timecode); + free_slot(tmp_slot); + if( !disable_sample_image ) + veejay_get_sample_image( int_id, 0, info->image_dimensions[0], info->image_dimensions[1] ); + } + else + { + update_sample_slot_data( bank_page, poke_slot, int_id,0,title,timecode); + } + } + if( info->status_tokens[CURRENT_ID] == values[0] && info->status_tokens[PLAY_MODE] == 0 ) + put_text( "entry_samplename", title ); + free(timecode); + g_free(title); + } + offset += len; + } + offset = 0; + } + + if( fxtext ) free(fxtext); + fxlen = 0; + + load_from = info->uc.expected_num_streams; + if( load_from < 0 ) + load_from = 0; + + multi_vims( VIMS_STREAM_LIST,"%d",(with_reset_slotselection ? 0 : load_from) ); + fxtext = recv_vims(5, &fxlen); + + if( fxlen > 0 && fxtext != NULL) + { + while( offset < fxlen ) + { + char tmp_len[4]; + veejay_memset(tmp_len,0,sizeof(tmp_len)); + strncpy(tmp_len, fxtext + offset, 3 ); + + int len = atoi(tmp_len); + offset += 3; + if(len > 0) + { + veejay_memset(line,0,sizeof(line)); + veejay_memset(descr,0,sizeof(descr)); + strncpy( line, fxtext + offset, len ); + + int values[10]; + veejay_memset(values,0, sizeof(values)); + sscanf( line, "%05d%02d%03d%03d%03d%03d%03d%03d", + &values[0], &values[1], &values[2], + &values[3], &values[4], &values[5], + &values[6], &values[7]); + + strncpy( descr, line + 22, values[6] ); + switch( values[1] ) + { + case STREAM_CALI: + snprintf(source,sizeof(source),"calibrate %d",values[0]); + break; + case STREAM_VIDEO4LINUX: + snprintf(source,sizeof(source),"capture %d",values[0]); + break; + case STREAM_WHITE: + snprintf(source,sizeof(source),"solid %d",values[0]); + break; + case STREAM_MCAST: + snprintf(source,sizeof(source),"multicast %d",values[0]); + break; + case STREAM_NETWORK: + snprintf(source,sizeof(source),"unicast %d",values[0]); + break; + case STREAM_YUV4MPEG: + snprintf(source,sizeof(source),"y4m %d",values[0]); + break; + case STREAM_DV1394: + snprintf(source,sizeof(source),"dv1394 %d",values[0]); + break; + case STREAM_PICTURE: + snprintf(source,sizeof(source),"image %d",values[0]); + break; + case STREAM_GENERATOR: + snprintf(source,sizeof(source),"Z%d",values[0]); + break; + case STREAM_CLONE: + snprintf(source,sizeof(source),"T%d", values[0]); + break; + case STREAM_VLOOP: + snprintf(source,sizeof(source),"vloop %d", values[0]); + break; + case STREAM_AVF: + snprintf(source,sizeof(source),"stream %d", values[0]); + break; + default: + snprintf(source,sizeof(source),"??? %d", values[0]); + break; + } + gchar *gsource = _utf8str( descr ); + gchar *gtype = _utf8str( source ); + int bank_page = -1; + int poke_slot = 0; + + verify_bank_capacity( &bank_page , &poke_slot, values[0], values[1]); + + if(bank_page >= 0) + { + if( info->sample_banks[bank_page]->slot[poke_slot]->sample_id <= 0 ) + { + sample_slot_t *tmp_slot = create_temporary_slot(poke_slot,values[0],values[1], gtype,gsource ); + add_sample_to_sample_banks(bank_page, tmp_slot ); + add_sample_to_effect_sources_list( values[0], values[1],gsource,gtype); + free_slot(tmp_slot); + } + else + { + update_sample_slot_data( bank_page, poke_slot, values[0],values[1],gsource,gtype); + } + } + g_free(gsource); + g_free(gtype); + } + offset += len; + } + + } + + if(fxtext) free(fxtext); + + select_slot( info->status_tokens[PLAY_MODE] ); + +} + +gboolean view_el_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gint num = 0; + gtk_tree_model_get(model, &iter, COLUMN_INT, &num, -1); + + if (!path_currently_selected) + { + info->uc.selected_el_entry = num; + gint frame_num =0; + frame_num = _el_ref_start_frame( num ); + update_spin_value( "button_el_selstart", frame_num); + update_spin_value( "button_el_selend", _el_ref_end_frame( num ) ); + } + } + return TRUE; /* allow selection state to change */ +} + +void on_vims_row_activated(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + model = gtk_tree_view_get_model(treeview); + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gchar *vimsid = NULL; + gint event_id =0; + gtk_tree_model_get(model,&iter, VIMS_ID, &vimsid, -1); + + if(sscanf( vimsid, "%d", &event_id )) + { + if(event_id >= VIMS_BUNDLE_START && event_id < VIMS_BUNDLE_END) + { + multi_vims( VIMS_BUNDLE, "%d", event_id ); + info->uc.reload_hint[HINT_CHAIN] = 1; + } + else + { + gchar *args = NULL; + gchar *format = NULL; + gtk_tree_model_get(model,&iter, VIMS_FORMAT, &format, -1); + gtk_tree_model_get(model,&iter, VIMS_CONTENTS, &args, -1 ); + + if( event_id == VIMS_QUIT ) + { + if( prompt_dialog("Stop Veejay", "Are you sure ? (All unsaved work will be lost)" ) == + GTK_RESPONSE_REJECT ) + return; + } + if( (format == NULL||args==NULL) || (strlen(format) <= 0) ) + single_vims( event_id ); + else + { + if( args != NULL && strlen(args) > 0 ) + { + char msg[100]; + sprintf(msg, "%03d:%s;", event_id, args ); + msg_vims(msg); + } + } + } + } + if( vimsid ) g_free( vimsid ); + } +} + +gboolean view_vims_selection_func (GtkTreeSelection *selection, + GtkTreeModel *model, + GtkTreePath *path, + gboolean path_currently_selected, + gpointer userdata) +{ + GtkTreeIter iter; + if (gtk_tree_model_get_iter(model, &iter, path)) + { + gchar *vimsid = NULL; + gint event_id = 0; + gchar *text = NULL; + gint n_params = 0; + gtk_tree_model_get(model, &iter, VIMS_ID, &vimsid, -1); + gtk_tree_model_get(model, &iter, VIMS_CONTENTS, &text, -1 ); + gtk_tree_model_get(model, &iter, VIMS_PARAMS, &n_params, -1); + int k=0; + int m=0; + gchar *key = NULL; + gchar *mod = NULL; +#ifdef HAVE_SDL + gtk_tree_model_get(model,&iter, VIMS_KEY, &key, -1); + gtk_tree_model_get(model,&iter, VIMS_MOD, &mod, -1); +#endif + if(sscanf( vimsid, "%d", &event_id )) + { +#ifdef HAVE_SDL + k = sdlkey_by_name( key ); + m = sdlmod_by_name( mod ); +#endif + info->uc.selected_vims_entry = event_id; + + if( event_id >= VIMS_BUNDLE_START && event_id < VIMS_BUNDLE_END ) + info->uc.selected_vims_type = 0; + else + info->uc.selected_vims_type = 1; + + if(info->uc.selected_vims_args ) + free(info->uc.selected_vims_args); + info->uc.selected_vims_args = NULL; + + if( n_params > 0 && text ) + info->uc.selected_vims_args = strdup( text ); + + info->uc.selected_vims_accel[0] = m; + info->uc.selected_vims_accel[1] = k; + + clear_textview_buffer( "vimsview" ); + if(text) + set_textview_buffer( "vimsview", text ); + } + if(vimsid) g_free( vimsid ); + if(text) g_free( text ); + if(key) g_free( key ); + if(mod) g_free( mod ); + } + + return TRUE; /* allow selection state to change */ +} + +void +on_editlist_row_activated(GtkTreeView *treeview, + GtkTreePath *path, + GtkTreeViewColumn *col, + gpointer user_data) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + model = gtk_tree_view_get_model(treeview); + if(gtk_tree_model_get_iter(model,&iter,path)) + { + gint num = 0; + gtk_tree_model_get(model,&iter, COLUMN_INT, &num, -1); + gint frame_num = _el_ref_start_frame( num ); + + multi_vims( VIMS_VIDEO_SET_FRAME, "%d", (int) frame_num ); + } +} + +void on_stream_color_changed(GtkColorSelection *colorsel, gpointer user_data) +{ + if(!info->status_lock && info->selected_slot) + { + GdkColor current_color; + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "colorselection" ); + gtk_color_selection_get_current_color(GTK_COLOR_SELECTION( colorsel ), + ¤t_color ); + + gint red = current_color.red / 255.0; + gint green = current_color.green / 255.0; + gint blue = current_color.blue / 255.0; + + multi_vims(VIMS_STREAM_COLOR, "%d %d %d %d", + info->selected_slot->sample_id, + red, + green, + blue ); + } + +} + +static void setup_colorselection() +{ + GtkWidget *sel = glade_xml_get_widget_(info->main_window, "colorselection"); + g_signal_connect(sel, + "color-changed", + (GCallback) on_stream_color_changed, NULL ); +} + +void on_rgbkey_color_changed(GtkColorSelection *colorsel, gpointer user_data) +{ + if(!info->entry_lock) + { + GdkColor current_color; + GtkWidget *colorsel = glade_xml_get_widget_(info->main_window, + "rgbkey" ); + gtk_color_selection_get_current_color(GTK_COLOR_SELECTION( colorsel ), + ¤t_color ); + + // scale to 0 - 255 + gint red = current_color.red / 255.0; + gint green = current_color.green / 255.0; + gint blue = current_color.blue / 255.0; + + multi_vims(VIMS_CHAIN_ENTRY_SET_ARG_VAL, + "%d %d %d %d", + 0, + info->uc.selected_chain_entry, + 1, + red ); + multi_vims(VIMS_CHAIN_ENTRY_SET_ARG_VAL, + "%d %d %d %d", + 0, + info->uc.selected_chain_entry, + 2, + green ); + multi_vims(VIMS_CHAIN_ENTRY_SET_ARG_VAL, + "%d %d %d %d", + 0, + info->uc.selected_chain_entry, + 3, + blue ); + + info->parameter_lock = 1; + update_slider_value("slider_p1", red, 0 ); + update_slider_value("slider_p2", green, 0 ); + update_slider_value("slider_p3", blue, 0 ); + + info->parameter_lock = 0; + } +} + +static void setup_rgbkey() +{ + GtkWidget *sel = glade_xml_get_widget_(info->main_window, "rgbkey"); + g_signal_connect( sel, "color-changed", + (GCallback) on_rgbkey_color_changed, NULL ); +} + +static void setup_vimslist() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_vims"); + GtkListStore *store = gtk_list_store_new( 2,G_TYPE_STRING, G_TYPE_STRING); + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + g_object_unref( G_OBJECT( store )); + + setup_tree_text_column( "tree_vims", VIMS_LIST_ITEM_ID, "VIMS ID",0); + setup_tree_text_column( "tree_vims", VIMS_LIST_ITEM_DESCR, "Description",0 ); + + GtkTreeSortable *sortable = GTK_TREE_SORTABLE(store); + + gtk_tree_sortable_set_sort_func(sortable, + VIMS_ID, + sort_vims_func, + GINT_TO_POINTER(VIMS_ID), + NULL); + + gtk_tree_sortable_set_sort_column_id(sortable, + VIMS_ID, GTK_SORT_ASCENDING); +} + +static void setup_bundles() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_bundles"); + GtkListStore *store = gtk_list_store_new( 7,G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ,G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING); + + gtk_widget_set_size_request_( tree, 300, -1 ); + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + GtkTreeSortable *sortable = GTK_TREE_SORTABLE(store); + + gtk_tree_sortable_set_sort_func( + sortable, VIMS_ID, sort_vims_func, + GINT_TO_POINTER(VIMS_ID),NULL); + + gtk_tree_sortable_set_sort_column_id( sortable, VIMS_ID, GTK_SORT_ASCENDING); + + g_object_unref( G_OBJECT( store )); + + setup_tree_text_column( "tree_bundles", VIMS_ID, "Event ID",0); + setup_tree_text_column( "tree_bundles", VIMS_KEY, "Key",0); + setup_tree_text_column( "tree_bundles", VIMS_MOD, "Mod",0); + setup_tree_text_column( "tree_bundles", VIMS_DESCR, "Description",0 ); + setup_tree_text_column( "tree_bundles", VIMS_PARAMS, "Max args",0); + setup_tree_text_column( "tree_bundles", VIMS_FORMAT, "Format",0 ); + g_signal_connect(tree, + "row-activated", + (GCallback) on_vims_row_activated, + NULL ); + + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); + gtk_tree_selection_set_select_function(selection, view_vims_selection_func, NULL, NULL); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + + GtkWidget *tv = glade_xml_get_widget_( info->main_window, "vimsview" ); + gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(tv), GTK_WRAP_WORD_CHAR ); +} + +static void setup_editlist_info() +{ + editlist_tree = glade_xml_get_widget_( info->main_window, "editlisttree"); + editlist_store = gtk_list_store_new( 5,G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ,G_TYPE_STRING); + gtk_tree_view_set_model( GTK_TREE_VIEW(editlist_tree), GTK_TREE_MODEL(editlist_store)); + g_object_unref( G_OBJECT( editlist_store )); + editlist_model = gtk_tree_view_get_model( GTK_TREE_VIEW(editlist_tree )); + editlist_store = GTK_LIST_STORE(editlist_model); + + setup_tree_text_column( "editlisttree", COLUMN_INT, "#",0); + setup_tree_text_column( "editlisttree", COLUMN_STRING0, "Timecode",0 ); + setup_tree_text_column( "editlisttree", COLUMN_STRINGA, "Filename",0); + setup_tree_text_column( "editlisttree", COLUMN_STRINGB, "Duration",0); + setup_tree_text_column( "editlisttree", COLUMN_STRINGC, "FOURCC",0); + + g_signal_connect( editlist_tree, "row-activated", + (GCallback) on_editlist_row_activated, NULL ); + + GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(editlist_tree)); + gtk_tree_selection_set_select_function(selection, view_el_selection_func, NULL, NULL); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); +} + +static void reload_keys() +{ + gint len = 0; + single_vims( VIMS_KEYLIST ); + gchar *text = recv_vims( 6, &len ); + gint offset = 0; + + if( len == 0 || text == NULL ) + return; + + gint k,index; + for( k = 0; k < VIMS_MAX ; k ++ ) + { + vims_keys_t *p = &vims_keys_list[k]; + if(p->vims) + free(p->vims); + p->keyval = 0; + p->state = 0; + p->event_id = 0; + p->vims = NULL; + } + + char *ptr = text; + + while( offset < len ) + { + int val[6]; + veejay_memset(val,0,sizeof(val)); + int n = sscanf( ptr + offset, "%04d%03d%03d%03d", &val[0],&val[1],&val[2],&val[3]); + if( n != 4 ) + { + free(text); + return; + } + + offset += 13; + char *message = strndup( ptr + offset , val[3] ); + + offset += val[3]; + + index = (val[1] * G_MOD_OFFSET) + val[2]; + + if( index < 0 || index >= VIMS_MAX ) { + free(message); + continue; + } + + vims_keys_list[ index ].keyval = val[2]; + vims_keys_list[ index ].state = val[1]; + vims_keys_list[ index ].event_id = val[0]; + vims_keys_list[ index ].vims = message; + } + free(text); +} + +static void reload_bundles() +{ + reload_keys(); + + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_bundles"); + GtkListStore *store; + GtkTreeIter iter; + + gint len = 0; + single_vims( VIMS_BUNDLE_LIST ); + gchar *eltext = recv_vims(6,&len); // msg len + gint offset = 0; + + reset_tree("tree_bundles"); + + if(len == 0 || eltext == NULL ) + { +#ifdef STRICT_CHECKING + assert(eltext != NULL && len > 0); +#endif + return; + } + + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + store = GTK_LIST_STORE(model); + + char *ptr = eltext; + + while( offset < len ) + { + char *message = NULL; + char *format = NULL; + char *args = NULL; + int val[6] = { 0,0,0,0,0,0 }; + + sscanf( ptr + offset, "%04d%03d%03d%04d", &val[0],&val[1],&val[2],&val[3]); + + offset += 14; + + message = strndup( ptr + offset , val[3] ); + offset += val[3]; + + sscanf( ptr + offset, "%03d%03d", &val[4], &val[5] ); + + offset += 6; + + if(val[4]) // format string + { + format = strndup( ptr + offset, val[4] ); + offset += val[4]; + } + + if(val[5]) // argument string + { + args = strndup( ptr + offset, val[5] ); + offset += val[5]; + } + + gchar *g_descr = NULL; + gchar *g_format = NULL; + gchar *g_content = NULL; +#ifdef HAVE_SDL + gchar *g_keyname = sdlkey_by_id( val[1] ); + gchar *g_keymod = sdlmod_by_id( val[2] ); +#else + gchar *g_keyname = "N/A"; + gchar *g_keymod = ""; +#endif + gchar *g_vims[5]; + + sprintf( (char*) g_vims, "%03d", val[0] ); + + if( val[0] >= VIMS_BUNDLE_START && val[0] < VIMS_BUNDLE_END ) + { + g_content = _utf8str( message ); + g_descr = _utf8str("Bundle"); + } + else + { + g_descr = _utf8str( message ); + if( format ) + g_format = _utf8str( format ); + if( args ) + { + g_content = _utf8str( args ); + //@ set default VIMS argument: + if(vj_event_list[val[0]].args ) + { + free(vj_event_list[val[0]].args ); + vj_event_list[val[0]].args = NULL; + } + vj_event_list[ val[0] ].args = strdup( args ); + } + } + + gtk_list_store_append( store, &iter ); + gtk_list_store_set(store, &iter, + VIMS_ID, g_vims, + VIMS_KEY, g_keyname, + VIMS_MOD, g_keymod, + VIMS_DESCR, g_descr, + VIMS_PARAMS, vj_event_list[ val[0] ].params, + VIMS_FORMAT, g_format, + VIMS_CONTENTS, g_content, /* this is a hidden column, when the item is selected, the text is displayed in the textview widget */ + -1 ); + + if(message) free(message); + if(format) free(format); + if(args) free(args); + + if( g_descr ) g_free(g_descr ); + if( g_format ) g_free(g_format ); + if( g_content) g_free(g_content ); + } + /* entry, start frame, end frame */ + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + free( eltext ); +} + +static void reload_vimslist() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "tree_vims"); + GtkListStore *store; + GtkTreeIter iter; + + gint len = 0; + single_vims( VIMS_VIMS_LIST ); + gchar *eltext = recv_vims(5,&len); // msg len + gint offset = 0; + reset_tree("tree_vims"); + + if(len == 0 || eltext == NULL ) + { +#ifdef STRICT_CHECKING + assert(eltext != NULL && len > 0); +#endif + return; + } + + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + store = GTK_LIST_STORE(model); + + while( offset < len ) + { + char *format = NULL; + char *descr = NULL; + char *line = strndup( eltext + offset, 14 ); + int val[4]; + sscanf(line, "%04d%02d%03d%03d", + &val[0],&val[1],&val[2],&val[3]); + + char vimsid[5]; + + offset += 12; + if(val[2] > 0) + { + format = strndup( eltext + offset, val[2] ); + offset += val[2]; + } + + if(val[3] > 0 ) + { + descr = strndup( eltext + offset, val[3] ); + offset += val[3]; + } + + gchar *g_format = (format == NULL ? NULL :_utf8str( format )); + gchar *g_descr = (descr == NULL ? NULL :_utf8str( descr )); + + if(vj_event_list[val[0]].format ) + free(vj_event_list[val[0]].format); + if(vj_event_list[val[0]].descr ) + free(vj_event_list[val[0]].descr); + + gtk_list_store_append( store, &iter ); + + vj_event_list[ val[0] ].event_id = val[0]; + vj_event_list[ val[0] ].params = val[1]; + vj_event_list[ val[0] ].format = (format == NULL ? NULL :_utf8str( format )); + vj_event_list[ val[0] ].descr = (descr == NULL ? NULL : _utf8str( descr )); + + sprintf(vimsid, "%03d", val[0] ); + gtk_list_store_set(store, &iter, + VIMS_LIST_ITEM_ID, vimsid, + VIMS_LIST_ITEM_DESCR, g_descr,-1 ); + + if(g_format) g_free(g_format); + if(g_descr) g_free(g_descr); + + if(format) free(format); + if(descr) free(descr); + + free( line ); + } + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + free( eltext ); +} + +static void remove_all (GtkComboBox *combo_box) +{ + GtkTreeModel* model = gtk_combo_box_get_model (combo_box); + gtk_list_store_clear (GTK_LIST_STORE(model)); +} + +static char *tokenize_on_space( char *q ) +{ + int n = 0; + char *r = NULL; + char *p = q; + while( *p != '\0' && !isblank( *p ) && *p != ' ' && *p != 20) + { + (*p)++; + n++; + } + if( n <= 0 ) + return NULL; + r = vj_calloc( n+1 ); + strncpy( r, q, n ); + return r; +} + +static int have_srt_ = 0; + +static void init_srt_editor() +{ + reload_fontlist(); + update_spin_range( "spin_text_x", 0, info->el.width-1 , 0 ); + update_spin_range( "spin_text_y", 0, info->el.height-1, 0 ); + update_spin_range( "spin_text_size", 10, 500, 40 ); + update_spin_range( "spin_text_start", 0, total_frames_, 0 ); +} + +static void reload_fontlist() +{ + GtkWidget *box = glade_xml_get_widget_( info->main_window, "combobox_fonts"); + gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT( box ) ); + + single_vims( VIMS_FONT_LIST ); + gint len = 0; + gchar *srts = recv_vims(6,&len ); + gint i = 0; + gchar *p = srts; + + while( i < len ) + { + char tmp[4]; + veejay_memset(tmp,0,sizeof(tmp)); + strncpy(tmp, p, 3 ); + int slen = atoi(tmp); + p += 3; + gchar *seq_str = strndup( p, slen ); + gtk_combo_box_text_append( GTK_COMBO_BOX_TEXT(box), NULL, seq_str ); + p += slen; + free(seq_str); + i += (slen + 3); + } + free(srts); +} + +static void reload_srt() +{ + if(!have_srt_) + { + init_srt_editor(); + have_srt_ = 1; + } + + GtkWidget *box = glade_xml_get_widget_( info->main_window, "combobox_textsrt"); + gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT( box ) ); + + clear_textview_buffer( "textview_text"); + + single_vims( VIMS_SRT_LIST ); + gint i=0, len = 0; + + gchar *srts = recv_vims(6,&len ); + if( srts == NULL || len <= 0 ) + { + // disable_widget( "SRTframe" ); + return; + } + + gchar *p = srts; + gchar *token = NULL; + + while( i < len ) + { + token = tokenize_on_space( p ); + if(!token) + break; + if(token) + { + gtk_combo_box_text_append( GTK_COMBO_BOX_TEXT(box), NULL, token ); + i += strlen(token) + 1; + free(token); + } + else + i++; + p = srts + i; + } + free(srts); +} + +void _edl_reset(void) +{ + if( info->elref != NULL) + { + int n = g_list_length(info->elref); + int i; + for( i = 0; i <=n ; i ++ ) + { + void *ptr = g_list_nth_data( info->elref , i ); + if(ptr) + free(ptr); + } + g_list_free( info->elref ); + } +} + +void reload_macros() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "macro_macros" ); + GtkListStore *store; + GtkTreeIter iter; + + gint consumed = 0; + gint len = 0; + single_vims( VIMS_GET_ALL_MACRO ); + gchar *answer = recv_vims(8, &len); + + reset_tree("macro_macros"); + + if( answer == NULL || len < 0 ) + return; + + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + store = GTK_LIST_STORE(model); + + gchar *ptr = answer; + + int error = 0; + + while(consumed < len) { + + long frame_num = 0; + int at_dup = 0; + int at_loop = 0; + int at_seq = 0; + int msg_len = 0; + + int n = sscanf( ptr, "%08ld%02d%08d%02d%03d", &frame_num, &at_dup, &at_loop, &at_seq, &msg_len ); + if( n != 5) { + error = 1; + break; + } + + ptr += (8 + 2 + 8 + 2 + 3); + + char *msg = strndup( ptr, msg_len ); + int vims_id = -1; + n = sscanf(msg,"%03d:", &vims_id); + char *descr = NULL; + if( vims_id >= 0 && vims_id < VIMS_QUIT ) + descr = vj_event_list[vims_id].descr; + + gtk_list_store_append( store, &iter ); + gtk_list_store_set(store, &iter, + MACRO_FRAME, (guint) frame_num, + MACRO_DUP, (guint) at_dup, + MACRO_LOOP, (guint) at_loop, + MACRO_MSG_SEQ, (guint) at_seq, + MACRO_VIMS, msg, + MACRO_VIMS_DESCR, (descr == NULL ? "Unknown": descr), + -1 ); + + ptr += msg_len; + + free(msg); + + consumed += (8 + 2 + 8 + 2 + 3); + consumed += msg_len; + } + + if(error){ + veejay_msg(0,"Unable to read all VIMS macros"); + } + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + + free(answer); + + info->uc.reload_hint[HINT_MACRO] = 0; +} + +static void reload_editlist_contents() +{ + GtkWidget *tree = glade_xml_get_widget_( info->main_window, "editlisttree"); + GtkListStore *store; + GtkTreeIter iter; + + gint i; + gint len = 0; + single_vims( VIMS_EDITLIST_LIST ); + gchar *eltext = recv_vims(6,&len); // msg len + gint offset = 0; + gint num_files=0; + reset_tree("editlisttree"); + _el_ref_reset(); + _el_entry_reset(); + _edl_reset(); + + if( eltext == NULL || len < 0 ) + { + return; + } + + el_constr *el; + + char *tmp = strndup( eltext + offset, 4 ); + if( sscanf( tmp,"%d",&num_files ) != 1 ) + { + free(tmp); + free(eltext); + return; + } + free(tmp); + + offset += 4; + + for( i = 0; i < num_files ; i ++ ) + { + int name_len = 0; + tmp = strndup( eltext + offset, 3 ); + if( sscanf( tmp,"%d", &name_len ) != 1 ) + { + free(tmp); + free(eltext); + return; + } + offset += 3; + free(tmp); + char *file = strndup( eltext + offset, name_len ); + + offset += name_len; + int iter = 0; + tmp = strndup( eltext + offset, 4 ); + if( sscanf( tmp, "%d", &iter ) != 1 ) + { + free(tmp); + free(eltext); + return; + } + free(tmp); + offset += 4; + + long num_frames = 0; + tmp = strndup( eltext + offset, 10 ); + if( sscanf(tmp, "%ld", &num_frames ) != 1 ) + { + free(tmp); + free(eltext); + return; + } + free(tmp); + offset += 10; + + int fourcc_len = 0; + tmp = strndup( eltext + offset, 2 ); + if( sscanf( tmp, "%d", &fourcc_len) != 1 ) + { + free(tmp); + free(eltext); + return; + } + offset += fourcc_len; + char *fourcc = strndup( eltext + offset - 1, fourcc_len ); + + el = _el_entry_new( iter, file, num_frames, fourcc ); + info->editlist = g_list_append( info->editlist, el ); + + offset += 2; + + free(file); + free(fourcc); + free(tmp); + } + GtkTreeModel *model = gtk_tree_view_get_model( GTK_TREE_VIEW(tree )); + store = GTK_LIST_STORE(model); + + int total_frames = 0; // running total of frames + int row_num = 0; + while( offset < len ) + { + tmp = (char*)strndup( eltext + offset, (3*16) ); + offset += (3*16); + long nl=0, n1=0,n2=0; + + sscanf( tmp, "%016ld%016ld%016ld", + &nl,&n1,&n2 ); + + if(nl < 0 || nl >= num_files) + { + free(tmp); + free(eltext); + return; + } + int file_len = _el_get_nframes( nl ); + if(file_len <= 0) + { + free(tmp); + row_num++; + continue; + } + if(n1 < 0 ) + n1 = 0; + if(n2 >= file_len) + n2 = file_len; + + if(n2 <= n1 ) + { + free(tmp); + row_num++; + continue; + } + + info->elref = g_list_append( info->elref, _el_ref_new( row_num,(int) nl,n1,n2,total_frames ) ) ; + char *tmpname = _el_get_filename(nl); + gchar *fname = get_relative_path(tmpname); + gchar *timecode = format_selection_time( n1,n2 ); + gchar *gfourcc = _utf8str( _el_get_fourcc(nl) ); + gchar *timeline = format_selection_time( 0, total_frames ); + + gtk_list_store_append( store, &iter ); + gtk_list_store_set(store, &iter, + COLUMN_INT, (guint) row_num, + COLUMN_STRING0, timeline, + COLUMN_STRINGA, fname, + COLUMN_STRINGB, timecode, + COLUMN_STRINGC, gfourcc,-1 ); + + free(timecode); + g_free(gfourcc); + g_free(fname); + free(timeline); + free(tmp); + + total_frames = total_frames + (n2-n1) + 1; + row_num ++; + } + + gtk_tree_view_set_model( GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store)); + + free( eltext ); +} + +// execute after el change: +static void load_editlist_info() +{ + char norm; + float fps; + int values[10] = { 0 }; + long rate = 0; + long dum[2]; + char tmp[16]; + int len = 0; + + single_vims( VIMS_VIDEO_INFORMATION ); + gchar *res = recv_vims(3,&len); + if( len <= 0 || res==NULL) + { +#ifdef STRICT_CHECKING + assert(len > 0 && res != NULL); +#endif + return; + } + sscanf(res, "%d %d %d %c %f %d %d %ld %d %ld %ld %d %d", + &values[0], &values[1], &values[2], &norm,&fps, + &values[4], &values[5], &rate, &values[7], + &dum[0], &dum[1], &values[8], &use_vims_mcast); + snprintf( tmp, sizeof(tmp)-1, "%dx%d", values[0],values[1]); + + info->el.width = values[0]; + info->el.height = values[1]; + info->el.num_frames = dum[1]; + update_label_str( "label_el_wh", tmp ); + snprintf( tmp, sizeof(tmp)-1, "%s", + (norm == 'p' ? "PAL" : "NTSC" ) ); + update_label_str( "label_el_norm", tmp); + update_label_f( "label_el_fps", fps ); + + update_spin_value( "screenshot_width", info->el.width ); + update_spin_value( "screenshot_height", info->el.height ); + + info->el.fps = fps; +#ifdef STRICT_CHECKING + assert( info->el.fps > 0 ); +#endif + info->el.num_files = dum[0]; + snprintf( tmp, sizeof(tmp)-1, "%s", + ( values[2] == 0 ? "progressive" : (values[2] == 1 ? "top first" : "bottom first" ) ) ); + update_label_str( "label_el_inter", tmp ); + update_label_i( "label_el_arate", (int)rate, 0); + update_label_i( "label_el_achans", values[7], 0); + update_label_i( "label_el_abits", values[5], 0); + + if( values[4] == 0 ) + { + disable_widget( "button_5_4" ); + } + else + { + set_toggle_button( "button_5_4", values[8]); + enable_widget( "button_5_4" ); + } + + if( use_vims_mcast ) { + enable_widget( "toggle_multicast" ); + } + else { + disable_widget( "toggle_multicast" ); + } + + free(res); +} + +static void notebook_set_page(const char *name, int page) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); + return; + } + gtk_notebook_set_current_page( GTK_NOTEBOOK(w), page ); +} + +static void hide_widget(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); + return; + } + gtk_widget_hide(w); +} + +static void show_widget(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); + return; + } + gtk_widget_show(w); +} + + +#ifndef STRICT_CHECKING +static void disable_widget_(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); + return; + } + gtk_widget_set_sensitive_( GTK_WIDGET(w), FALSE ); +} + +static void enable_widget_(const char *name) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found",name); + return; + } + gtk_widget_set_sensitive_( GTK_WIDGET(w), TRUE ); +} +#else +static void disable_widget_(const char *name, const char *s, int line) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found, caller is %s:%d",name,s,line); + return; + } + gtk_widget_set_sensitive_( GTK_WIDGET(w), FALSE ); +} + +static void enable_widget_(const char *name, const char *s, int line) +{ + GtkWidget *w = glade_xml_get_widget_(info->main_window,name); + if(!w) + { + veejay_msg(VEEJAY_MSG_ERROR, "Widget '%s' not found, caller is %s:%d",name,s,line); + return; + } + gtk_widget_set_sensitive_( GTK_WIDGET(w), TRUE ); +} +#endif + + +static gchar *format_selection_time(int start, int end) +{ + double fps = (double) info->el.fps; + int pos = (end-start); + + return format_time( pos, fps ); +} + +static gboolean update_cpumeter_timeout( gpointer data ) +{ + gdouble ms = (gdouble)info->status_tokens[ELAPSED_TIME]; + gdouble fs = (gdouble)get_slider_val( "framerate" ); + gdouble lim = (1.0f/fs)*1000.0; + + if( ms < lim ) + { + update_label_str( "cpumeter", text_msg_[TEXT_REALTIME].text ); + } else + { + char text[32]; + sprintf(text, "%2.2f FPS", ( 1.0f / ms ) * 1000.0 ); + + update_label_str( "cpumeter", text ); + } + return TRUE; +} + +static gboolean update_cachemeter_timeout( gpointer data ) +{ + char text[32]; + gint v = info->status_tokens[TOTAL_MEM]; + sprintf(text,"%d MB cached",v); + update_label_str( "cachemeter", text ); + + return TRUE; +} + +static gboolean update_sample_record_timeout(gpointer data) +{ + if( info->uc.playmode == MODE_SAMPLE ) + { + GtkWidget *w; + if( is_button_toggled("seqactive" ) ) + { + w = glade_xml_get_widget_( info->main_window, + "rec_seq_progress" ); + } + else + { + w = glade_xml_get_widget_( info->main_window, + "samplerecord_progress" ); + + } + gdouble tf = info->status_tokens[STREAM_DURATION]; + gdouble cf = info->status_tokens[STREAM_RECORDED]; + + gdouble fraction = cf / tf; + + if(!info->status_tokens[STREAM_RECORDING] ) + { + gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(w), 0.0); + info->samplerecording = 0; + info->uc.recording[MODE_SAMPLE] = 0; + if(info->uc.render_record) + { + info->uc.render_record = 0; // render list has private edl + } + else + { + info->uc.reload_hint[HINT_EL] = 1; + } + return FALSE; + } + else + { + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(w), + fraction ); + } + } + return TRUE; +} + +static gboolean update_stream_record_timeout(gpointer data) +{ + GtkWidget *w = glade_xml_get_widget_( info->main_window, + "streamrecord_progress" ); + if( info->uc.playmode == MODE_STREAM ) + { + gdouble tf = info->status_tokens[STREAM_DURATION]; + gdouble cf = info->status_tokens[STREAM_RECORDED]; + + gdouble fraction = cf / tf; + if(!info->status_tokens[STREAM_RECORDING] ) + { + gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR(w), 0.0); + info->streamrecording = 0; + info->uc.recording[MODE_STREAM] = 0; + info->uc.reload_hint[HINT_EL] = 1; // recording finished, reload edl + return FALSE; + } + else + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(w), + fraction ); + + } + return TRUE; +} + +static void init_recorder(int total_frames, gint mode) +{ + if(mode == MODE_STREAM) + { + info->streamrecording = g_timeout_add(300, update_stream_record_timeout, (gpointer*) info ); + } + if(mode == MODE_SAMPLE) + { + info->samplerecording = g_timeout_add(300, update_sample_record_timeout, (gpointer*) info ); + } + info->uc.recording[mode] = 1; +} + +static char glade_path[1024]; + +static int select_f(const struct dirent *d ) +{ + if ((strcmp(d->d_name, ".") == 0) || + (strcmp(d->d_name, "..") == 0)) + return 0; + return 1; +} + +char *get_glade_path() +{ + return glade_path; +} + +char *get_gveejay_dir() +{ + return RELOADED_DATADIR; +} + +void get_gd(char *buf, char *suf, const char *filename) +{ + const char *dir = RELOADED_DATADIR; + + if(filename !=NULL && suf != NULL) + sprintf(buf, "%s/%s/%s",dir,suf, filename ); + if(filename !=NULL && suf==NULL) + sprintf(buf, "%s/%s", dir, filename); + if(filename == NULL && suf != NULL) + sprintf(buf, "%s/%s/" , dir, suf); +} + +GdkPixbuf *vj_gdk_pixbuf_scale_simple( GdkPixbuf *src, int dw, int dh, GdkInterpType inter_type ) +{ + return gdk_pixbuf_scale_simple( src,dw,dh,inter_type ); +/* + GdkPixbuf *res = gdk_pixbuf_new( GDK_COLORSPACE_RGB, FALSE, 8, dw, dh ); +#ifdef STRICT_CHECKING + assert( GDK_IS_PIXBUF( res ) ); +#endif + uint8_t *res_out = gdk_pixbuf_get_pixels( res ); + uint8_t *src_in = gdk_pixbuf_get_pixels( src ); + uint32_t src_w = gdk_pixbuf_get_width( src ); + uint32_t src_h = gdk_pixbuf_get_height( src ); + int dst_w = gdk_pixbuf_get_width( res ); + int dst_h = gdk_pixbuf_get_height( res ); + VJFrame *src1 = yuv_rgb_template( src_in, src_w, src_h, PIX_FMT_BGR24 ); + VJFrame *dst1 = yuv_rgb_template( res_out, dst_w, dst_h, PIX_FMT_BGR24 ); + + veejay_msg(VEEJAY_MSG_ERROR, "%s: %dx%d -> %dx%d", __FUNCTION__, src_w,src_h,dst_w,dst_h ); + + yuv_convert_any_ac( src1,dst1, src1->format, dst1->format ); + + free(src1); + free(dst1); + + return res;*/ +} + +void gveejay_sleep( void *u ) +{ + struct timespec nsecsleep; +// nsecsleep.tv_nsec = 1000000 * 4; //@ too long + nsecsleep.tv_nsec = 500000; + nsecsleep.tv_sec = 0; + nanosleep( &nsecsleep, NULL ); +} + +int gveejay_time_to_sync( void *ptr ) +{ + vj_gui_t *ui = (vj_gui_t*) ptr; + struct timeval time_now; + gettimeofday( &time_now, 0 ); + + double diff = time_now.tv_sec - ui->time_last.tv_sec + + (time_now.tv_usec - ui->time_last.tv_usec ) * 1.e-6; + float fps = 0.0; + struct timespec nsecsleep; + + long nsec = 1600000; // some default sleep time in nanoseconds + + if ( ui->watch.state == STATE_PLAYING ) + { + fps = ui->el.fps; + float spvf = 1.0f / fps; + float ela = ( info->status_tokens[ELAPSED_TIME] / 1000.0 ); + float delay = spvf - ela; + // calculate time to sleep based on seconds per video frame + nsec = (delay * 1000000000); + + // if elapsed time > seconds per video frame or diff > delay, update the UI now + if( diff >= delay || ela >= spvf ) { + return 1; + } + } + else if ( ui->watch.state == STATE_STOPPED ) + { + reloaded_restart(); + } + + nsecsleep.tv_nsec = nsec; + nsecsleep.tv_sec = 0; + nanosleep( &nsecsleep, NULL ); + return 0; +} + +int veejay_update_multitrack( void *ptr ) +{ + sync_info *s = multitrack_sync( info->mt ); + + if( s->status_list[s->master] == NULL ) { + info->watch.w_state = STATE_STOPPED; + free(s->status_list); + free(s->img_list ); + free(s->widths); + free(s->heights); + free(s); + return 1; + } + + GtkWidget *maintrack = glade_xml_get_widget_( info->main_window, "imageA"); + int i; + GtkWidget *ww = glade_xml_get_widget_( info->main_window, "notebook18" ); + int deckpage = gtk_notebook_get_current_page(GTK_NOTEBOOK(ww)); + +#ifdef STRICT_CHECKING + assert( s->status_list[s->master] != NULL ); +#endif + + int tmp = 0; + + for ( i = 0; i < STATUS_TOKENS; i ++ ) + { + tmp += s->status_list[s->master][i]; + info->status_tokens[i] = s->status_list[s->master][i]; + } + + if( tmp == 0 ) + { + free(s->status_list); + free(s->img_list ); + free(s->widths); + free(s->heights); + free(s); + return 0; + } + + info->status_lock = 1; + info->uc.playmode = info->status_tokens[ PLAY_MODE ]; + update_gui(); + info->prev_mode = info->status_tokens[ PLAY_MODE ]; + + int pm = info->status_tokens[PLAY_MODE]; +#ifdef STRICT_CHECKING + assert( pm >= 0 && pm < 4 ); +#endif + int *history = info->history_tokens[pm]; + + veejay_memcpy( history, info->status_tokens, sizeof(int) * STATUS_TOKENS ); + + for( i = 0; i < s->tracks ; i ++ ) + { + if( s->status_list[i] ) + { + update_multitrack_widgets( info->mt, s->status_list[i], i ); + + free(s->status_list[i]); + } + if( s->img_list[i] ) + { + if( i == s->master ) + { +#ifdef STRICT_CHECKING + assert( s->widths[i] > 0 ); + assert( s->heights[i] > 0 ); + assert( GDK_IS_PIXBUF( s->img_list[i] ) ); +#endif + if( gdk_pixbuf_get_height(s->img_list[i]) == preview_box_w_ && + gdk_pixbuf_get_width(s->img_list[i]) == preview_box_h_ ) + gtk_image_set_from_pixbuf_( GTK_IMAGE( maintrack ), s->img_list[i] ); + else + { + GdkPixbuf *result = vj_gdk_pixbuf_scale_simple( s->img_list[i],preview_box_w_,preview_box_h_, GDK_INTERP_NEAREST ); + if(result) + { + gtk_image_set_from_pixbuf_( GTK_IMAGE( maintrack ), result ); + g_object_unref(result); + } + } + vj_img_cb( s->img_list[i] ); + } + + if(deckpage == 3) // notebook18 >>> Multitrack page + multitrack_update_sequence_image( info->mt, i, s->img_list[i] ); + + if( s->img_list[i] ) + g_object_unref( s->img_list[i] ); + } + } + + info->status_lock = 0; + + + free(s->status_list); + free(s->img_list ); + free(s->widths); + free(s->heights); + free(s); + + gettimeofday( &(info->time_last) , 0 ); + + + return 1; +} + +static void update_status_accessibility(int old_pm, int new_pm) +{ + int i; + + if( old_pm == new_pm ) + return; + + if( new_pm == MODE_STREAM ) + { + for(i=0; samplewidgets[i].name != NULL; i++) + disable_widget( samplewidgets[i].name); + for(i=0; plainwidgets[i].name != NULL; i++) + disable_widget( plainwidgets[i].name); + for(i=0; streamwidgets[i].name != NULL; i++) + enable_widget( streamwidgets[i].name); + } + + if( new_pm == MODE_SAMPLE ) + { + for(i=0; streamwidgets[i].name != NULL; i++) + disable_widget( streamwidgets[i].name); + for(i=0; plainwidgets[i].name != NULL; i++) + disable_widget( plainwidgets[i].name); + for(i=0; samplewidgets[i].name != NULL; i++) + enable_widget( samplewidgets[i].name); + } + + if( new_pm == MODE_PLAIN) + { + for(i=0; streamwidgets[i].name != NULL; i++) + disable_widget( streamwidgets[i].name); + for(i=0; samplewidgets[i].name != NULL; i++) + disable_widget( samplewidgets[i].name); + for(i=0; plainwidgets[i].name != NULL; i++) + enable_widget( plainwidgets[i].name); + } + + GtkWidget *n = glade_xml_get_widget_( info->main_window, "panels" ); + int page_needed = 0; + switch( new_pm ) + { + case MODE_SAMPLE: + page_needed =0 ; break; + case MODE_STREAM: + page_needed = 1; break; + case MODE_PLAIN: + page_needed = 2; break; + default: + break; + } + gtk_notebook_set_current_page( GTK_NOTEBOOK(n), page_needed ); +} + +static void set_pm_page_label(int sample_id, int type) +{ + gchar ostitle[100]; + gchar ftitle[100]; + switch(type) + { + case 0: + snprintf(ostitle, sizeof(ostitle), "Sample %d",sample_id);break; + case 1: + snprintf(ostitle, sizeof(ostitle), "Stream %d",sample_id);break; + default: + snprintf(ostitle,sizeof(ostitle), "Plain");break; + } + gchar *title = _utf8str(ostitle); + snprintf(ftitle,sizeof(ftitle), "%s", ostitle); + label_set_markup( "label_current_mode", ftitle); + update_label_str( "label_currentsource", title ); + g_free(title); +} + +static int reload_entry_tick_=0; +static void update_globalinfo(int *history, int pm, int last_pm) +{ + int i; + + if( last_pm != pm ) + update_status_accessibility( last_pm, pm); + + if( info->status_tokens[FEEDBACK] != history[FEEDBACK] ) { + if(info->status_tokens[FEEDBACK] == 1) { // when feedback is enabled + for( i = 0; non_feedback_widgets[i].name != NULL ; i ++ ) { + disable_widget( non_feedback_widgets[i].name ); + } + } + else { + for( i = 0; non_feedback_widgets[i].name != NULL ; i ++ ) { + enable_widget( non_feedback_widgets[i].name ); + } + } + set_toggle_button( "feedbackbutton", info->status_tokens[FEEDBACK]); + } + + if( info->status_tokens[MACRO] != history[MACRO] ) + { + switch(info->status_tokens[MACRO]) + { + case 1: + set_toggle_button( "macrorecord",1); break; + case 2: + set_toggle_button( "macroplay",1 ); break; + default: + set_toggle_button( "macrostop",1); break; + } + } + + if( pm != MODE_PLAIN ) + { + GtkWidget *ww = glade_xml_get_widget_( info->main_window, "notebook18" ); + int deckpage = gtk_notebook_get_current_page( GTK_NOTEBOOK( ww )); + if(deckpage != 1) + { + int rate = 1; + if( info->el.fps > 1 ) + { + rate = info->el.fps; // less often + } + + if( (reload_entry_tick_ % rate)==0) + { + info->uc.reload_hint[HINT_ENTRY] = 1; + } + if( deckpage == 5 && info->status_tokens[STREAM_TYPE] == STREAM_GENERATOR){ + if( (reload_entry_tick_ % rate)==0) + { + info->uc.reload_hint[HINT_GENERATOR] = 1; + } + } + } + reload_entry_tick_++; + } + + if( info->status_tokens[CURRENT_ID] != history[CURRENT_ID] || last_pm != pm ) + { + info->uc.reload_hint[HINT_ENTRY] = 1; + info->uc.reload_hint[HINT_CHAIN] = 1; + info->uc.reload_hint[HINT_MACRO] = 1; + + if( pm != MODE_STREAM ) + info->uc.reload_hint[HINT_EL] = 1; + if( pm != MODE_PLAIN ) + info->uc.reload_hint[HINT_KF] = 1; + + if( pm == MODE_SAMPLE ) + timeline_set_selection( info->tl, TRUE ); + else + timeline_set_selection( info->tl, FALSE ); + + select_slot( info->status_tokens[PLAY_MODE] ); + + +#ifdef STRICT_CHECKING + if( pm != MODE_PLAIN ) + assert( info->selected_slot != NULL ); +#endif + } + + if( info->status_tokens[TOTAL_SLOTS] != history[TOTAL_SLOTS] ) + { + int n_samples = 0; + int n_streams = 0; + + if( pm == MODE_PLAIN || pm == MODE_SAMPLE ) { + n_samples = info->status_tokens[SAMPLE_COUNT]; + n_streams = info->status_tokens[SAMPLE_INV_COUNT]; + } + else { + n_streams = info->status_tokens[SAMPLE_COUNT]; + n_samples = info->status_tokens[SAMPLE_INV_COUNT]; + } + + if( (info->uc.real_num_samples > 0 && n_samples > info->uc.real_num_samples ) || + (info->uc.real_num_streams > 0 && n_streams > info->uc.real_num_streams) ) + { + info->uc.reload_hint[HINT_SLIST] = 1; + } + else { + info->uc.reload_hint[HINT_SLIST] = 2; + } + + info->uc.real_num_samples = n_samples; + info->uc.real_num_streams = n_streams; + } + + if( info->status_tokens[SAMPLE_LOOP_STAT_STOP] != history[SAMPLE_LOOP_STAT_STOP] ) { + update_label_i( "label_loop_stat_stop", info->status_tokens[SAMPLE_LOOP_STAT_STOP],0); + } + if( info->status_tokens[SAMPLE_LOOP_STAT ] != history[SAMPLE_LOOP_STAT] ) { + update_label_i( "label_loop_stats", info->status_tokens[SAMPLE_LOOP_STAT], 0); + } + + + if( info->status_tokens[SEQ_ACT] != history[SEQ_ACT] ) + { + info->uc.reload_hint[HINT_SEQ_ACT] = 1; + } + if( info->status_tokens[SEQ_CUR] != history[SEQ_CUR] ) + { + int in = info->status_tokens[SEQ_CUR]; + if( in < MAX_SEQUENCES ) + { + set_toggle_button( "seqactive" , 1 ); + indicate_sequence( FALSE, info->sequencer_view->gui_slot[ info->sequence_playing ] ); + info->sequence_playing = in; + indicate_sequence( TRUE, info->sequencer_view->gui_slot[ info->sequence_playing ] ); + } + else + { + indicate_sequence( FALSE, info->sequencer_view->gui_slot[ info->sequence_playing ] ); + set_toggle_button( "seqactive" , 0 ); + } + } + + total_frames_ = (pm == MODE_STREAM ? info->status_tokens[SAMPLE_MARKER_END] : info->status_tokens[TOTAL_FRAMES] ); + gint history_frames_ = (pm == MODE_STREAM ? history[SAMPLE_MARKER_END] : history[TOTAL_FRAMES] ); + gint current_frame_ = info->status_tokens[FRAME_NUM]; + + if( total_frames_ != history_frames_ || total_frames_ != (int) timeline_get_length(TIMELINE_SELECTION(info->tl))) + { + char *time = format_time( total_frames_,(double) info->el.fps ); + if( pm == MODE_STREAM ) + { + update_spin_value( "stream_length", info->status_tokens[SAMPLE_MARKER_END] ); + update_label_str( "stream_length_label", time ); + } + update_spin_range("button_fadedur", 0, total_frames_, ( total_frames_ > 25 ? 25 : total_frames_-1 ) ); + update_label_i( "label_totframes", total_frames_, 1 ); + update_label_str( "label_samplelength",time); + if( pm == MODE_PLAIN ) + { + for( i = 0; i < 3; i ++) + if(info->selection[i] > total_frames_ ) info->selection[i] = total_frames_; + update_spin_range("button_el_selstart", + 0, + total_frames_, + info->selection[0]); + update_spin_range("button_el_selend", + 0, + total_frames_, + info->selection[1]); + update_spin_range("button_el_selpaste", + 0, + total_frames_, + info->selection[2]); + } + update_label_i( "label_totframes", total_frames_, 1 ); + update_label_str( "label_totaltime", time ); + if(pm == MODE_SAMPLE) + update_label_str( "sample_length_label", time ); + else + update_label_str( "sample_length_label", "0:00:00:00" ); + + timeline_set_length( info->tl, + (gdouble) total_frames_ , current_frame_); + + if( pm != MODE_STREAM ) + info->uc.reload_hint[HINT_EL] = 1; + + free(time); + } + + info->status_frame = info->status_tokens[FRAME_NUM]; + timeline_set_pos( info->tl, (gdouble) info->status_frame ); + char *current_time_ = format_time( info->status_frame, (double) info->el.fps ); + update_label_i( "label_curframe", info->status_frame ,1 ); + update_label_str( "label_curtime", current_time_ ); + update_label_str( "label_sampleposition", current_time_); + free(current_time_); + + if( pm == MODE_SAMPLE ) + update_label_i( "label_samplepos", + info->status_frame , 1); + else + update_label_i( "label_samplepos" , 0 , 1 ); + + if( history[CURRENT_ID] != info->status_tokens[CURRENT_ID] ) + { + if(pm == MODE_SAMPLE || pm == MODE_STREAM) + update_label_i( "label_currentid", info->status_tokens[CURRENT_ID] ,0); + } + + if( history[STREAM_RECORDING] != info->status_tokens[STREAM_RECORDING] ) + { + if(pm == MODE_SAMPLE || pm == MODE_STREAM) + { + if( history[CURRENT_ID] == info->status_tokens[CURRENT_ID] ) + info->uc.reload_hint[HINT_RECORDING] = 1; + if( info->status_tokens[STREAM_RECORDING]) + vj_msg(VEEJAY_MSG_INFO, "Veejay is recording"); + else + vj_msg(VEEJAY_MSG_INFO, "Recording has stopped"); + } + } + + if( pm == MODE_PLAIN ) + { + if( history[SAMPLE_SPEED] != info->status_tokens[SAMPLE_SPEED] ) + { + int plainspeed = info->status_tokens[SAMPLE_SPEED]; + + update_slider_value( "speed_slider", plainspeed, 0); + if( plainspeed < 0 ) + info->play_direction = -1; + else + info->play_direction = 1; + if( plainspeed < 0 ) plainspeed *= -1; + if( plainspeed == 0 ) + { + update_label_str( "playhint", "Paused"); + } else + { + update_label_str( "playhint", "Playing"); + } + } + } + + if( pm == MODE_STREAM ) + { + if( info->status_tokens[STREAM_TYPE] == STREAM_VIDEO4LINUX ) + { + if(info->uc.cali_duration > 0 ) + { + GtkWidget *tb = glade_xml_get_widget_( info->main_window, "cali_take_button"); + info->uc.cali_duration--; + vj_msg(VEEJAY_MSG_INFO, + "Calibrate step %d of %d", + info->uc.cali_duration, + info->uc.cali_stage); + if(info->uc.cali_duration == 0) + { + info->uc.cali_stage ++; //@ cali_stage = 1, done capturing black frames + + switch(info->uc.cali_stage) + { + case 1: //@ capturing black frames + update_label_str( "current_step_label", + "Please take an image of a uniformly lit area in placed in front of your lens."); + gtk_button_set_label( GTK_BUTTON(tb), "Take White Frames"); + break; + case 2: + case 3: + update_label_str( "current_step_label", + "Image calibrated. You may need to adjust brightness."); + enable_widget( "cali_save_button"); + break; + default: + update_label_str( "current_step_label","Image calibrated. You may need to adjust brightness."); + gtk_button_set_label( GTK_BUTTON(tb), "Take Black Frames"); + veejay_msg(VEEJAY_MSG_ERROR, "Warning, mem leak if not reset first."); + break; + } + veejay_msg(VEEJAY_MSG_ERROR, "Label update for case %d", info->uc.cali_stage); + + if(info->uc.cali_stage >= 2 ) + { + info->uc.cali_stage = 0; + } + } + } + } + } + + update_current_slot(history, pm, last_pm); +// info->uc.playmode = pm; +} + +static void process_reload_hints(int *history, int pm) +{ + int *entry_tokens = &(info->uc.entry_tokens[0]); + + if( pm == MODE_STREAM ) + { + if(info->uc.reload_hint[HINT_V4L]) + load_v4l_info(); + + if( info->uc.reload_hint[HINT_RGBSOLID]) + update_colorselection(); + } + + if( info->uc.reload_hint[HINT_EL] ) + { + load_editlist_info(); + reload_editlist_contents(); + } + + if( info->uc.reload_hint[HINT_SLIST] ) + { + gboolean reload_sl = FALSE; + if( info->uc.reload_hint[HINT_SLIST] == 2 ) { + info->uc.expected_num_samples = -1; + info->uc.expected_num_streams = -1; + reload_sl = TRUE; + } + + load_samplelist_info( reload_sl ); + } + + if( info->uc.reload_hint[HINT_SEQ_ACT] == 1 ) + { + load_sequence_list(); + } + + if( info->uc.reload_hint[HINT_RECORDING] == 1 && pm != MODE_PLAIN) + { + if(info->status_tokens[STREAM_RECORDING]) + { + if(!info->uc.recording[pm]) init_recorder( info->status_tokens[STREAM_DURATION], pm ); + } + } + + if(info->uc.reload_hint[HINT_BUNDLES] == 1 ) + reload_bundles(); + + if( info->selected_slot && info->selected_slot->sample_id == info->status_tokens[CURRENT_ID] && + info->selected_slot->sample_type == 0 && pm == MODE_PLAIN) + { + if( history[SAMPLE_FX] != info->status_tokens[SAMPLE_FX]) + { + //also for stream (index is equivalent) + if(pm == MODE_SAMPLE) + set_toggle_button( "check_samplefx", + info->status_tokens[SAMPLE_FX]); + if(pm == MODE_STREAM) + set_toggle_button( "check_streamfx", + info->status_tokens[SAMPLE_FX]); + } + } + if( info->uc.reload_hint[HINT_CHAIN] == 1 ) + { + load_effectchain_info(); + } + + info->parameter_lock = 1; + if(info->uc.reload_hint[HINT_ENTRY] == 1 && pm != MODE_PLAIN) + { + gint np = 0; + gint i; + /* update effect description */ + info->uc.reload_hint[HINT_KF] = 1; + if( entry_tokens[ENTRY_FXID] == 0) + { + put_text( "entry_effectname" ,"" ); + // disable fx widgets but keep "button_fx_entry" enabled + disable_widget( "frame_fxtree2" ); + disable_widget( "entry_effectname"); + disable_widget( "button_entry_toggle"); + disable_widget( "tree_sources"); + disable_widget( "rgbkey"); + set_toggle_button( "button_entry_toggle", FALSE ); + set_toggle_button( "transition_enabled", FALSE); + update_spin_value( "transition_loop",0); + disable_widget( "transition_enabled"); + disable_widget( "transition_loop"); + disable_widget( "subrender_entry_toggle"); + update_label_str( "value_friendlyname", FX_PARAMETER_VALUE_DEFAULT_HINT ); + } + else + { + put_text( "entry_effectname", _effect_get_description( entry_tokens[ENTRY_FXID] )); + // enable fx widgets + enable_widget( "frame_fxtree2"); + enable_widget( "entry_effectname"); + enable_widget( "button_entry_toggle"); + enable_widget( "tree_sources"); + enable_widget( "rgbkey" ); + enable_widget( "transition_enabled" ); + enable_widget( "transition_loop" ); + enable_widget( "subrender_entry_toggle"); + set_toggle_button( "button_entry_toggle", entry_tokens[ENTRY_VIDEO_ENABLED] ); + set_toggle_button( "subrender_entry_toggle", entry_tokens[ENTRY_SUBRENDER_ENTRY]); + np = _effect_get_np( entry_tokens[ENTRY_FXID] ); + for( i = 0; i < np ; i ++ ) + { + enable_widget( slider_box_names_[i].text ); + enable_widget( param_kfs_[i].text ); + + gchar *tt1 = _utf8str(_effect_get_param_description(entry_tokens[ENTRY_FXID],i)); + set_tooltip( slider_names_[i].text, tt1 ); + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget_(info->main_window, + param_names_[i].text)), + tt1); + + gint min,max,value; + value = entry_tokens[ENTRY_PARAMSET + i]; + if( _effect_get_minmax( entry_tokens[ENTRY_FXID], &min,&max, i )) + { + update_slider_range( slider_names_[i].text,min,max, value, 0); + } + set_tooltip( param_kfs_[i].text, tt1 ); + g_free(tt1); + } + } + update_spin_value( "button_fx_entry", info->uc.selected_chain_entry); + update_spin_value( "transition_loop", entry_tokens[ENTRY_TRANSITION_LOOP] ); + set_toggle_button( "transition_enabled", entry_tokens[ENTRY_TRANSITION_ENABLED] ); + + for( i = np; i < MAX_UI_PARAMETERS; i ++ ) + { + gint min = 0, max = 1, value = 0; + update_slider_range( slider_names_[i].text, min,max, value, 0 ); + + disable_widget( slider_box_names_[i].text ); + disable_widget( param_kfs_[i].text ); + + set_tooltip( param_kfs_[i].text, NULL ); + set_tooltip( slider_names_[i].text, NULL ); + gtk_label_set_text(GTK_LABEL (glade_xml_get_widget_(info->main_window, + param_names_[i].text)), + NULL); + } + + GtkTreeView *view = GTK_TREE_VIEW(glade_xml_get_widget_(info->main_window, "tree_chain")); + GtkTreeModel *model = gtk_tree_view_get_model( view ); + + gtk_tree_model_foreach( model, chain_update_row, (gpointer*) info ); + + /* upate effect tree chain selection */ + { + GtkTreePath *path = gtk_tree_path_new_from_indices(info->uc.selected_chain_entry, -1); + gtk_tree_view_set_cursor (view, path, NULL, FALSE); + gtk_tree_path_free (path); + } + } + info->parameter_lock = 0; + + if( info->uc.reload_hint[HINT_GENERATOR]) + { + load_generator_info(); + } + + /* Curve needs update (start/end changed, effect id changed */ + if ( info->uc.reload_hint[HINT_KF] ) { + vj_kf_refresh(); + } + + if( beta__ && info->uc.reload_hint[HINT_HISTORY] ) { + reload_srt(); + } + + if( info->uc.reload_hint[HINT_MACRO] ) { + reload_macros(); + } + + veejay_memset( info->uc.reload_hint, 0, sizeof(info->uc.reload_hint )); +} + +void update_gui() +{ + int pm = info->status_tokens[PLAY_MODE]; + int last_pm = info->prev_mode; + + int *history = NULL; + + if( last_pm < 0 ) + history = info->history_tokens[0]; + else + history = info->history_tokens[ last_pm ]; + + if( info->uc.randplayer && pm != last_pm ) + { + info->uc.randplayer = 0; + set_toggle_button( "samplerand", 0 ); + } + + if( pm == MODE_PATTERN && last_pm != pm) + { + if(!info->uc.randplayer ) + { + info->uc.randplayer = 1; + set_toggle_button( "samplerand", 1 ); + } + info->status_tokens[PLAY_MODE] = MODE_SAMPLE; + pm = MODE_SAMPLE; + } + + update_globalinfo(history, pm, last_pm); + + process_reload_hints(history, pm); + on_vims_messenger(); + + update_cpumeter_timeout(NULL); + update_cachemeter_timeout(NULL); +} + +/* +void vj_fork_or_connect_veejay(char *configfile) +{ + char *files = get_text( "entry_filename" ); + int port = get_nums( "button_portnum" ); + gchar **args; + int n_args = 0; + char port_str[15]; + char config[512]; + char tmp[20]; + int i = 0; + + int arglen = vims_verbosity ? 15 :14 ; + arglen += (info->config.deinter); + arglen += (info->config.osc); + arglen += (info->config.vims); + args = g_new ( gchar *, arglen ); + + args[0] = g_strdup("veejay"); + + sprintf(port_str, "-p%d", port); + args[1] = g_strdup( port_str ); + + if(configfile) + sprintf(config, "-l%s", configfile); + + if( config_file_status == 0 ) + { + if(files == NULL || strlen(files)<= 0) + args[2] = g_strdup("-d"); + else + args[2] = g_strdup(files); +} + else + { + args[2] = g_strdup( config ); + } + + args[3] = g_strdup( "-O5" ); + sprintf(tmp, "-W%d", info->config.w ); + args[4] = g_strdup( tmp ); + sprintf(tmp, "-H%d", info->config.h ); + args[5] = g_strdup( tmp ); + sprintf(tmp, "-R%g", info->config.fps ); + args[6] = g_strdup( tmp ); + sprintf(tmp, "-N%d", info->config.norm ); + args[7] = g_strdup( tmp ); + sprintf(tmp, "-Y%d", info->config.pixel_format ); + args[8] = g_strdup( tmp ); + sprintf(tmp, "-m%d", info->config.sampling ); + args[9] = g_strdup( tmp ); + sprintf(tmp, "-c%d", info->config.sync ); + args[10] = g_strdup( tmp ); + sprintf(tmp, "-t%d", info->config.timer == 0 ? 0 : 2); + args[11] = g_strdup( tmp ); + sprintf(tmp, "-r%d", info->config.audio_rate ); + args[12] = g_strdup( tmp ); + args[13] = NULL; + int k=13; + while( k <= (arglen-1)) + args[k++] = NULL; + + if( vims_verbosity ) + args[13] = g_strdup( "-v" ); + + if( info->config.deinter ) + { + if(args[13]==NULL) + args[13] = g_strdup( "-I"); + else args[14] = g_strdup( "-I" ); + } + if( info->config.osc) + { + gchar osc_token[20]; + sprintf(osc_token , "-M %s", info->config.mcast_osc ); + int f = 13; + while(args[f] != NULL ) f ++; + args[f] = g_strdup( osc_token ); +} + if( info->config.vims) + { + gchar vims_token[20]; + sprintf(vims_token, "-V %s", info->config.mcast_vims ); + int f = 13; + while(args[f] != NULL) f++; + args[f] = g_strdup( vims_token ); + } + if( info->watch.state == STATE_STOPPED) + { + info->watch.state = STATE_CONNECT; + info->run_state = RUN_STATE_REMOTE; + } + + for( i = 0; i < n_args; i ++) + g_free(args[i]); +} +*/ + +void vj_gui_free() +{ + if(info) + { + int i; + if(info->client) + vj_client_free(info->client); + + for( i = 0; i < 4; i ++ ) + { + if(info->history_tokens[i]) + free(info->history_tokens[i]); + } + free(info); + } + info = NULL; + + vpf( fx_list_ ); + vpf( bankport_ ); +} + +void vj_gui_style_setup() +{ + if(!info) return; + info->color_map = gdk_screen_get_system_visual (gdk_screen_get_default ()); +} + +//~ NOT USED FIXME +//~ void send_refresh_signal(void) +//~ { + //~ GdkEventClient event; + //~ event.type = GDK_CLIENT_EVENT; + //~ event.send_event = TRUE; + //~ event.window = NULL; + //~ event.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE); + //~ event.data_format = 8; + //~ gdk_event_send_clientmessage_toall((GdkEvent *)&event); +//~ } + +//~ gint gui_client_event_signal(GtkWidget *widget, + //~ GdkEventClient *event, + //~ void *data) +//~ { + //~ static GdkAtom atom_rcfiles = GDK_NONE; + //~ if(!atom_rcfiles) + //~ atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE); + + //~ if(event->message_type == atom_rcfiles) + //~ { + //~ gtk_rc_parse( theme_file ); + + //~ gtk_widget_reset_rc_styles(glade_xml_get_widget_(info->main_window, + //~ "gveejay_window") + //~ ); + + //~ gtk_rc_reparse_all(); + + //~ veejay_msg(VEEJAY_MSG_WARNING, + //~ "Loaded GTK theme %s (catched _GTK_READ_RCFILES)", theme_file ); + //~ veejay_msg(VEEJAY_MSG_INFO, + //~ "If the new theme is using an engine that modifies the internal structure"); + //~ veejay_msg(VEEJAY_MSG_INFO, + //~ "of the widgets, there is no way for me to undo those changes and display"); + //~ veejay_msg(VEEJAY_MSG_INFO, + //~ "%s correctly", theme_file ); + //~ return TRUE; + //~ } + //~ return FALSE; +//~ } + +void vj_gui_set_debug_level(int level, int n_tracks, int pw, int ph ) +{ + veejay_set_debug_level( level ); + + vims_verbosity = level; + + if( !mt_set_max_tracks(n_tracks) ) { + mt_set_max_tracks(5); + } +} + +int vj_gui_get_preview_priority(void) +{ + return 1; +} + +void default_bank_values(int *col, int *row ) +{ + int nsc = 2; + int nsy = 6; + + if( *col == 0 && *row == 0 ) + { + NUM_SAMPLES_PER_COL = nsc; + NUM_SAMPLES_PER_ROW = nsy; + } + else + { + NUM_SAMPLES_PER_ROW = *row; + NUM_SAMPLES_PER_COL = *col; + } + NUM_SAMPLES_PER_PAGE = NUM_SAMPLES_PER_COL * NUM_SAMPLES_PER_ROW; + NUM_BANKS = (4096 / NUM_SAMPLES_PER_PAGE ); + + veejay_msg(VEEJAY_MSG_INFO, "Sample bank layout is %d rows by %d columns", NUM_SAMPLES_PER_ROW,NUM_SAMPLES_PER_COL ); +} + +int vj_gui_sleep_time( void ) +{ + float f = (float) info->status_tokens[ELAPSED_TIME]; + float t = info->el.fps; + + if( t <= 0.0 || t>= 200.0 ) + t = 25.0; + float n = (1.0 / t) * 1000.0f; + + if( f < n ) + return (int)( n - f ); + return (int) n; +} + +int vj_img_cb(GdkPixbuf *img ) +{ + int i; + if( !info->selected_slot || !info->selected_gui_slot ) { + return 0; + } + + int sample_id = info->status_tokens[ CURRENT_ID ]; + int sample_type = info->status_tokens[ PLAY_MODE ]; + + if( info->selected_slot->sample_type != sample_type || info->selected_slot->sample_id != sample_id ) { + return 0; + } + if( sample_type == MODE_SAMPLE || sample_type == MODE_STREAM ) + { + sample_slot_t *slot = find_slot_by_sample( sample_id, sample_type ); + sample_gui_slot_t *gui_slot = find_gui_slot_by_sample( sample_id, sample_type ); + + if( slot && gui_slot ) + { + slot->pixbuf = vj_gdk_pixbuf_scale_simple(img, + info->image_dimensions[0],info->image_dimensions[1], GDK_INTERP_NEAREST); + if(slot->pixbuf) { + gtk_image_set_from_pixbuf_( GTK_IMAGE( gui_slot->image ), slot->pixbuf ); + g_object_unref( slot->pixbuf ); + slot->pixbuf = NULL; + } + } + } + + for( i = 0; i < info->sequence_view->envelope_size; i ++ ) + { + sequence_gui_slot_t *g = info->sequence_view->gui_slot[i]; + sample_slot_t *s = info->selected_slot; + if(g->sample_id == info->selected_slot->sample_id && g->sample_type == info->selected_slot->sample_type && s->pixbuf) + { + g->pixbuf_ref = vj_gdk_pixbuf_scale_simple(img, + info->sequence_view->w, + info->sequence_view->h, + GDK_INTERP_NEAREST ); + if( g->pixbuf_ref) + { + gtk_image_set_from_pixbuf_( GTK_IMAGE( g->image ), g->pixbuf_ref ); + g_object_unref( g->pixbuf_ref ); + g->pixbuf_ref = NULL; + } + } + } + return 1; +} + +void vj_gui_cb(int state, char *hostname, int port_num) +{ + info->watch.state = STATE_RECONNECT; + put_text( "entry_hostname", hostname ); + update_spin_value( "button_portnum", port_num ); + + //@ clear status + int i; + for( i = 0; i < 4; i ++ ) { + int *h = info->history_tokens[i]; + veejay_memset( h, 0, sizeof(int) * STATUS_TOKENS ); + } +} + +void vj_gui_setup_defaults( vj_gui_t *gui ) +{ + gui->config.w = MAX_PREVIEW_WIDTH; + gui->config.h = MAX_PREVIEW_HEIGHT; + gui->config.fps = 25.0; + gui->config.sampling = 1; + gui->config.pixel_format = 1; + gui->config.sync = 1; + gui->config.timer = 1; + gui->config.deinter = 1; + gui->config.norm = 0; + gui->config.audio_rate = 0; + gui->config.osc = 0; + gui->config.vims = 0; + gui->config.mcast_osc = g_strdup( "224.0.0.32" ); + gui->config.mcast_vims = g_strdup( "224.0.0.33" ); +} + +static void reloaded_sighandler(int x) +{ + veejay_msg(VEEJAY_MSG_WARNING, "Caught signal %x", x); + + if( x == SIGPIPE ) { + reloaded_schedule_restart(); + } + else if ( x == SIGINT || x == SIGABRT ) { + veejay_msg(VEEJAY_MSG_WARNING, "Stopping reloaded"); + exit(0); + } else if ( x == SIGSEGV ) { + veejay_msg(VEEJAY_MSG_ERROR, "Found Gremlins in your system."); + veejay_msg(VEEJAY_MSG_WARNING, "No fresh ale found in the fridge."); + veejay_msg(VEEJAY_MSG_INFO, "Running with sub-atomic precision..."); + veejay_msg(VEEJAY_MSG_ERROR, "Bugs compromised the system."); + exit(0); + } +} + +static void veejay_backtrace_handler(int n , siginfo_t *si, void *ptr) +{ + switch(n) { + case SIGSEGV: + veejay_msg(VEEJAY_MSG_ERROR,"Found Gremlins in your system."); //@ Suggested by Matthijs + veejay_msg(VEEJAY_MSG_WARNING, "No fresh ale found in the fridge."); //@ + veejay_msg(VEEJAY_MSG_INFO, "Running with sub-atomic precision..."); //@ + + veejay_print_backtrace(); + break; + default: + veejay_print_backtrace(); + break; + } + + //@ Bye + veejay_msg(VEEJAY_MSG_ERROR, "Bugs compromised the system."); + report_bug(); + exit(EX_SOFTWARE); +} + +static void sigsegfault_handler(void) { + struct sigaction sigst; + sigst.sa_sigaction = veejay_backtrace_handler; + sigemptyset(&sigst.sa_mask); + sigaddset(&sigst.sa_mask, SIGSEGV ); + sigst.sa_flags = SA_SIGINFO | SA_ONESHOT; + if( sigaction(SIGSEGV, &sigst, NULL) == - 1 ) + veejay_msg(VEEJAY_MSG_ERROR,"%s", strerror(errno)); +} + +void register_signals() +{ + signal( SIGINT, reloaded_sighandler ); + signal( SIGPIPE, reloaded_sighandler ); + signal( SIGQUIT, reloaded_sighandler ); +// signal( SIGSEGV, reloaded_sighandler ); + signal( SIGABRT, reloaded_sighandler ); + + sigsegfault_handler(); +} + +void vj_gui_wipe() +{ + int i; + veejay_memset( info->status_tokens, 0, sizeof(int) * STATUS_TOKENS ); + veejay_memset( info->uc.entry_tokens,0, sizeof(int) * ENTRY_LAST); + for( i = 0 ; i < 4; i ++ ) + { + veejay_memset(info->history_tokens[i],0, sizeof(int) * (STATUS_TOKENS+1)); + } + + reset_samplebank(); +} + +GtkWidget *new_bank_pad(GtkWidget *box) +{ + GtkWidget *pad = info->sample_bank_pad = gtk_notebook_new(); + gtk_notebook_set_tab_pos( GTK_NOTEBOOK(pad), GTK_POS_BOTTOM ); + gtk_notebook_set_show_tabs( GTK_NOTEBOOK(pad ), FALSE ); + gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(pad), TRUE, TRUE, 0); + return pad; +} + +gboolean slider_scroll_event( GtkWidget *widget, GdkEventScroll *ev, gpointer user_data) +{ + gint i = GPOINTER_TO_INT(user_data); + if(ev->direction == GDK_SCROLL_UP ) { + PARAM_CHANGED( i, 1, slider_names_[i].text ); + } else if (ev->direction == GDK_SCROLL_DOWN ) { + PARAM_CHANGED( i, -1, slider_names_[i].text ); + } + return FALSE; +} + +gboolean speed_scroll_event( GtkWidget *widget, GdkEventScroll *ev, gpointer user_data) +{ + int plainspeed = info->status_tokens[SAMPLE_SPEED]; + if(ev->direction == GDK_SCROLL_UP ) { + plainspeed = plainspeed + 1; + } else if (ev->direction == GDK_SCROLL_DOWN ) { + plainspeed = plainspeed - 1; + } + update_slider_value( "speed_slider", plainspeed, 0 ); + return FALSE; +} + +gboolean slow_scroll_event( GtkWidget *widget, GdkEventScroll *ev, gpointer user_data) +{ + int plainspeed = get_slider_val("slow_slider"); + if(ev->direction == GDK_SCROLL_DOWN ) { + plainspeed = plainspeed - 1; + } else if (ev->direction == GDK_SCROLL_UP ) { + plainspeed = plainspeed + 1; + } + if(plainspeed < 1 ) + plainspeed = 1; + update_slider_value("slow_slider",plainspeed,0); + vj_msg(VEEJAY_MSG_INFO, "Slow video to %2.2f fps", + info->el.fps / (float) plainspeed ); + return FALSE; +} + +void vj_gui_set_geom( int x, int y ) +{ + geo_pos_[0] = x; + geo_pos_[1] = y; +} + +void vj_event_list_free() +{ + int i; + for( i = 0; i < VIMS_MAX; i ++ ) { + if( vj_event_list[i].format ) + free(vj_event_list[i].format); + if( vj_event_list[i].descr ) + free(vj_event_list[i].descr); + if( vj_event_list[i].args ) + free(vj_event_list[i].args); + } + + veejay_memset( vj_event_list, 0, sizeof(vj_event_list)); +} + +void vj_gui_init(const char *glade_file, + int launcher, + char *hostname, + int port_num, + int use_threads, + int load_midi, + char *midi_file, + gboolean beta, + gboolean auto_connect) +{ + int i; + char text[100]; + vj_gui_t *gui = (vj_gui_t*)vj_calloc(sizeof(vj_gui_t)); + if(!gui) + { + return; + } + snprintf( glade_path, sizeof(glade_path), "%s/%s",RELOADED_DATADIR,glade_file); + + veejay_msg(VEEJAY_MSG_DEBUG, "Loading glade file %s", glade_path); + + veejay_memset( gui->status_tokens, 0, sizeof(int) * STATUS_TOKENS ); + veejay_memset( gui->sample, 0, 2 ); + veejay_memset( gui->selection, 0, 3 ); + veejay_memset( &(gui->uc), 0, sizeof(veejay_user_ctrl_t)); + gui->uc.selected_parameter_id = -1; + veejay_memset( gui->uc.entry_tokens,0, sizeof(int) * ENTRY_LAST); + gui->prev_mode = -1; + veejay_memset( &(gui->el), 0, sizeof(veejay_el_t)); + gui->sample_banks = (sample_bank_t**) vj_calloc(sizeof(sample_bank_t*) * NUM_BANKS ); + + for( i = 0 ; i < 4; i ++ ) + { + gui->history_tokens[i] = (int*) vj_calloc(sizeof(int) * (STATUS_TOKENS+1)); + } + + slider_names_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + slider_box_names_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + param_names_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + param_incs_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + param_decs_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + param_kfs_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * MAX_UI_PARAMETERS ); + gen_decs_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * GENERATOR_PARAMS ); + gen_incs_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * GENERATOR_PARAMS ); + gen_names_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * GENERATOR_PARAMS ); + gen_box_names_ = (widget_name_t*) vj_calloc(sizeof(widget_name_t) * GENERATOR_PARAMS ); + + for( i = 0; i < MAX_UI_PARAMETERS; i ++ ) + { + snprintf(text,sizeof(text),"slider_p%d" , i ); + slider_names_[i].text = strdup( text ); + + snprintf(text,sizeof(text),"slider_box_p%d" , i ); + slider_box_names_[i].text = strdup( text ); + + snprintf(text,sizeof(text),"label_p%d" , i ); + param_names_[i].text = strdup( text ); + + snprintf(text,sizeof(text),"inc_p%d", i ); + param_incs_[i].text = strdup( text ); + + snprintf(text,sizeof(text), "dec_p%d", i ); + param_decs_[i].text = strdup( text ); + + snprintf(text,sizeof(text), "kf_p%d", i ); + param_kfs_[i].text = strdup( text ); + } + + for( i = 0; i < GENERATOR_PARAMS; i ++ ) + { + snprintf(text,sizeof(text), "slider_g%d",i); + gen_names_[i].text = strdup( text ); + + snprintf(text,sizeof(text), "slider_box_g%d",i); + gen_box_names_[i].text = strdup( text ); + + snprintf(text,sizeof(text), "dec_g%d", i); + gen_decs_[i].text = strdup(text); + + snprintf(text,sizeof(text), "inc_g%d", i ); + gen_incs_[i].text = strdup(text); + } + + gui->uc.reload_force_avoid = FALSE; + + veejay_memset( vj_event_list, 0, sizeof(vj_event_list)); + + gui->client = NULL; + GError* error = NULL; + gui->main_window = gtk_builder_new (); + if (!gtk_builder_add_from_file (gui->main_window, glade_path, &error)) + { + free(gui); + free(gui->main_window); + veejay_msg(VEEJAY_MSG_ERROR, "Couldn't load builder file: %s , %s", error->message, glade_path); + g_error_free (error); + return; + } + info = gui; + +// FIXME hardcoded ressource file + char css_path[1024]; + snprintf( css_path, sizeof(css_path), "%s/%s",RELOADED_DATADIR,"gveejay.reloaded.css"); + GtkCssProvider *css = gtk_css_provider_new(); + if(!gtk_css_provider_load_from_path(css, css_path, &error)) + { + veejay_msg(VEEJAY_MSG_ERROR, "Couldn't load style file: %s , %s", error->message, css_path); + g_error_free (error); + } + else + { + gtk_style_context_add_provider_for_screen ( gdk_screen_get_default (), + GTK_STYLE_PROVIDER (css), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + g_clear_object(&css); + + GtkWidget *mainw = glade_xml_get_widget_(info->main_window,"gveejay_window" ); + + //set "connection" button has default in veejay connection dialog + gtk_entry_set_activates_default(GTK_ENTRY(glade_xml_get_widget_( info->main_window, + "entry_hostname" )), + TRUE); + gtk_entry_set_activates_default(GTK_ENTRY(glade_xml_get_widget_( info->main_window, + "button_portnum" )), + TRUE); + GtkWidget *vj_button = glade_xml_get_widget_( info->main_window, "button_veejay" ); + gtk_widget_set_can_default(vj_button,TRUE); + GtkWidget *connection_dial = glade_xml_get_widget_( info->main_window, + "veejay_connection"); + gtk_window_set_transient_for (GTK_WINDOW(connection_dial),GTK_WINDOW (mainw)); + gtk_window_set_default(GTK_WINDOW(connection_dial), vj_button); + + gtk_builder_connect_signals( gui->main_window , NULL); + GtkWidget *frame = glade_xml_get_widget_( info->main_window, "markerframe" ); + info->tl = timeline_new(); + + set_tooltip_by_widget(info->tl, tooltips[TOOLTIP_TIMELINE].text ); + + g_signal_connect( info->tl, "pos_changed", + (GCallback) on_timeline_value_changed, NULL ); + g_signal_connect( info->tl, "in_point_changed", + (GCallback) on_timeline_in_point_changed, NULL ); + g_signal_connect( info->tl, "out_point_changed", + (GCallback) on_timeline_out_point_changed, NULL ); + g_signal_connect( info->tl, "bind_toggled", + (GCallback) on_timeline_bind_toggled, NULL ); + g_signal_connect( info->tl, "cleared", + (GCallback) on_timeline_cleared, NULL ); + + bankport_ = vpn( VEVO_ANONYMOUS_PORT ); + + gtk_container_add( GTK_CONTAINER(frame), info->tl ); + gtk_widget_show_all(frame); + +#ifdef STRICT_CHECKING + debug_spinboxes(); +#endif + + snprintf(text, sizeof(text), "Reloaded - version %s",VERSION); + gtk_label_set_text(GTK_LABEL(glade_xml_get_widget_(info->main_window, + "build_revision")), + text); + //~ NOT USED + //~ g_signal_connect_after( GTK_OBJECT(mainw), "client_event", + //~ GTK_SIGNAL_FUNC( G_CALLBACK(gui_client_event_signal) ), NULL ); + + g_signal_connect( mainw, "destroy", + G_CALLBACK( gveejay_quit ), + NULL ); + g_signal_connect( mainw, "delete-event", + G_CALLBACK( gveejay_quit ), + NULL ); + + GtkWidget *box = glade_xml_get_widget_( info->main_window, "sample_bank_hbox" ); + info->sample_bank_pad = new_bank_pad( box ); + + //QuickSelect slots + create_ref_slots( 10 ); + + //SEQ + create_sequencer_slots( SEQUENCER_COL, SEQUENCER_ROW ); + + veejay_memset( vj_event_list, 0, sizeof( vj_event_list )); + veejay_memset( vims_keys_list, 0, sizeof( vims_keys_list) ); + + gtk_widget_show( info->sample_bank_pad ); + + info->elref = NULL; + info->effect_info = NULL; + info->devlist = NULL; + info->chalist = NULL; + info->editlist = NULL; + + vj_gui_setup_defaults(gui); + setup_vimslist(); + setup_effectchain_info(); + setup_effectlist_info(); + setup_editlist_info(); + setup_samplelist_info(); + setup_v4l_devices(); + setup_macros(); + setup_colorselection(); + setup_rgbkey(); + setup_bundles(); + setup_server_files(); + setup_generators(); + + text_defaults(); + + GtkWidget *fgb = glade_xml_get_widget_(info->main_window, "boxtext" ); + GtkWidget *bgb = glade_xml_get_widget_(info->main_window, "boxbg" ); + GtkWidget *rb = glade_xml_get_widget_(info->main_window, "boxred" ); + GtkWidget *gb = glade_xml_get_widget_(info->main_window, "boxgreen" ); + GtkWidget *bb = glade_xml_get_widget_(info->main_window, "boxblue" ); + GtkWidget *lnb = glade_xml_get_widget_(info->main_window,"boxln" ); + g_signal_connect(G_OBJECT( bgb ), "draw", + G_CALLBACK( boxbg_draw ), NULL); + g_signal_connect(G_OBJECT( fgb ), "draw", + G_CALLBACK( boxfg_draw ), NULL); + g_signal_connect(G_OBJECT( lnb ), "draw", + G_CALLBACK( boxln_draw ), NULL); + g_signal_connect(G_OBJECT( rb ), "draw", + G_CALLBACK( boxred_draw ), NULL); + g_signal_connect(G_OBJECT( gb ), "draw", + G_CALLBACK( boxgreen_draw ), NULL); + g_signal_connect(G_OBJECT( bb ), "draw", + G_CALLBACK( boxblue_draw ), NULL); + + set_toggle_button( "button_252", vims_verbosity ); + + int pw = MAX_PREVIEW_WIDTH; + int ph = MAX_PREVIEW_HEIGHT; + + GtkWidget *img_wid = glade_xml_get_widget_( info->main_window, "imageA"); + + gui->mt = multitrack_new((void(*)(int,char*,int)) vj_gui_cb, + NULL, + glade_xml_get_widget_( info->main_window, + "gveejay_window" ), + glade_xml_get_widget_( info->main_window, + "mt_box" ), + glade_xml_get_widget_( info->main_window, + "statusbar") , + glade_xml_get_widget_( info->main_window, + "previewtoggle"), + pw, + ph, + img_wid, + (void*) gui, + use_threads); + + GtkWidget *curve_container = glade_xml_get_widget_( info->main_window,"curve_container" ); + gui->curve = gtk3_curve_new (); + gtk_container_add(GTK_CONTAINER(curve_container), gui->curve); + gtk_widget_show_all(curve_container); + + veejay_memset( &info->watch, 0, sizeof(watchdog_t)); + info->watch.state = STATE_WAIT_FOR_USER; // + + //connect client at first available server + //and try to connect multitrack to all existing server + if( auto_connect ) + { + for( i = DEFAULT_PORT_NUM; i < 9999; i+= 1000 ) + { + if (multrack_audoadd( gui->mt, "localhost", i) != -1 && auto_connect) + { + update_spin_value( "button_portnum", i ); + info->watch.state = STATE_CONNECT; + auto_connect = FALSE; + } + } + } + + veejay_memset(&(info->watch.p_time),0,sizeof(struct timeval)); + info->midi = vj_midi_new( info->main_window ); + gettimeofday( &(info->time_last) , 0 ); + + GtkWidget *srtbox = glade_xml_get_widget_( info->main_window, "combobox_textsrt"); + set_tooltip_by_widget( srtbox, tooltips[TOOLTIP_SRTSELECT].text); + + if(!beta) // srt-titling sequence stuff + { + GtkWidget *ww = glade_xml_get_widget_(info->main_window, "notebook18"); + GtkWidget *srtpad = gtk_notebook_get_nth_page(GTK_NOTEBOOK(ww),4); + gtk_widget_hide(srtpad); + } + + beta__ = beta; + + update_spin_range( "spin_framedelay", 1, MAX_SLOW, 0); + update_spin_range( "spin_samplespeed", -25,25,1); + update_slider_range( "speed_slider", -25,25,1,0); + update_slider_range( "slow_slider",1,MAX_SLOW,1,0); + + + if( load_midi ) + vj_midi_load(info->midi,midi_file); + + for( i = 0 ; i < MAX_UI_PARAMETERS; i ++ ) + { + GtkWidget *slider = glade_xml_get_widget_( info->main_window, slider_names_[i].text ); + g_signal_connect( slider, "scroll-event", G_CALLBACK(slider_scroll_event), (gpointer) castIntToGpointer(i) ); + update_slider_range( slider_names_[i].text, 0,1,0,0); + } + + g_signal_connect(glade_xml_get_widget_(info->main_window, "speed_slider"), "scroll-event", + G_CALLBACK(speed_scroll_event), NULL ); + g_signal_connect(glade_xml_get_widget_(info->main_window, "slow_slider"), "scroll-event", + G_CALLBACK(slow_scroll_event), NULL ); + + GtkWidget *lw = glade_xml_get_widget_( info->main_window, "veejay_connection"); + + if( geo_pos_[0] >= 0 && geo_pos_[1] >= 0 ) + gtk_window_move( GTK_WINDOW(lw), geo_pos_[0], geo_pos_[1] ); + + char *have_snoop = getenv( "RELOADED_KEY_SNOOP" ); + if( have_snoop == NULL ) + { + veejay_msg(VEEJAY_MSG_DEBUG, "Use setenv RELOADED_KEY_SNOOP=1 to mirror veejay server keyb layout" ); + }else + { + use_key_snoop = atoi(have_snoop); + if( use_key_snoop < 0 || use_key_snoop > 1 ) + use_key_snoop = 0; + } +} + +void vj_gui_preview(void) +{ + gint w = 0; + gint h = 0; + gint tmp_w = info->el.width; + gint tmp_h = info->el.height; + + multitrack_get_preview_dimensions( tmp_w,tmp_h, &w, &h ); + + update_spin_value( "priout_width", w ); + update_spin_value( "priout_height", h ); + + update_spin_range( "preview_width", 16, w, w); + update_spin_range( "preview_height", 16, h, h ); + + update_spin_incr( "preview_width", 16, 0 ); + update_spin_incr( "preview_height", 16, 0 ); + update_spin_incr( "priout_width", 16,0 ); + update_spin_incr( "priout_height", 16, 0 ); + + info->image_w = w; + info->image_h = h; + + GdkRectangle result; + widget_get_rect_in_screen( + glade_xml_get_widget_(info->main_window, "quickselect"), + &result + ); + gdouble ratio = (gdouble) h / (gdouble) w; + + gint image_width = 32; + gint image_height = 32 *ratio; + + info->sequence_view->w = image_width; + info->sequence_view->h = image_height; + gtk_widget_set_size_request_(info->quick_select, image_width, image_height ); +} + +void gveejay_preview( int p ) +{ + user_preview = p; +} + +int gveejay_user_preview() +{ + return user_preview; +} + +int vj_gui_reconnect(char *hostname,char *group_name, int port_num) +{ + int k = 0; + for( k = 0; k < 4; k ++ ) + veejay_memset( info->history_tokens[k] , 0, (sizeof(int) * STATUS_TOKENS) ); + + veejay_memset( info->status_tokens, 0, sizeof(int) * STATUS_TOKENS ); + + if(!hostname && !group_name ) + { + veejay_msg(VEEJAY_MSG_ERROR,"Invalid host/group name given"); + return 0; + } + + if(info->client ) + { + error_dialog("Warning", "You should disconnect first"); + return 0; + } + + if(!info->client) + { + info->client = vj_client_alloc(0,0,0); + if(!info->client) + { + return 0; + } + } + + if(!vj_client_connect( info->client, hostname, group_name, port_num ) ) + { + if(info->client) + vj_client_free(info->client); + info->client = NULL; + return 0; + } + + vj_msg(VEEJAY_MSG_INFO, + "New connection with Veejay running on %s port %d", + (group_name == NULL ? hostname : group_name), port_num ); + + veejay_msg(VEEJAY_MSG_INFO, + "Connection established with %s:%d (Track 0)", + hostname,port_num); + + info->status_lock = 1; + info->parameter_lock = 1; + info->uc.expected_num_samples = -1; + info->uc.expected_num_streams = -1; + info->uc.selected_chain_entry = -1; + + single_vims( VIMS_PROMOTION ); + + load_editlist_info(); + + update_slider_value( "framerate", info->el.fps, 0 ); + + veejay_memset( vims_keys_list, 0 , sizeof(vims_keys_list)); + veejay_memset( vj_event_list, 0, sizeof( vj_event_list)); + + load_effectlist_info(); + reload_vimslist(); + reload_editlist_contents(); + reload_bundles(); + + set_feedback_status(); + + GtkWidget *w = glade_xml_get_widget_(info->main_window, "gveejay_window" ); + gtk_widget_show( w ); + + if( geo_pos_[0] >= 0 && geo_pos_[1] >= 0 ) + gtk_window_move(GTK_WINDOW(w), geo_pos_[0], geo_pos_[1] ); + + /* int speed = info->status_tokens[SAMPLE_SPEED]; + if( speed < 0 ) + info->play_direction = -1; else info->play_direction=1; + if( speed < 0 ) speed *= -1;*/ + update_label_str( "label_hostnamex", (hostname == NULL ? group_name: hostname ) ); + update_label_i( "label_portx",port_num,0); + + info->status_lock = 0; + info->parameter_lock = 0; + + multitrack_configure(info->mt, + info->el.fps, + info->el.width, + info->el.height, + &preview_box_w_, + &preview_box_h_ ); + + vj_gui_preview(); + + info->uc.reload_hint[HINT_SLIST] = 2; + info->uc.reload_hint[HINT_CHAIN] = 1; + info->uc.reload_hint[HINT_ENTRY] = 1; + info->uc.reload_hint[HINT_SEQ_ACT] = 1; + info->uc.reload_hint[HINT_HISTORY] = 1; + + return 1; +} + +static void veejay_stop_connecting(vj_gui_t *gui) +{ + GtkWidget *veejay_conncection_window; + + if(!gui->sensitive) + vj_gui_enable(); + + info->launch_sensitive = 0; + + veejay_conncection_window = glade_xml_get_widget_(info->main_window, "veejay_connection"); + gtk_widget_hide(veejay_conncection_window); + GtkWidget *mw = glade_xml_get_widget_(info->main_window,"gveejay_window" ); + + gtk_widget_show( mw ); + if( geo_pos_[0] >= 0 && geo_pos_[1] >= 0 ) + gtk_window_move( GTK_WINDOW(mw), geo_pos_[0], geo_pos_[1] ); +} + +void reloaded_launcher(char *hostname, int port_num) +{ + info->watch.state = STATE_RECONNECT; + put_text( "entry_hostname", hostname ); + update_spin_value( "button_portnum", port_num ); +} + +void reloaded_show_launcher() +{ + info->watch.state = STATE_WAIT_FOR_USER; + info->launch_sensitive = TRUE; + + GtkWidget *mw = glade_xml_get_widget_(info->main_window,"veejay_connection" ); + gtk_widget_show(mw); +} + +void reloaded_schedule_restart() +{ + info->watch.state = STATE_STOPPED; +} + +void reloaded_restart() +{ + GtkWidget *mw = glade_xml_get_widget_(info->main_window,"gveejay_window" ); + // disable and hide mainwindow + if(info->sensitive) + vj_gui_disable(); + gtk_widget_hide( mw ); + + vj_gui_wipe(); + + multitrack_disconnect(info->mt); +/* + //@ bring up the launcher window + gtk_widget_show( cd ); +// info->watch.state = STATE_CONNECT; + info->watch.state = STATE_WAIT_FOR_USER; + info->launch_sensitive = TRUE; + + veejay_msg(VEEJAY_MSG_INFO, "Ready to make a connection to a veejay server");*/ +} + +gboolean is_alive( int *do_sync ) +{ + void *data = info; + vj_gui_t *gui = (vj_gui_t*) data; + + if( gui->watch.state == STATE_PLAYING ) + { + *do_sync = 1; + return TRUE; + } + + if( gui->watch.state == STATE_RECONNECT ) + { + vj_gui_disconnect(); + gui->watch.state = STATE_CONNECT; + } + + if(gui->watch.state == STATE_DISCONNECT ) + { + gui->watch.state = STATE_STOPPED; + vj_gui_disconnect(); + return FALSE; + } + + if( gui->watch.state == STATE_STOPPED ) + { + if(info->client) + vj_gui_disconnect(); + vj_gui_wipe(); + // reloaded_schedule_restart(); + reloaded_restart(); + // *do_sync = 0; + gui->watch.state = STATE_WAIT_FOR_USER; + if( info->launch_sensitive == 0 ) { + return FALSE; + } + + return TRUE; + // return FALSE; + } + + if( gui->watch.state == STATE_QUIT ) + { + if(info->client) vj_gui_disconnect(); + return FALSE; + } + + if( gui->watch.state == STATE_CONNECT ) + { + char *remote; + int port; + remote = get_text( "entry_hostname" ); + port = get_nums( "button_portnum" ); + + veejay_msg(VEEJAY_MSG_INFO, "Connecting to %s: %d", remote,port ); + if(!vj_gui_reconnect( remote, NULL, port )) + { + reloaded_schedule_restart(); + } + else + { + info->watch.state = STATE_PLAYING; + + if( use_key_snoop ) { + +#ifdef HAVE_SDL + info->key_id = gtk_key_snooper_install( key_handler , NULL); +#endif + } + multrack_audoadd( info->mt, remote, port ); + multitrack_set_quality( info->mt, 1 ); + + *do_sync = 1; + if( user_preview ) { + set_toggle_button( "previewtoggle", 1 ); + } + veejay_stop_connecting(gui); + } + } + + if( gui->watch.state == STATE_WAIT_FOR_USER ) + { + *do_sync = 0; + gveejay_sleep(NULL); + } + + return TRUE; +} + +void vj_gui_disconnect() +{ + if(info->key_id) + gtk_key_snooper_remove( info->key_id ); + free_samplebank(); + + if(info->client) + { + vj_client_close(info->client); + vj_client_free(info->client); + info->client = NULL; + } + /* reset all trees */ +// reset_tree("tree_effectlist"); +// reset_tree("tree_effectmixlist"); + + reset_fxtree(); + reset_tree("tree_chain"); + reset_tree("tree_sources"); + reset_tree("editlisttree"); + + multitrack_close_track(info->mt); + + reloaded_schedule_restart(); + info->key_id = 0; +} + +void vj_gui_disable() +{ + int i = 0; + + while( uiwidgets[i].name != NULL ) + { + disable_widget( uiwidgets[i].name ); + i++; + } + + info->sensitive = 0; +} + +void vj_gui_enable() +{ + int i =0; + while( uiwidgets[i].name != NULL) + { + enable_widget( uiwidgets[i].name ); + i++; + } + info->sensitive = 1; +} + +static void widget_get_rect_in_screen (GtkWidget *widget, GdkRectangle *r) +{ +//GdkRectangle extents; +//GdkWindow *window; +//window = GDK_WINDOW(gtk_widget_get_parent_window(widget)); /* getting parent window */ +//gdk_window_get_root_origin(window, &x,&y); /* parent's left-top screen coordinates */ +//gdk_drawable_get_size(window, &w,&h); /* parent's width and height */ +//gdk_window_get_frame_extents(window, &extents); /* parent's extents (including decorations) */ +//r->x = x + (extents.width-w)/2 + widget->allocation.x; /* calculating x (assuming: left border size == right border size) */ +//r->y = y + (extents.height-h)-(extents.width-w)/2 + widget->allocation.y; /* calculating y (assuming: left border size == right border size == bottom border size) */ + r->x = 0; + r->y = 0; + GtkAllocation all; + gtk_widget_get_allocation(widget, &all); + r->width = all.width; + r->height = all.height; +} + +/* -------------------------------------------------------------------------------------------------------------------------- + * Function that creates the sample-bank initially, just add the widget to the GUI and create references for the + * sample_banks-structure so that the widgets are easiely accessable + * The GUI componenets are in sample_bank[i]->gui_slot[j] + * + -------------------------------------------------------------------------------------------------------------------------- */ + +int power_of_2(int x) +{ + int p = 1; + while( p < x ) + p <<= 1; + return p; +} + +/* Add a page to the notebook and initialize slots */ +static int add_bank( gint bank_num ) +{ + gchar str_label[5]; + gchar frame_label[20]; + sprintf(str_label, "%d", bank_num ); + sprintf(frame_label, "Slots %d to %d", + (bank_num * NUM_SAMPLES_PER_PAGE), (bank_num * NUM_SAMPLES_PER_PAGE) + NUM_SAMPLES_PER_PAGE ); + + setup_samplebank( NUM_SAMPLES_PER_COL, NUM_SAMPLES_PER_ROW, info->sample_bank_pad, &(info->image_dimensions[0]), + &(info->image_dimensions[1]) ); + + info->sample_banks[bank_num] = (sample_bank_t*) vj_calloc(sizeof(sample_bank_t)); + info->sample_banks[bank_num]->bank_number = bank_num; + sample_slot_t **slot = (sample_slot_t**) vj_calloc(sizeof(sample_slot_t*) * NUM_SAMPLES_PER_PAGE); + sample_gui_slot_t **gui_slot = (sample_gui_slot_t**) vj_calloc(sizeof(sample_gui_slot_t*) * NUM_SAMPLES_PER_PAGE ); + + int j; + for(j = 0;j < NUM_SAMPLES_PER_PAGE; j ++ ) + { + slot[j] = (sample_slot_t*) vj_calloc(sizeof(sample_slot_t) ); + gui_slot[j] = (sample_gui_slot_t*) vj_calloc(sizeof(sample_gui_slot_t)); +// slot[j]->rawdata = (guchar*) vj_calloc(sizeof(guchar) * 3 * 128 * 128 ); + slot[j]->slot_number = j; + slot[j]->sample_id = -1; + slot[j]->sample_type = -1; + } + + info->sample_banks[bank_num]->slot = slot; + info->sample_banks[bank_num]->gui_slot = gui_slot; + + GtkWidget *sb = info->sample_bank_pad; + GtkWidget *frame = gtk_frame_new(frame_label); + GtkWidget *label = gtk_label_new( str_label ); + + gtk_container_set_border_width( GTK_CONTAINER( frame), 0 ); + + gtk_widget_show(frame); + info->sample_banks[bank_num]->page_num = gtk_notebook_append_page(GTK_NOTEBOOK(info->sample_bank_pad), frame, label); + + GtkWidget *table = gtk_table_new( NUM_SAMPLES_PER_COL, NUM_SAMPLES_PER_ROW, TRUE ); + gtk_container_add( GTK_CONTAINER(frame), table ); + gtk_widget_show(table); + gtk_widget_show(sb ); + + gint col, row; + for( col = 0; col < NUM_SAMPLES_PER_COL; col ++ ) + { + for( row = 0; row < NUM_SAMPLES_PER_ROW; row ++ ) + { + int slot_nr = col * NUM_SAMPLES_PER_ROW + row; + if(slot_nr < NUM_SAMPLES_PER_PAGE) + { + create_slot( bank_num, slot_nr ,info->image_dimensions[0], info->image_dimensions[1]); + sample_gui_slot_t *gui_slot = info->sample_banks[bank_num]->gui_slot[slot_nr]; + gtk_table_attach_defaults ( GTK_TABLE(table), gui_slot->event_box, row, row+1, col, col+1); + set_tooltip_by_widget( gui_slot->frame, tooltips[TOOLTIP_SAMPLESLOT].text); + } + } + } + + if( !info->normal ) + { + info->normal = widget_get_fg( GTK_WIDGET(info->sample_banks[bank_num]->gui_slot[0]->frame) ); + } + return bank_num; +} + +void reset_samplebank(void) +{ + info->selection_slot = NULL; + info->selection_gui_slot = NULL; + info->selected_slot = NULL; + info->selected_gui_slot = NULL; + int i,j; + for( i = 0; i < NUM_BANKS; i ++ ) + { + if(info->sample_banks[i]) + { + for(j = 0; j < NUM_SAMPLES_PER_PAGE ; j ++ ) + { + sample_slot_t *slot = info->sample_banks[i]->slot[j]; + + if(slot->sample_id) + { + if(slot->title) free(slot->title); + if(slot->timecode) free(slot->timecode); + if(slot->pixbuf) { + g_object_unref( slot->pixbuf ); + slot->pixbuf = NULL; + } + slot->title = NULL; + slot->timecode = NULL; + slot->sample_id = 0; + slot->sample_type = 0; + } + update_sample_slot_data( i,j, slot->sample_id,slot->sample_type,slot->title,slot->timecode); + } + } + } +} + +void free_samplebank(void) +{ + int i,j; + while( gtk_notebook_get_n_pages(GTK_NOTEBOOK(info->sample_bank_pad) ) > 0 ) + gtk_notebook_remove_page( GTK_NOTEBOOK(info->sample_bank_pad), -1 ); + + info->selection_slot = NULL; + info->selection_gui_slot = NULL; + info->selected_slot = NULL; + info->selected_gui_slot = NULL; + + for( i = 0; i < NUM_BANKS; i ++ ) + { + if(info->sample_banks[i]) + { + /* free memory in use */ + for(j = 0; j < NUM_SAMPLES_PER_PAGE ; j ++ ) + { + sample_slot_t *slot = info->sample_banks[i]->slot[j]; + sample_gui_slot_t *gslot = info->sample_banks[i]->gui_slot[j]; + if(slot->title) free(slot->title); + if(slot->timecode) free(slot->timecode); + if(slot->pixbuf) { + g_object_unref(slot->pixbuf); + slot->pixbuf = NULL; + } + free(slot); + free(gslot); + info->sample_banks[i]->slot[j] = NULL; + info->sample_banks[i]->gui_slot[j] = NULL; + } + free(info->sample_banks[i]); + info->sample_banks[i] = NULL; + } + } + veejay_memset( info->sample_banks, 0, sizeof(sample_bank_t*) * NUM_BANKS ); +} + +void setup_samplebank(gint num_cols, gint num_rows, GtkWidget *pad, int *idx, int *idy) +{ + GdkRectangle result; + widget_get_rect_in_screen( + pad, + &result + ); + + gint image_width = result.width / num_rows; + gint image_height = result.height / num_cols; + + if( image_width > 64 && image_height > 64 ) { + image_width -= 4; /* some spacing between slot border and image */ + image_height -= 4; + } + + float ratio = (float) info->el.height / (float) info->el.width; + + float w,h; + if( ratio <= 1.0f ) { + h = ratio * image_width; + w = image_width; + } + else { + h = image_height; + w = image_width / ratio; + } + + *idx = (int)w; + *idy = (int)h; +} + +/* -------------------------------------------------------------------------------------------------------------------------- + * Function that resets the visualized sample-informations of the samplebanks, it does this by going through all + * slots that allready used and resets them (which means cleaning the shown infos as well as set them free for further use) + * with_selection should be TRUE when the actual selection of a sample-bank-slot should also be reseted + * (what is for instance necessary when vj reconnected) + -------------------------------------------------------------------------------------------------------------------------- */ +static int bank_exists( int bank_page, int slot_num ) +{ + if(!info->sample_banks[bank_page]) + return 0; + return 1; +} + +static sample_slot_t *find_slot_by_sample( int sample_id , int sample_type ) +{ + char key[32]; + sprintf(key, "S%04d%02d",sample_id, sample_type ); + + void *slot = NULL; + vevo_property_get( bankport_, key, 0,&slot ); + if(!slot) + return NULL; + return (sample_slot_t*) slot; +} + +static sample_gui_slot_t *find_gui_slot_by_sample( int sample_id , int sample_type ) +{ + char key[32]; + sprintf(key, "G%04d%02d",sample_id, sample_type ); + + void *slot = NULL; + vevo_property_get( bankport_, key, 0,&slot ); + if(!slot) + return NULL; + return (sample_gui_slot_t*) slot; +} + +static int find_bank_by_sample(int sample_id, int sample_type, int *slot ) +{ + int i,j; + + for( i = 0; i < NUM_BANKS; i ++ ) + { + if(!info->sample_banks[i]) + { + continue; + } + + for( j = 0; j < NUM_SAMPLES_PER_PAGE; j ++ ) + { + if(info->sample_banks[i]->slot[j]->sample_id == sample_id && + info->sample_banks[i]->slot[j]->sample_type == sample_type) + { + *slot = j; +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_DEBUG, "using existing slot (%d,%d)", + sample_id,sample_type ); +#endif + return i; + } + } + } + + for( i = 0; i < NUM_BANKS; i ++ ) + { + if(!info->sample_banks[i]) + { + *slot = 0; + return i; + } + + for( j = 0; j < NUM_SAMPLES_PER_PAGE; j ++ ) + { + if ( info->sample_banks[i]->slot[j]->sample_id <= 0) + { + *slot = j; +#ifdef STRICT_CHECKING + veejay_msg(VEEJAY_MSG_DEBUG, "using new slot (%d,%d)", + sample_id,sample_type); +#endif + return i; + } + } + } + + *slot = -1; + return -1; +} + +static int find_bank(int page_nr) +{ + int i = 0; + for ( i = 0 ; i < NUM_BANKS; i ++ ) + if( info->sample_banks[i] && info->sample_banks[i]->page_num == page_nr ) + { + return info->sample_banks[i]->bank_number; + } + return -1; +} + +static void set_activation_of_cache_slot_in_samplebank(sequence_gui_slot_t *gui_slot, + gboolean activate) +{ + if (activate) + { + gtk_frame_set_shadow_type(GTK_FRAME(gui_slot->frame),GTK_SHADOW_IN); + } + else { + gtk_frame_set_shadow_type(GTK_FRAME(gui_slot->frame),GTK_SHADOW_ETCHED_IN); + } +} + +static gboolean on_sequencerslot_activated_by_mouse(GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + gint slot_nr = GPOINTER_TO_INT(user_data); + + if( event->type == GDK_BUTTON_PRESS && (event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK ) + { + multi_vims( VIMS_SEQUENCE_DEL, "%d", slot_nr ); + gtk_label_set_text(GTK_LABEL(info->sequencer_view->gui_slot[slot_nr]->image), + NULL ); + } + else + if(event->type == GDK_BUTTON_PRESS) + { + int id = info->status_tokens[CURRENT_ID]; + int type=info->status_tokens[STREAM_TYPE]; + if( info->selection_slot ) { + id = info->selection_slot->sample_id; + type=info->selection_slot->sample_type; + } + multi_vims( VIMS_SEQUENCE_ADD, "%d %d %d", slot_nr, id,type ); + info->uc.reload_hint[HINT_SEQ_ACT] = 1; + } + return FALSE; +} + +static gboolean on_cacheslot_activated_by_mouse (GtkWidget *widget, GdkEventButton *event, gpointer user_data) +{ + gint slot_nr = -1; + if(info->status_tokens[PLAY_MODE] == MODE_PLAIN ) + return FALSE; + + slot_nr =GPOINTER_TO_INT( user_data ); + set_activation_of_cache_slot_in_samplebank( info->sequence_view->gui_slot[slot_nr], FALSE ); + + if( event->type == GDK_BUTTON_PRESS && (event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK ) + { + info->current_sequence_slot = slot_nr; + sample_slot_t *s = info->selected_slot; + sequence_gui_slot_t *g = info->sequence_view->gui_slot[slot_nr]; +#ifdef STRICT_CHECKING + assert( s != NULL ); + assert( g != NULL ); +#endif + g->sample_id = s->sample_id; + g->sample_type = s->sample_type; + vj_msg(VEEJAY_MSG_INFO, "Placed %s %d in Memory slot %d", + (g->sample_type == 0 ? "Sample" : "Stream" ), g->sample_id, slot_nr ); + } + else + if(event->type == GDK_BUTTON_PRESS) + { + sequence_gui_slot_t *g = info->sequence_view->gui_slot[slot_nr]; + if(g->sample_id <= 0) + { + vj_msg(VEEJAY_MSG_ERROR, "Memory slot %d empty, put with SHIFT + mouse button1",slot_nr); + return FALSE; + } + multi_vims(VIMS_SET_MODE_AND_GO, "%d %d", g->sample_type, g->sample_id ); + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SET_MODE_AND_GO, g->sample_type,g->sample_id ); + } + return FALSE; +} + +static void create_sequencer_slots(int nx, int ny) +{ + GtkWidget *vbox = glade_xml_get_widget_ (info->main_window, "SampleSequencerBox"); + info->sample_sequencer = gtk_frame_new(NULL); + gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET(info->sample_sequencer), TRUE, TRUE, 0); + gtk_widget_show(info->sample_sequencer); + + info->sequencer_view = (sequence_envelope*) vj_calloc(sizeof(sequence_envelope) ); + info->sequencer_view->gui_slot = (sequence_gui_slot_t**) vj_calloc(sizeof(sequence_gui_slot_t*) * ( nx * ny + 1 ) ); + + GtkWidget *table = gtk_table_new( nx, ny, TRUE ); + + gtk_container_add( GTK_CONTAINER(info->sample_sequencer), table ); + gtk_widget_show(table); + + info->sequencer_col = nx; + info->sequencer_row = ny; + + gint col=0; + gint row=0; + gint k = 0; + for( col = 0; col < ny; col ++ ) + for( row = 0; row < nx; row ++ ) + { + sequence_gui_slot_t *gui_slot = (sequence_gui_slot_t*)vj_calloc(sizeof(sequence_gui_slot_t)); + info->sequencer_view->gui_slot[k] = gui_slot; + + gui_slot->event_box = gtk_event_box_new(); + gtk_event_box_set_visible_window(GTK_EVENT_BOX(gui_slot->event_box), TRUE); + gtk_widget_set_can_focus(gui_slot->event_box, TRUE); + + g_signal_connect( G_OBJECT(gui_slot->event_box), + "button_press_event", + G_CALLBACK(on_sequencerslot_activated_by_mouse), //@@@@ + (gpointer) castIntToGpointer(k) + ); + gtk_widget_show(GTK_WIDGET(gui_slot->event_box)); + + gui_slot->frame = gtk_frame_new(NULL); + gtk_container_set_border_width (GTK_CONTAINER(gui_slot->frame),0); + gtk_frame_set_shadow_type(GTK_FRAME( gui_slot->frame), GTK_SHADOW_IN ); + gtk_widget_show(GTK_WIDGET(gui_slot->frame)); + gtk_container_add (GTK_CONTAINER (gui_slot->event_box), gui_slot->frame); + + /* the slot main container */ + gui_slot->main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + gtk_container_add (GTK_CONTAINER (gui_slot->frame), gui_slot->main_vbox); + gtk_widget_show( GTK_WIDGET(gui_slot->main_vbox) ); + + gui_slot->image = gtk_label_new(NULL); + gtk_box_pack_start (GTK_BOX (gui_slot->main_vbox), GTK_WIDGET(gui_slot->image), TRUE, TRUE, 0); + gtk_widget_show( gui_slot->image); + gtk_table_attach_defaults ( GTK_TABLE(table), gui_slot->event_box, row, row+1, col, col+1); + k++; + } +// gtk_widget_set_size_request_( table, 300,300); +// info->sequencer_view->envelope_size = envelope_size; +} + +static void create_ref_slots(int envelope_size) +{ + gchar frame_label[50]; + GtkWidget *vbox = glade_xml_get_widget_ (info->main_window, "quickselect"); + info->quick_select = gtk_frame_new(NULL); + gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET(info->quick_select), TRUE, TRUE, 0); + gtk_widget_show(info->quick_select); + info->sequence_view = (sequence_envelope*) vj_calloc(sizeof(sequence_envelope) ); + info->sequence_view->gui_slot = (sequence_gui_slot_t**) vj_calloc(sizeof(sequence_gui_slot_t*) * envelope_size ); + sprintf(frame_label, "Last played" ); + GtkWidget *table = gtk_table_new( 1, envelope_size, TRUE ); + gtk_container_add( GTK_CONTAINER(info->quick_select), table ); + gtk_widget_show(table); + + gint col=0; + gint row=0; + for( row = 0; row < envelope_size; row ++ ) + { + sequence_gui_slot_t *gui_slot = (sequence_gui_slot_t*)vj_calloc(sizeof(sequence_gui_slot_t)); + info->sequence_view->gui_slot[row] = gui_slot; + gui_slot->event_box = gtk_event_box_new(); + gtk_event_box_set_visible_window(GTK_EVENT_BOX(gui_slot->event_box), TRUE); + gtk_widget_set_can_focus(gui_slot->event_box, TRUE); + /* Right mouse button is popup menu, click = play */ + g_signal_connect( G_OBJECT(gui_slot->event_box), + "button_press_event", + G_CALLBACK(on_cacheslot_activated_by_mouse), + (gpointer) castIntToGpointer(row) + ); + gtk_widget_show(GTK_WIDGET(gui_slot->event_box)); + /* the surrounding frame for each slot */ + gui_slot->frame = gtk_frame_new(NULL); + set_tooltip_by_widget(gui_slot->frame, tooltips[TOOLTIP_QUICKSELECT].text ); + gtk_container_set_border_width (GTK_CONTAINER(gui_slot->frame),1); + gtk_widget_show(GTK_WIDGET(gui_slot->frame)); + gtk_container_add (GTK_CONTAINER (gui_slot->event_box), gui_slot->frame); + + /* the slot main container */ + gui_slot->main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + gtk_container_add (GTK_CONTAINER (gui_slot->frame), gui_slot->main_vbox); + gtk_widget_show( GTK_WIDGET(gui_slot->main_vbox) ); + + /* The sample's image */ + gui_slot->image = gtk_image_new(); + gtk_box_pack_start (GTK_BOX (gui_slot->main_vbox), GTK_WIDGET(gui_slot->image), TRUE, TRUE, 0); +// gtk_widget_set_size_request_( gui_slot->image, info->sequence_view->w,info->sequence_view->h ); + gtk_widget_show( GTK_WIDGET(gui_slot->image)); + + gtk_table_attach_defaults ( GTK_TABLE(table), gui_slot->event_box, row, row+1, col, col+1); + } + info->sequence_view->envelope_size = envelope_size; +} + +static void create_slot(gint bank_nr, gint slot_nr, gint w, gint h) +{ + gchar hotkey[5]; + + sample_bank_t **sample_banks = info->sample_banks; + sample_gui_slot_t *gui_slot = sample_banks[bank_nr]->gui_slot[slot_nr]; + + // to reach clicks on the following GUI-Elements of one slot, they are packed into an event_box + gui_slot->event_box = gtk_event_box_new(); + gtk_event_box_set_visible_window(GTK_EVENT_BOX(gui_slot->event_box), TRUE); + + gtk_widget_set_can_focus(gui_slot->event_box, TRUE); + g_signal_connect( G_OBJECT(gui_slot->event_box), + "button_press_event", + G_CALLBACK(on_slot_activated_by_mouse), + (gpointer) castIntToGpointer(slot_nr) + ); + gtk_widget_show(GTK_WIDGET(gui_slot->event_box)); + /* the surrounding frame for each slot */ + gui_slot->frame = gtk_frame_new(NULL); + + gtk_container_set_border_width (GTK_CONTAINER(gui_slot->frame),0); + gtk_widget_show(GTK_WIDGET(gui_slot->frame)); + gtk_container_add (GTK_CONTAINER (gui_slot->event_box), GTK_WIDGET(gui_slot->frame)); + + /* the slot main container */ + gui_slot->main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + gtk_container_add (GTK_CONTAINER (gui_slot->frame), gui_slot->main_vbox); + gtk_widget_show( GTK_WIDGET(gui_slot->main_vbox) ); + + gui_slot->image = gtk_image_new(); +// gui_slot->image = gtk_drawing_area_new(); + gtk_box_pack_start (GTK_BOX (gui_slot->main_vbox), GTK_WIDGET(gui_slot->image), TRUE, TRUE, 0); +// gtk_widget_show(GTK_WIDGET(gui_slot->image)); + gtk_widget_set_size_request_( gui_slot->image, info->image_dimensions[0],info->image_dimensions[1] ); +/* + g_signal_connect( gui_slot->image, "expose_event", + G_CALLBACK(image_expose_event), + (gpointer) info->sample_banks[bank_nr]->slot[slot_nr]->slot_number ); +*/ + gtk_widget_show( GTK_WIDGET(gui_slot->image)); + + /* the upper container for all slot-informations */ + gui_slot->upper_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0); + gtk_box_pack_start (GTK_BOX (gui_slot->main_vbox), gui_slot->upper_hbox, FALSE, TRUE, 0); + gtk_widget_show(GTK_WIDGET(gui_slot->upper_hbox)); + + if( sample_banks[bank_nr]->slot[slot_nr]->sample_type >= 0 ) + { + /* the hotkey that is assigned to this slot */ + snprintf(hotkey,sizeof(hotkey), "F-%d", (slot_nr+1)); + gui_slot->hotkey = gtk_label_new(hotkey); + } + else + { + gui_slot->hotkey = gtk_label_new(""); + } + + gtk_misc_set_alignment(GTK_MISC(gui_slot->hotkey), 0.0, 0.0); + gtk_misc_set_padding (GTK_MISC(gui_slot->hotkey), 0, 0); + gtk_box_pack_start (GTK_BOX (gui_slot->upper_hbox), GTK_WIDGET(gui_slot->hotkey), FALSE, FALSE, 0); + gtk_widget_show(GTK_WIDGET(gui_slot->hotkey)); + gui_slot->upper_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,0); + gtk_box_pack_start (GTK_BOX (gui_slot->upper_hbox), gui_slot->upper_vbox, TRUE, TRUE, 0); + gtk_widget_show(GTK_WIDGET(gui_slot->upper_vbox)); + gui_slot->title = gtk_label_new(""); + + gui_slot->timecode = gtk_label_new(""); + gtk_misc_set_alignment(GTK_MISC(gui_slot->timecode), 0.5, 0.0); + gtk_misc_set_alignment(GTK_MISC(gui_slot->title), 0.5, 0.0); + + gtk_misc_set_padding (GTK_MISC(gui_slot->timecode), 0,0 ); + gtk_box_pack_start (GTK_BOX (gui_slot->upper_vbox), GTK_WIDGET(gui_slot->timecode), FALSE, FALSE, 0); + gtk_widget_show(GTK_WIDGET(gui_slot->timecode)); +} + + +/* -------------------------------------------------------------------------------------------------------------------------- + * Handler of mouse clicks on the GUI-elements of one slot + * single-click activates the slot and the loaded sample (if there is one) + * double-click or tripple-click activates it and plays it immediatelly + -------------------------------------------------------------------------------------------------------------------------- */ +static gboolean on_slot_activated_by_mouse (GtkWidget *widget, GdkEventButton *event, gpointer user_data) +{ + gint bank_nr = -1; + gint slot_nr = -1; + + bank_nr = find_bank( gtk_notebook_get_current_page(GTK_NOTEBOOK(info->sample_bank_pad))); + if(bank_nr < 0 ) + return FALSE; + + slot_nr = GPOINTER_TO_INT(user_data); + sample_bank_t **sample_banks = info->sample_banks; + + if( info->sample_banks[ bank_nr ]->slot[ slot_nr ]->sample_id <= 0 ) + return FALSE; + + if( event->type == GDK_2BUTTON_PRESS ) + { + sample_slot_t *s = sample_banks[bank_nr]->slot[slot_nr]; + multi_vims( VIMS_SET_MODE_AND_GO, "%d %d", (s->sample_type==0? 0:1), s->sample_id); + vj_midi_learning_vims_msg2( info->midi, NULL, VIMS_SET_MODE_AND_GO, s->sample_type, s->sample_id ); + vj_msg(VEEJAY_MSG_INFO, + "Start playing %s %d", + (s->sample_type==0 ? "Sample" : "Stream" ), s->sample_id ); + } + else if(event->type == GDK_BUTTON_PRESS ) + { + if( (event->state & GDK_SHIFT_MASK ) == GDK_SHIFT_MASK ) + { + sample_slot_t *x = sample_banks[bank_nr]->slot[slot_nr]; + multi_vims( VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL, + "%d %d %d %d", + 0, + info->uc.selected_chain_entry, + x->sample_type, + x->sample_id ); + + if(x->sample_id == 1 ) + { + vj_msg(VEEJAY_MSG_INFO, + "Set mixing channel %d to Stream %d", + info->uc.selected_chain_entry, + x->sample_id ); + } else + { + vj_msg(VEEJAY_MSG_INFO, + "Set mixing channel %d to Sample %d", + info->uc.selected_chain_entry, + x->sample_id); + } + + char trip[100]; + snprintf(trip, sizeof(trip), "%03d:%d %d %d %d",VIMS_CHAIN_ENTRY_SET_SOURCE_CHANNEL, + 0, + info->uc.selected_chain_entry, + x->sample_type, + x->sample_id ); + + vj_midi_learning_vims( info->midi, NULL, trip, 0 ); + } else + { + if(info->selection_slot) + set_selection_of_slot_in_samplebank(FALSE); + info->selection_slot = sample_banks[bank_nr]->slot[slot_nr]; + info->selection_gui_slot = sample_banks[bank_nr]->gui_slot[slot_nr]; + + set_selection_of_slot_in_samplebank(TRUE ); + } + } + return FALSE; +} + +static void indicate_sequence( gboolean active, sequence_gui_slot_t *slot ) +{ + if(!active) + gtk_frame_set_shadow_type( GTK_FRAME(slot->frame), GTK_SHADOW_IN ); + else + gtk_frame_set_shadow_type( GTK_FRAME(slot->frame), GTK_SHADOW_OUT ); +} + +static void set_activation_of_slot_in_samplebank( gboolean activate) +{ + if(!info->selected_gui_slot || !info->selected_slot ) + return; + GdkRGBA color; + color.red = info->normal->red; + color.green = info->normal->green; + color.blue = info->normal->blue; + + if( activate ) { + color.green = 0xffff; + color.red = 0; + color.blue = 0; + } + + if(info->selected_slot->sample_id <= 0 ) + { + gtk_frame_set_shadow_type( GTK_FRAME(info->selected_gui_slot->frame), GTK_SHADOW_ETCHED_IN ); + } + else + { + if (activate) + { + gtk_frame_set_shadow_type(GTK_FRAME(info->selected_gui_slot->frame),GTK_SHADOW_IN); + gtk_widget_grab_focus(GTK_WIDGET(info->selected_gui_slot->frame)); + } + else + { + gtk_frame_set_shadow_type(GTK_FRAME(info->selected_gui_slot->frame),GTK_SHADOW_ETCHED_IN); + } + } + + gtk_widget_override_color ( GTK_WIDGET(info->selected_gui_slot->timecode), + GTK_STATE_FLAG_NORMAL, + &color ); +} + +static void set_selection_of_slot_in_samplebank(gboolean active) +{ + if(!info->selection_slot || info->selection_slot->sample_id <= 0) + return; + + GdkRGBA color; + color.red = info->normal->red; + color.green = info->normal->green; + color.blue = info->normal->blue; + + if(info->selected_slot == info->selection_slot) + { + color.green = 0xffff; + color.red = 0; + color.blue = 0; + } + else if(active) + { + color.blue = 0xffff; + color.green = 0; + color.red =0; + } + +// gtk_widget_override_color ( GTK_WIDGET(info->selection_gui_slot->title), +// GTK_STATE_NORMAL, &color ); + gtk_widget_override_color ( GTK_WIDGET(info->selected_gui_slot->timecode), + GTK_STATE_FLAG_NORMAL, + &color ); +// gtk_widget_override_color ( gtk_frame_get_label_widget( info->selection_gui_slot->frame ), +// GTK_STATE_NORMAL, &color ); +} + +static int add_sample_to_sample_banks(int bank_page,sample_slot_t *slot) +{ + int bp = 0; int s = 0; +#ifdef STRICT_CHECKING + int result = verify_bank_capacity( &bp, &s, slot->sample_id, slot->sample_type ); + + veejay_msg(VEEJAY_MSG_DEBUG, + "add slot on page %d: type=%d id=%d. result=%d", + bank_page,slot->sample_type,slot->sample_id,result ); + + if( result ) + update_sample_slot_data( bp, s, slot->sample_id,slot->sample_type,slot->title,slot->timecode); + +#else + if(verify_bank_capacity( &bp, &s, slot->sample_id, slot->sample_type )) + update_sample_slot_data( bp, s, slot->sample_id,slot->sample_type,slot->title,slot->timecode); +#endif + return 1; +} + + +/* -------------------------------------------------------------------------------------------------------------------------- + * Removes a selected sample from the specific sample-bank-slot and update the free_slots-GList as well as + -------------------------------------------------------------------------------------------------------------------------- */ +static void remove_sample_from_slot() +{ + gint bank_nr = -1; + gint slot_nr = -1; + + bank_nr = find_bank( gtk_notebook_get_current_page( + GTK_NOTEBOOK( info->sample_bank_pad ) ) ); + if(bank_nr < 0 ) + return; + if(!info->selection_slot) + return; + + slot_nr = info->selection_slot->slot_number; + + if( info->selection_slot->sample_id == info->status_tokens[CURRENT_ID] && + info->selection_slot->sample_type == info->status_tokens[STREAM_TYPE] ) + { + gchar error_msg[100]; + sprintf(error_msg, "Cannot delete %s %d while playing", + (info->selection_slot->sample_type == MODE_SAMPLE ? "Sample" : "Stream" ), + info->selection_slot->sample_id ); + message_dialog( "Error while deleting", error_msg ); + + return; + } + + multi_vims( (info->selection_slot->sample_type == 0 ? VIMS_SAMPLE_DEL : + VIMS_STREAM_DELETE ), + "%d", + info->selection_slot->sample_id ); + + update_sample_slot_data( bank_nr, slot_nr, 0, -1, NULL, NULL); + + sample_gui_slot_t *gui_slot = info->sample_banks[bank_nr]->gui_slot[slot_nr]; + if(gui_slot) + gtk_image_clear( GTK_IMAGE( gui_slot->image) ); + + //set_selection_of_slot_in_samplebank( FALSE ); + + info->selection_gui_slot = NULL; + info->selection_slot = NULL; + + info->uc.reload_hint[HINT_SLIST] = 2; + +} + + +/* -------------------------------------------------------------------------------------------------------------------------- + * Function adds the given infos to the list of effect-sources + -------------------------------------------------------------------------------------------------------------------------- */ +static void add_sample_to_effect_sources_list(gint id, + gint type, + gchar *title, + gchar *timecode) +{ + gchar id_string[512]; + GtkTreeIter iter; + + if (type == STREAM_NO_STREAM) + snprintf( id_string,sizeof(id_string), "S[%4d] %s", id, title); + else + snprintf( id_string,sizeof(id_string), "T[%4d]", id); + + gtk_list_store_append( effect_sources_store, &iter ); + gtk_list_store_set(effect_sources_store, &iter, + SL_ID, id_string, + SL_DESCR, title, + SL_TIMECODE , timecode, + -1 ); + + GtkTreeIter iter2; + if(type == STREAM_NO_STREAM) + { + gtk_list_store_append( cali_sourcestore,&iter2); + gtk_list_store_set(cali_sourcestore,&iter2, + SL_ID, id_string, + SL_DESCR,title, + SL_TIMECODE,timecode, + -1); + } +} + +/* + Update a slot, either set from function arguments or clear it + */ +static void update_sample_slot_data(int page_num, + int slot_num, + int sample_id, + gint sample_type, + gchar *title, + gchar *timecode) +{ + sample_slot_t *slot = info->sample_banks[page_num]->slot[slot_num]; + sample_gui_slot_t *gui_slot = info->sample_banks[page_num]->gui_slot[slot_num]; + + if(slot->timecode) { free(slot->timecode); slot->timecode = NULL; } + if(slot->title) { free(slot->title); slot->title = NULL; } + + slot->sample_id = sample_id; + slot->sample_type = sample_type; + + slot->timecode = timecode == NULL ? NULL : strduplastn( timecode ); + slot->title = title == NULL ? NULL : strduplastn( title ); + + if( sample_id ) + { + char sample_key[32]; + snprintf(sample_key,sizeof(sample_key), "S%04d%02d", sample_id, sample_type ); + vevo_property_set( bankport_, sample_key, VEVO_ATOM_TYPE_VOIDPTR,1, &slot ); + snprintf(sample_key,sizeof(sample_key), "G%04d%02d", sample_id, sample_type ); + vevo_property_set( bankport_, sample_key, VEVO_ATOM_TYPE_VOIDPTR,1,&gui_slot); + } + + if(gui_slot) + { + if(sample_id > 0 ) + { + gtk_frame_set_label( GTK_FRAME(gui_slot->frame),slot->title ); + gtk_label_set_text( GTK_LABEL( gui_slot->timecode ), slot->timecode ); + gtk_label_set_text( GTK_LABEL( gui_slot->title ), slot->title ); + } + else + { + gtk_frame_set_label(GTK_FRAME(gui_slot->frame), "" ); + gtk_label_set_text( GTK_LABEL(gui_slot->timecode), "" ); + gtk_label_set_text( GTK_LABEL(gui_slot->title), "" ); + } + } + + if( sample_id == 0 ) + { + if(slot->pixbuf) + { + g_object_unref( slot->pixbuf ); + slot->pixbuf = NULL; + } + } +} + +void veejay_release_track(int id, int release_this) +{ + multitrack_release_track( info->mt, id, release_this ); +} + +void veejay_bind_track( int id, int bind_this ) +{ + multitrack_bind_track(info->mt, id, bind_this ); + info->uc.reload_hint[HINT_SLIST] = 2; +} diff --git a/veejay-current/reloaded-gtk3/src/vj-api.h b/veejay-current/reloaded-gtk3/src/vj-api.h new file mode 100644 index 00000000..c115181f --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/vj-api.h @@ -0,0 +1,77 @@ +/* gveejay - Linux VeeJay - GVeejay GTK+-2/Glade User Interface + * (C) 2002-2005 Niels Elburg + * + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef VJAPI_H +#define VJAPI_H + +#include + +#define DEFAULT_PORT_NUM 3490 + +int veejay_tick(); +void veejay_preview(int p); +int veejay_update_multitrack(); +void veejay_sleep( void *ui ); +void reloaded_restart(); +void *get_ui_info(); +char *get_glade_path(); +char *get_gveejay_dir(); +int get_total_frames(); +void get_gd(char *buf, char *suf, const char *filename); + +void set_disable_sample_image(gboolean status); + +void default_bank_values(int *col, int *row ); +gboolean is_alive( int *sync ); + +int _effect_get_minmax( int effect_id, int *min, int *max, int index ); +void register_signals(); +int is_button_toggled(const char *name); +gchar *_utf8str( const char *c_str ); + +void vj_gui_cb(int state, char *hostname, int port_num); +void vj_gui_init(const char *glade_file, int launcher, char *hostname, int port_num, int threads,int load_midi, char *midi_file, gboolean beta, gboolean autoconnect); +int vj_gui_reconnect( char *host, char *group, int port); +void vj_gui_free(); +void vj_gui_wipe(); +void vj_gui_enable(void); +void vj_gui_disable(void); +void vj_gui_disconnect(void); +int vj_get_preview_box_w(); +int vj_get_preview_box_h(); +void vj_gui_set_geom(int x, int y); +void vj_gui_set_debug_level(int level, int preview_p, int pw, int ph); +void vj_gui_set_timeout(int timer); +int vj_gui_sleep_time( void ); +void vj_gui_style_setup(); + +int vj_img_cb(GdkPixbuf *img ); +void vj_fork_or_connect_veejay(); +void vj_event_list_free(); +gboolean gveejay_running(); +gboolean gveejay_relaunch(); +int gveejay_user_preview(); +void gveejay_preview(int p); +int gveejay_restart(); +int gveejay_update(); +int gveejay_time_to_sync( void *ptr ); +int update_gveejay(); +void reloaded_show_launcher(); +void reloaded_restart (); +#endif diff --git a/veejay-current/reloaded-gtk3/src/vj-midi.c b/veejay-current/reloaded-gtk3/src/vj-midi.c new file mode 100644 index 00000000..b2aea661 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/vj-midi.c @@ -0,0 +1,599 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2007 Niels Elburg + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +extern GtkWidget *glade_xml_get_widget_( GtkBuilder *m, const char *name ); +extern void msg_vims(char *message); +extern void vj_msg(int type, const char format[], ...); +extern int prompt_dialog(const char *title, char *msg); +static int vj_midi_events(void *vv ); + +typedef struct +{ + snd_seq_t *sequencer; + void *vims; + struct pollfd *pfd; + int npfd; + int learn; + int learn_event[4]; + int active; + void *mw; +} vmidi_t; + +typedef struct +{ + int extra; + char *widget; + char *msg; +} dvims_t; + + +void vj_midi_learn( void *vv ) +{ + vmidi_t *v = (vmidi_t*) vv; + if(!v->active) return; + v->learn = 1; + vj_msg(VEEJAY_MSG_INFO, "Learning MIDI commands. Touch a midi key and then click a widget"); +} + +void vj_midi_play(void *vv ) +{ + vmidi_t *v = (vmidi_t*) vv; + if(!v->active) return; + + v->learn = 0; + int a = vj_midi_events(vv); + char msg[100]; + snprintf(msg,sizeof(msg), "MIDI listener active, %d events registered", a ); + vj_msg(VEEJAY_MSG_INFO, "%s",msg); +} +static int vj_midi_events(void *vv ) +{ + vmidi_t *v = (vmidi_t*)vv; + char **items = vevo_list_properties(v->vims); + if(!items) return 0; + + int i; + int len = 0; + for( i = 0; items[i] != NULL ; i ++ ) + { + len ++; + free(items[i]); + } + free(items); + return len; +} +void vj_midi_reset( void *vv ) +{ + vmidi_t *v = (vmidi_t*)vv; + + int a = vj_midi_events(vv); + if( a > 0 ) + { + char warn[200]; + snprintf(warn,sizeof(warn), "This will clear %d MIDI events, Continue ?",a ); + if( prompt_dialog( "MIDI", warn ) == GTK_RESPONSE_REJECT ) + return; + + } + + char **items = vevo_list_properties(v->vims); + if(!items) { + vj_msg(VEEJAY_MSG_INFO,"No MIDI events to clear"); + return; + } + int i; + for( i = 0; items[i] != NULL ; i ++ ) + { + dvims_t *d = NULL; + if( vevo_property_get( v->vims, items[i],0,&d ) == VEVO_NO_ERROR ) + { + if(d->msg) free(d->msg); + if(d->widget) free(d->widget); + free(d); + } + free(items[i]); + } + free(items); + + vpf(v->vims); + + v->vims = vpn(VEVO_ANONYMOUS_PORT); + + vj_msg(VEEJAY_MSG_INFO, "Cleared %d MIDI events.",a); +} + +void vj_midi_load(void *vv, const char *filename) +{ + vmidi_t *v = (vmidi_t*) vv; + if(!v->active) return; + + int a = vj_midi_events(vv); + if( a > 0 ) + { + char warn[200]; + snprintf(warn,sizeof(warn), "There are %d MIDI event known, loading from file will overwrite any existing events. Continue ?", a ); + if( prompt_dialog( "MIDI", warn ) == GTK_RESPONSE_REJECT ) + return; + + } + + int fd = open( filename, O_RDONLY ); + if(!fd) + { + vj_msg(VEEJAY_MSG_ERROR, "Unable to open file '%s': %s", filename, strerror(errno)); + return; + } + struct stat t; + if( fstat( fd, &t) != 0 ) + { + veejay_msg(0, "Error loading MIDI config '%s':%s",filename,strerror(errno)); + vj_msg(VEEJAY_MSG_ERROR,"Unable to load %s: %s", filename, strerror(errno)); + return; + } + else + { + if( !S_ISREG( t.st_mode ) && !S_ISLNK(t.st_mode) ) + { + vj_msg(VEEJAY_MSG_ERROR, "File '%s' is not a regular file or symbolic link. Refusing to load it.", + filename ); + return; + } + } + + char *buf = (char*) vj_calloc( 128000 ); + uint32_t count = 0; + if (read( fd, buf, 128000 ) > 0 ) + { + int len = strlen( buf ); + int j,k=0; + + char value[1024]; + veejay_memset(value,0,sizeof(value)); + + for( j = 0; j < len; j ++ ) + { + if( buf[j] == '\0' ) break; + if( buf[j] == '\n' ) + { + char key[32]; + char widget[100]; + char message[512]; + int extra = 0; + + veejay_memset( key,0,sizeof(key)); + veejay_memset( widget,0,sizeof(widget)); + veejay_memset( message,0,sizeof(message)); + + if(sscanf( value, "%s %d %s \"%[^\"]", key, &extra, widget, message ) == 4 ) + { + veejay_memset( value,0,sizeof(value)); + k = 0; + dvims_t *d = (dvims_t*) vj_calloc(sizeof(dvims_t)); + dvims_t *cur = NULL; + d->extra = extra; + d->widget = NULL; + if( strncasecmp( widget, "none", 4 ) !=0 ) + d->widget = strdup(widget); + d->msg = strdup(message); + if( vevo_property_get( v->vims, key, 0, &cur ) == VEVO_NO_ERROR ) + { + if(cur->widget) free(cur->widget); + if(cur->msg) free(cur->msg); + free(cur); + } + int error = vevo_property_set( v->vims, key, 1, VEVO_ATOM_TYPE_VOIDPTR, &d); + if( error == VEVO_NO_ERROR ) + count ++; +#ifdef STRICT_CHECKING + else { + veejay_msg(VEEJAY_MSG_ERROR, "Error loading MIDI event '%s': %d",key, error ); + + } +#endif + } + + } + if( buf[j] != '\n' && buf[j] != '\0' ) + value[k++] = buf[j]; + + } + + } + free(buf); + veejay_msg(VEEJAY_MSG_INFO, "loaded %d midi events from %s",count,filename); + vj_msg(VEEJAY_MSG_INFO, "Loaded %d MIDI events from %s", count ,filename); +} + +void vj_midi_save(void *vv, const char *filename) +{ + vmidi_t *v = (vmidi_t*) vv; + if(!v->active) return; + + int fd = open( filename, O_TRUNC|O_CREAT|O_WRONLY,S_IRWXU ); + if(!fd) + { + vj_msg(VEEJAY_MSG_ERROR, "Unable to save MIDI settings to %s",filename); + return; + } + + char **items = vevo_list_properties( v->vims ); + int i; + if( items == NULL ) + { + vj_msg(VEEJAY_MSG_ERROR, "No MIDI events learned yet"); + return; + } + uint32_t count = 0; + for( i =0 ; items[i] != NULL ;i ++ ) + { + char tmp[512]; + dvims_t *d = NULL; + if( vevo_property_get( v->vims, items[i], 0, &d ) == VEVO_NO_ERROR ) + { + snprintf(tmp, 512, "%s %d %s \"%s\"\n", + items[i], + d->extra, + (d->widget == NULL ? "none" : d->widget ), + d->msg ); + if( write( fd, tmp, strlen( tmp )) >= 0 ) + count ++; + } + free(items[i]); + } + free(items); + close(fd); + + vj_msg(VEEJAY_MSG_INFO, "Wrote %d MIDI events to %s", count, filename ); +} + +void vj_midi_learning_vims( void *vv, char *widget, char *msg, int extra ) +{ + vmidi_t *v = (vmidi_t*) vv; + if(!v->active) return; + + if( !v->learn ) + return; + + if( v->learn_event[0] == -1 || v->learn_event[1] == -1 || v->learn_event[2] == -1 ) { + veejay_msg(0, "Cannot learn '%s' (%s) - unknown midi event.", + widget, msg ); + return; + } + + dvims_t *d = (dvims_t*) vj_malloc(sizeof(dvims_t)); + d->extra = extra; + d->msg = (msg == NULL ? NULL : strdup(msg)); + d->widget = (widget == NULL ? NULL : strdup(widget)); + char key[32]; + snprintf(key,sizeof(key), "%03d%03d", v->learn_event[0],v->learn_event[1] ); + + dvims_t *cur = NULL; + if( vevo_property_get( v->vims, key, 0, &cur ) == VEVO_NO_ERROR ) + { + if( cur->widget ) free(cur->widget ); + if( cur->msg ) free(cur->msg); + free(cur); + } + int error = vevo_property_set( v->vims, key, 1, VEVO_ATOM_TYPE_VOIDPTR, &d ); + if( error != VEVO_NO_ERROR ) + return; + vj_msg( VEEJAY_MSG_INFO, + "Midi %x: %x ,%x learned", v->learn_event[0],v->learn_event[1],v->learn_event[2]); +} + +void vj_midi_learning_vims_simple( void *vv, char *widget, int id ) +{ + char message[100]; + if( widget == NULL ) + snprintf(message,sizeof(message), "%03d:;", id ); + else + snprintf(message,sizeof(message), "%03d:", id ); + vj_midi_learning_vims( vv, widget, message, (widget == NULL ? 0 : 1 ) ); +} + +void vj_midi_learning_vims_spin( void *vv, char *widget, int id ) +{ + char message[100]; + if( widget == NULL ) + snprintf(message,sizeof(message), "%03d:;", id ); + else + snprintf(message,sizeof(message), "%03d:", id ); + vj_midi_learning_vims( vv, widget, message, (widget == NULL ? 0 : 2) ); +} + + +void vj_midi_learning_vims_complex( void *vv, char *widget, int id, int first , int extra) +{ + char message[100]; + snprintf( message, sizeof(message), "%03d:%d",id, first ); + + vj_midi_learning_vims( vv, widget, message, extra ); +} + +void vj_midi_learning_vims_msg( void *vv, char *widget, int id, int arg ) +{ + char message[100]; + snprintf(message, sizeof(message), "%03d:%d;",id, arg ); + + vj_midi_learning_vims( vv, widget, message, 0 ); +} + +void vj_midi_learning_vims_msg2(void *vv, char *widget, int id, int arg, int b ) +{ + char message[100]; + snprintf(message,sizeof(message), "%03d:%d %d;", id, arg,b ); + vj_midi_learning_vims( vv, widget, message, 0 ); +} + +void vj_midi_learning_vims_fx( void *vv, int widget, int id, int a, int b, int c, int extra ) +{ + char message[100]; + char wid[100]; + snprintf(message,sizeof(message), "%03d:%d %d %d", id, a,b,c ); + snprintf(wid, sizeof(wid),"slider_p%d", widget ); + vj_midi_learning_vims( vv, wid, message, extra ); +} + +static void vj_midi_send_vims_now( vmidi_t *v, int *data ) +{ + // format vims message and send it now + // it would be nice to filter out unique events per frame step + + // this can be done by keeping a temporary vevo port + // and store (instead of send) the VIMS message + // including the sample_id and chain_entry_id but + // cutting off all other arguments. + // then, last SET_SPEED will overwrite any previous ones for this frame step. + // + // last, send all messages in temporary port out and cleanup + + char key[32]; + + if( v->learn ) + { + veejay_memcpy( v->learn_event, data, sizeof(v->learn_event )); + vj_msg(VEEJAY_MSG_INFO, "MIDI %x:%x,%x -> ?", v->learn_event[0],v->learn_event[1], + v->learn_event[2]); + return; + } + + snprintf(key,sizeof(key), "%03d%03d", data[0],data[1] ); //@ event key is midi event type + midi control/param id + + dvims_t *d = NULL; + int error = vevo_property_get( v->vims, key, 0, &d); + if( error == VEVO_NO_ERROR ) + { + if( d->extra ) + { //@ argument is dynamic + double min = 0.0; + double max = 0.0; + double val = 0.0; + switch(d->extra) + { + case 1: //slider + { + GtkAdjustment *a = gtk_range_get_adjustment( GTK_RANGE( + glade_xml_get_widget_( v->mw, d->widget ) ) ); + + min = gtk_adjustment_get_lower (a); + max = gtk_adjustment_get_upper (a); + } + break; + case 2: //spinbox + gtk_spin_button_get_range( GTK_SPIN_BUTTON( + glade_xml_get_widget_( v->mw, d->widget)), &min, &max); + + break; + } + + if( data[0] == SND_SEQ_EVENT_PITCHBEND ) + { + val = ( (data[2]/16384.0f) * (max-min) ); + } + else if( data[0] == SND_SEQ_EVENT_CONTROLLER || data[0] == SND_SEQ_EVENT_KEYPRESS ) + { + val = ((max-min)/127.0) * data[2] + min; + } + else { + vj_msg(VEEJAY_MSG_INFO, "MIDI: what's this %x,%x,%x ?",data[0],data[1],data[2]); + return; + } + + char vims_msg[255]; + snprintf(vims_msg,sizeof(vims_msg), "%s %d;", d->msg, (int) val ); + + /* use control/param as sample_id */ + int tmpv[3]; + if ( sscanf(vims_msg, "%03d:%d %d;",&tmpv[0],&tmpv[1],&tmpv[2]) == 3 ) + { + if(tmpv[1] == 0 && tmpv[0] >= 100 && tmpv[0] < 200) //@ VIMS: sample events, replace 0 (current_id) for control/param number + { + snprintf(vims_msg,sizeof(vims_msg),"%03d:%d %d;", tmpv[0], data[1], (int)val); + veejay_msg(VEEJAY_MSG_DEBUG, "(midi) using control/param %d as sample identifer",data[1]); + } + } + + msg_vims( vims_msg ); + vj_msg(VEEJAY_MSG_INFO, "MIDI %x:%x, %x -> vims %s", data[0], data[1],data[2], vims_msg); + } + else + { + msg_vims( d->msg ); + vj_msg(VEEJAY_MSG_INFO, "MIDI %x: %x,%x -> vims %s", data[0],data[1],data[2], d->msg); + } + } + else + { + vj_msg(VEEJAY_MSG_ERROR, "No vims event for MIDI %x:%x,%x found",data[0],data[1],data[2]); + } +} + +static int vj_dequeue_midi_event( vmidi_t *v ) +{ + int ret = 0; + int err = 0; + while( snd_seq_event_input_pending( v->sequencer, 1 ) > 0 ) { + int data[4] = { 0,0,0,0}; + int isvalid = 1; + snd_seq_event_t *ev = NULL; + + err = snd_seq_event_input( v->sequencer, &ev ); + if( err == -ENOSPC || err == -EAGAIN ) + return ret; + + data[0] = ev->type; + switch( ev->type ) + { + /* controller: channel <0-N>, */ + case SND_SEQ_EVENT_CONTROLLER: + data[1] = ev->data.control.channel*256+ev->data.control.param; // OB: added chan+param as identifier + data[2] = ev->data.control.value; + break; + case SND_SEQ_EVENT_PITCHBEND: + data[1] = ev->data.control.channel; + data[2] = ev->data.control.value; + break; + case SND_SEQ_EVENT_NOTE: + data[1] = ev->data.control.channel; + data[2] = ev->data.note.note; + break; + case SND_SEQ_EVENT_NOTEON: + data[2] = ev->data.control.channel; + data[1] = ev->data.note.note; + break; + case SND_SEQ_EVENT_NOTEOFF: + data[2] = ev->data.control.channel; + data[1] = ev->data.note.note; + break; + case SND_SEQ_EVENT_KEYPRESS: + data[1] = ev->data.control.channel; + data[2] = ev->data.note.velocity; + break; + case SND_SEQ_EVENT_PGMCHANGE: + data[1] = ev->data.control.param; + data[2] = ev->data.control.value; + break; + default: + data[1] = -1; + data[2] = -1; + isvalid = 0; + veejay_msg(VEEJAY_MSG_WARNING, "unknown midi event received: %d %x %x",ev->type,data[1],data[2],data[2]); + break; + } + + if( isvalid == 1 ) { + vj_midi_send_vims_now( v, data ); + } + + if( ev ) { + snd_seq_free_event( ev ); + ret ++; + } + } + + return ret; +} + +int vj_midi_handle_events(void *vv) +{ + vmidi_t *v = (vmidi_t*) vv; + + if(!v->active) return 0; + + int status = poll( v->pfd, v->npfd, 0 ); + + if( status == -1 ) { + veejay_msg(VEEJAY_MSG_ERROR, "MIDI: unable to poll file descriptor: %s", strerror(errno)); + return 0; + } + else if( status > 0 ) { + return vj_dequeue_midi_event(v); + } + + /* + + while( poll( v->pfd, v->npfd, 0 ) > 0 ) + { + n_msg ++; + if(vj_midi_action( v )) + continue; + break; + } + if(n_msg>0) + veejay_msg(VEEJAY_MSG_INFO, "MIDI: %d events received", n_msg); + */ + + return 0; +} + + +void *vj_midi_new(void *mw) +{ + vmidi_t *v = (vmidi_t*) vj_calloc(sizeof(vmidi_t)); + int portid = 0; + + if( snd_seq_open( &(v->sequencer), "hw", SND_SEQ_OPEN_DUPLEX | SND_SEQ_NONBLOCK, 0 ) < 0 ) + { + veejay_msg(0, "Error opening ALSA sequencer"); + return v; + } + + snd_seq_set_client_name( v->sequencer, "Veejay" ); + + if( (portid = snd_seq_create_simple_port( v->sequencer, "Reloaded", + SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE , + SND_SEQ_PORT_TYPE_APPLICATION )) < 0 ) + { + veejay_msg(0, "Error creating sequencer port"); + return v; + } + + v->npfd = snd_seq_poll_descriptors_count( v->sequencer, POLLIN ); + if( v->npfd <= 0 ) + { + veejay_msg(0,"Unable to poll in from sequencer"); + return v; + } + v->pfd = (struct pollfd *) vj_calloc( v->npfd * sizeof( struct pollfd )); + v->mw = mw; + v->learn = 0; + v->vims = vpn(VEVO_ANONYMOUS_PORT); + v->active = 1; + snd_seq_poll_descriptors( v->sequencer, v->pfd, v->npfd, POLLIN ); + + veejay_msg(VEEJAY_MSG_INFO, "MIDI listener active! Type 'aconnect -o' to see where to connect to."); + veejay_msg(VEEJAY_MSG_INFO, "For example: $ aconnect 128 129"); + + return (void*) v; +} + + diff --git a/veejay-current/reloaded-gtk3/src/vmidi.h b/veejay-current/reloaded-gtk3/src/vmidi.h new file mode 100644 index 00000000..aeb2a2bc --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/vmidi.h @@ -0,0 +1,42 @@ +/* Gveejay Reloaded - graphical interface for VeeJay + * (C) 2002-2007 Niels Elburg + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef VMIDI_H +#define VMIDI_H + +void *vj_midi_new(void *mw); + +int vj_midi_handle_events(void *vv); + +void vj_midi_play(void *vv ); + +void vj_midi_learn( void *vv ); + +void vj_midi_load(void *vv, const char *filename); + +void vj_midi_save(void *vv, const char *filename); + +void vj_midi_reset( void *vv ); + +void vj_midi_learning_vims( void *vv, char *widget, char *msg, int extra ); +void vj_midi_learning_vims_simple( void *vv, char *widget, int id ); +void vj_midi_learning_vims_complex( void *vv, char *widget, int id, int first , int extra ); +void vj_midi_learning_vims_fx( void *vv, int widget, int id, int a, int b, int c, int extra ); +void vj_midi_learning_vims_msg2(void *vv, char *widget, int id, int arg, int b ); +void vj_midi_learning_vims_msg( void *vv, char *widget, int id, int arg ); +void vj_midi_learning_vims_spin( void *vv, char *widget, int id ); +#endif diff --git a/veejay-current/reloaded-gtk3/src/yuv4mpeg.c b/veejay-current/reloaded-gtk3/src/yuv4mpeg.c new file mode 100644 index 00000000..a7775801 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/yuv4mpeg.c @@ -0,0 +1,1414 @@ +/* + * yuv4mpeg.c: Functions for reading and writing "new" YUV4MPEG streams + * + * Copyright (C) 2001 Matthew J. Marjanovic + * + * + * 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. + * + */ + +#include + +#include +#include +#include +#include +#define INTERNAL_Y4M_LIBCODE_STUFF_QPX +#include "yuv4mpeg.h" +#include "yuv4mpeg_intern.h" +#include "mjpeg_logging.h" + + +static int _y4mparam_allow_unknown_tags = 1; /* default is forgiveness */ +static int _y4mparam_feature_level = 0; /* default is ol YUV4MPEG2 */ + +static void *(*_y4m_alloc)(size_t bytes) = malloc; +static void (*_y4m_free)(void *ptr) = free; + + +int y4m_allow_unknown_tags(int yn) +{ + int old = _y4mparam_allow_unknown_tags; + if (yn >= 0) + _y4mparam_allow_unknown_tags = (yn) ? 1 : 0; + return old; +} + +int y4m_accept_extensions(int level) +{ + int old = _y4mparam_feature_level; + if (level >= 0) + _y4mparam_feature_level = level; + return old; +} + + +/************************************************************************* + * + * Convenience functions for fd read/write + * + * - guaranteed to transfer entire payload (or fail) + * - returns: + * 0 on complete success + * +(# of remaining bytes) on eof (for y4m_read) + * -(# of rem. bytes) on error (and ERRNO should be set) + * + *************************************************************************/ + +ssize_t y4m_read(int fd, void *buf, size_t len) +{ + ssize_t n; + uint8_t *ptr = (uint8_t *)buf; + + while (len > 0) { + n = read(fd, ptr, len); + if (n <= 0) { + /* return amount left to read */ + if (n == 0) + return len; /* n == 0 --> eof */ + else + return -len; /* n < 0 --> error */ + } + ptr += n; + len -= n; + } + return 0; +} + +ssize_t y4m_write(int fd, const void *buf, size_t len) +{ + ssize_t n; + const uint8_t *ptr = (const uint8_t *)buf; + + while (len > 0) { + n = write(fd, ptr, len); + if (n <= 0) return -len; /* return amount left to write */ + ptr += n; + len -= n; + } + return 0; +} + +/* read len bytes from fd into buf */ +ssize_t y4m_read_cb(y4m_cb_reader_t * fd, void *buf, size_t len) + { + return fd->read(fd->data, buf, len); + } + +/* write len bytes from fd into buf */ +ssize_t y4m_write_cb(y4m_cb_writer_t * fd, const void *buf, size_t len) + { + return fd->write(fd->data, buf, len); + } + +/* Functions to use the callback interface from plain filedescriptors */ + +/* read len bytes from fd into buf */ +ssize_t y4m_read_fd(void * data, void *buf, size_t len) + { + int * f = (int*)data; + return y4m_read(*f, buf, len); + } + +/* write len bytes from fd into buf */ +ssize_t y4m_write_fd(void * data, const void *buf, size_t len) + { + int * f = (int*)data; + return y4m_write(*f, buf, len); + } + +static void set_cb_reader_from_fd(y4m_cb_reader_t * ret, int * fd) + { + ret->read = y4m_read_fd; + ret->data = fd; + } + +static void set_cb_writer_from_fd(y4m_cb_writer_t * ret, int * fd) + { + ret->write = y4m_write_fd; + ret->data = fd; + } + + +/************************************************************************* + * + * "Extra tags" handling + * + *************************************************************************/ + +static char *y4m_new_xtag(void) +{ + return _y4m_alloc(Y4M_MAX_XTAG_SIZE * sizeof(char)); +} + +void y4m_init_xtag_list(y4m_xtag_list_t *xtags) +{ + int i; + xtags->count = 0; + for (i = 0; i < Y4M_MAX_XTAGS; i++) { + xtags->tags[i] = NULL; + } +} + +void y4m_fini_xtag_list(y4m_xtag_list_t *xtags) +{ + int i; + for (i = 0; i < Y4M_MAX_XTAGS; i++) { + if (xtags->tags[i] != NULL) { + _y4m_free(xtags->tags[i]); + xtags->tags[i] = NULL; + } + } + xtags->count = 0; +} + +void y4m_copy_xtag_list(y4m_xtag_list_t *dest, const y4m_xtag_list_t *src) +{ + int i; + for (i = 0; i < src->count; i++) { + if (dest->tags[i] == NULL) + dest->tags[i] = y4m_new_xtag(); + strncpy(dest->tags[i], src->tags[i], Y4M_MAX_XTAG_SIZE); + } + dest->count = src->count; +} + +static int y4m_snprint_xtags(char *s, int maxn, const y4m_xtag_list_t *xtags) +{ + int i, room; + + for (i = 0, room = maxn - 1; i < xtags->count; i++) { + int n = snprintf(s, room + 1, " %s", xtags->tags[i]); + if ((n < 0) || (n > room)) return Y4M_ERR_HEADER; + s += n; + room -= n; + } + s[0] = '\n'; /* finish off header with newline */ + s[1] = '\0'; /* ...and end-of-string */ + return Y4M_OK; +} + +int y4m_xtag_count(const y4m_xtag_list_t *xtags) +{ + return xtags->count; +} + +const char *y4m_xtag_get(const y4m_xtag_list_t *xtags, int n) +{ + if (n >= xtags->count) + return NULL; + else + return xtags->tags[n]; +} + +int y4m_xtag_add(y4m_xtag_list_t *xtags, const char *tag) +{ + if (xtags->count >= Y4M_MAX_XTAGS) return Y4M_ERR_XXTAGS; + if (xtags->tags[xtags->count] == NULL) + xtags->tags[xtags->count] = y4m_new_xtag(); + strncpy(xtags->tags[xtags->count], tag, Y4M_MAX_XTAG_SIZE); + (xtags->count)++; + return Y4M_OK; +} + +int y4m_xtag_remove(y4m_xtag_list_t *xtags, int n) +{ + int i; + char *q; + + if ((n < 0) || (n >= xtags->count)) return Y4M_ERR_RANGE; + q = xtags->tags[n]; + for (i = n; i < (xtags->count - 1); i++) + xtags->tags[i] = xtags->tags[i+1]; + xtags->tags[i] = q; + (xtags->count)--; + return Y4M_OK; +} + +int y4m_xtag_clearlist(y4m_xtag_list_t *xtags) +{ + xtags->count = 0; + return Y4M_OK; +} + +int y4m_xtag_addlist(y4m_xtag_list_t *dest, const y4m_xtag_list_t *src) +{ + int i, j; + + if ((dest->count + src->count) > Y4M_MAX_XTAGS) return Y4M_ERR_XXTAGS; + for (i = dest->count, j = 0; + j < src->count; + i++, j++) { + if (dest->tags[i] == NULL) + dest->tags[i] = y4m_new_xtag(); + strncpy(dest->tags[i], src->tags[i], Y4M_MAX_XTAG_SIZE); + } + dest->count += src->count; + return Y4M_OK; +} + + +/************************************************************************* + * + * Creators/destructors for y4m_*_info_t structures + * + *************************************************************************/ + +void y4m_init_stream_info(y4m_stream_info_t *info) +{ + if (info == NULL) return; + /* init substructures */ + y4m_init_xtag_list(&(info->x_tags)); + /* set defaults */ + y4m_clear_stream_info(info); +} + +void y4m_clear_stream_info(y4m_stream_info_t *info) +{ + if (info == NULL) return; + /* clear/initialize info */ + info->width = Y4M_UNKNOWN; + info->height = Y4M_UNKNOWN; + info->interlace = Y4M_UNKNOWN; + info->framerate = y4m_fps_UNKNOWN; + info->sampleaspect = y4m_sar_UNKNOWN; + if (_y4mparam_feature_level < 1) { + info->chroma = Y4M_CHROMA_420JPEG; + } else { + info->chroma = Y4M_UNKNOWN; + } + y4m_xtag_clearlist(&(info->x_tags)); +} + +void y4m_copy_stream_info(y4m_stream_info_t *dest, + const y4m_stream_info_t *src) +{ + if ((dest == NULL) || (src == NULL)) return; + /* copy info */ + dest->width = src->width; + dest->height = src->height; + dest->interlace = src->interlace; + dest->framerate = src->framerate; + dest->sampleaspect = src->sampleaspect; + dest->chroma = src->chroma; + y4m_copy_xtag_list(&(dest->x_tags), &(src->x_tags)); +} + +// returns 0 if equal, nonzero if different +static int y4m_compare_stream_info(const y4m_stream_info_t *s1,const y4m_stream_info_t *s2) +{ + int i,j; + + if( s1->width != s2->width || + s1->height != s2->height || + s1->interlace != s2->interlace || + s1->framerate.n != s2->framerate.n || + s1->framerate.d != s2->framerate.d || + s1->sampleaspect.n != s2->sampleaspect.n || + s1->sampleaspect.d != s2->sampleaspect.d || + s1->chroma != s2->chroma || + s1->x_tags.count != s2->x_tags.count ) + return 1; + + // the tags may not be in the same order + for( i=0; ix_tags.count; i++ ) { + for( j=0; jx_tags.count; j++ ) + if( !strncmp(s1->x_tags.tags[i],s2->x_tags.tags[j],Y4M_MAX_XTAG_SIZE) ) + goto next; + return 1; + next:; + } + return 0; +} + +void y4m_fini_stream_info(y4m_stream_info_t *info) +{ + if (info == NULL) return; + y4m_fini_xtag_list(&(info->x_tags)); +} + +void y4m_si_set_width(y4m_stream_info_t *si, int width) +{ + si->width = width; +} + +int y4m_si_get_width(const y4m_stream_info_t *si) +{ return si->width; } + +void y4m_si_set_height(y4m_stream_info_t *si, int height) +{ + si->height = height; +} + +int y4m_si_get_height(const y4m_stream_info_t *si) +{ return si->height; } + +void y4m_si_set_interlace(y4m_stream_info_t *si, int interlace) +{ si->interlace = interlace; } + +int y4m_si_get_interlace(const y4m_stream_info_t *si) +{ return si->interlace; } + +void y4m_si_set_framerate(y4m_stream_info_t *si, y4m_ratio_t framerate) +{ si->framerate = framerate; } + +y4m_ratio_t y4m_si_get_framerate(const y4m_stream_info_t *si) +{ return si->framerate; } + +void y4m_si_set_sampleaspect(y4m_stream_info_t *si, y4m_ratio_t sar) +{ si->sampleaspect = sar; } + +y4m_ratio_t y4m_si_get_sampleaspect(const y4m_stream_info_t *si) +{ return si->sampleaspect; } + +void y4m_si_set_chroma(y4m_stream_info_t *si, int chroma_mode) +{ si->chroma = chroma_mode; } + +int y4m_si_get_chroma(const y4m_stream_info_t *si) +{ return si->chroma; } + + +int y4m_si_get_plane_count(const y4m_stream_info_t *si) +{ + switch (si->chroma) { + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + case Y4M_CHROMA_444: + case Y4M_CHROMA_422: + case Y4M_CHROMA_411: + return 3; + case Y4M_CHROMA_MONO: + return 1; + case Y4M_CHROMA_444ALPHA: + return 4; + default: + return Y4M_UNKNOWN; + } +} + +int y4m_si_get_plane_width(const y4m_stream_info_t *si, int plane) +{ + switch (plane) { + case 0: + return (si->width); + case 1: + case 2: + switch (si->chroma) { + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + return (si->width) / 2; + case Y4M_CHROMA_444: + case Y4M_CHROMA_444ALPHA: + return (si->width); + case Y4M_CHROMA_422: + return (si->width) / 2; + case Y4M_CHROMA_411: + return (si->width) / 4; + default: + return Y4M_UNKNOWN; + } + case 3: + switch (si->chroma) { + case Y4M_CHROMA_444ALPHA: + return (si->width); + default: + return Y4M_UNKNOWN; + } + default: + return Y4M_UNKNOWN; + } +} + +int y4m_si_get_plane_height(const y4m_stream_info_t *si, int plane) +{ + switch (plane) { + case 0: + return (si->height); + case 1: + case 2: + switch (si->chroma) { + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + return (si->height) / 2; + case Y4M_CHROMA_444: + case Y4M_CHROMA_444ALPHA: + case Y4M_CHROMA_422: + case Y4M_CHROMA_411: + return (si->height); + default: + return Y4M_UNKNOWN; + } + case 3: + switch (si->chroma) { + case Y4M_CHROMA_444ALPHA: + return (si->height); + default: + return Y4M_UNKNOWN; + } + default: + return Y4M_UNKNOWN; + } +} + +int y4m_si_get_plane_length(const y4m_stream_info_t *si, int plane) +{ + int w = y4m_si_get_plane_width(si, plane); + int h = y4m_si_get_plane_height(si, plane); + if ((w != Y4M_UNKNOWN) && (h != Y4M_UNKNOWN)) + return (w * h); + else + return Y4M_UNKNOWN; +} + +int y4m_si_get_framelength(const y4m_stream_info_t *si) +{ + int total = 0; + int planes = y4m_si_get_plane_count(si); + int p; + for (p = 0; p < planes; p++) { + int plen = y4m_si_get_plane_length(si, p); + if (plen == Y4M_UNKNOWN) return Y4M_UNKNOWN; + total += plen; + } + return total; +} + +y4m_xtag_list_t *y4m_si_xtags(y4m_stream_info_t *si) +{ return &(si->x_tags); } + + +void y4m_init_frame_info(y4m_frame_info_t *info) +{ + if (info == NULL) return; + /* init substructures */ + y4m_init_xtag_list(&(info->x_tags)); + /* set defaults */ + y4m_clear_frame_info(info); +} + +void y4m_clear_frame_info(y4m_frame_info_t *info) +{ + if (info == NULL) return; + /* clear/initialize info */ + info->spatial = Y4M_UNKNOWN; + info->temporal = Y4M_UNKNOWN; + info->presentation = Y4M_UNKNOWN; + y4m_xtag_clearlist(&(info->x_tags)); +} + +void y4m_copy_frame_info(y4m_frame_info_t *dest, const y4m_frame_info_t *src) +{ + if ((dest == NULL) || (src == NULL)) return; + /* copy info */ + dest->spatial = src->spatial; + dest->temporal = src->temporal; + dest->presentation = src->presentation; + y4m_copy_xtag_list(&(dest->x_tags), &(src->x_tags)); +} + +void y4m_fini_frame_info(y4m_frame_info_t *info) +{ + if (info == NULL) return; + y4m_fini_xtag_list(&(info->x_tags)); +} + +void y4m_fi_set_presentation(y4m_frame_info_t *fi, int pres) +{ fi->presentation = pres; } + +int y4m_fi_get_presentation(const y4m_frame_info_t *fi) +{ return fi->presentation; } + +void y4m_fi_set_temporal(y4m_frame_info_t *fi, int sampling) +{ fi->temporal = sampling; } + +int y4m_fi_get_temporal(const y4m_frame_info_t *fi) +{ return fi->temporal; } + +void y4m_fi_set_spatial(y4m_frame_info_t *fi, int sampling) +{ fi->spatial = sampling; } + +int y4m_fi_get_spatial(const y4m_frame_info_t *fi) +{ return fi->spatial; } + +y4m_xtag_list_t *y4m_fi_xtags(y4m_frame_info_t *fi) +{ return &(fi->x_tags); } + + +/************************************************************************* + * + * Tag parsing + * + *************************************************************************/ + +int y4m_parse_stream_tags(char *s, y4m_stream_info_t *i) +{ + char *token, *value; + char tag; + int err; + + /* parse fields */ + for (token = strtok(s, Y4M_DELIM); + token != NULL; + token = strtok(NULL, Y4M_DELIM)) { + if (token[0] == '\0') continue; /* skip empty strings */ + tag = token[0]; + value = token + 1; + switch (tag) { + case 'W': /* width */ + i->width = atoi(value); + if (i->width <= 0) return Y4M_ERR_RANGE; + break; + case 'H': /* height */ + i->height = atoi(value); + if (i->height <= 0) return Y4M_ERR_RANGE; + break; + case 'F': /* frame rate (fps) */ + if ((err = y4m_parse_ratio(&(i->framerate), value)) != Y4M_OK) + return err; + if (i->framerate.n < 0) return Y4M_ERR_RANGE; + break; + case 'I': /* interlacing */ + switch (value[0]) { + case 'p': i->interlace = Y4M_ILACE_NONE; break; + case 't': i->interlace = Y4M_ILACE_TOP_FIRST; break; + case 'b': i->interlace = Y4M_ILACE_BOTTOM_FIRST; break; + case 'm': i->interlace = Y4M_ILACE_MIXED; break; + case '?': + default: + i->interlace = Y4M_UNKNOWN; break; + } + break; + case 'A': /* sample (pixel) aspect ratio */ + if ((err = y4m_parse_ratio(&(i->sampleaspect), value)) != Y4M_OK) + return err; + if (i->sampleaspect.n < 0) return Y4M_ERR_RANGE; + break; + case 'C': + i->chroma = y4m_chroma_parse_keyword(value); + if (i->chroma == Y4M_UNKNOWN) + return Y4M_ERR_HEADER; + break; + case 'X': /* 'X' meta-tag */ + if ((err = y4m_xtag_add(&(i->x_tags), token)) != Y4M_OK) return err; + break; + default: + /* possible error on unknown options */ + if (_y4mparam_allow_unknown_tags) { + /* unknown tags ok: store in xtag list and warn... */ + if ((err = y4m_xtag_add(&(i->x_tags), token)) != Y4M_OK) return err; + mjpeg_warn("Unknown stream tag encountered: '%s'", token); + } else { + /* unknown tags are *not* ok */ + return Y4M_ERR_BADTAG; + } + break; + } + } + + /* Without 'C' tag or any other chroma spec, default to 420jpeg */ + if (i->chroma == Y4M_UNKNOWN) + i->chroma = Y4M_CHROMA_420JPEG; + + /* Error checking... */ + /* - Width and Height are required. */ + if ((i->width == Y4M_UNKNOWN) || (i->height == Y4M_UNKNOWN)) + return Y4M_ERR_HEADER; + /* - Non-420 chroma and mixed interlace require level >= 1 */ + if (_y4mparam_feature_level < 1) { + if ((i->chroma != Y4M_CHROMA_420JPEG) && + (i->chroma != Y4M_CHROMA_420MPEG2) && + (i->chroma != Y4M_CHROMA_420PALDV)) + return Y4M_ERR_FEATURE; + if (i->interlace == Y4M_ILACE_MIXED) + return Y4M_ERR_FEATURE; + } + + /* ta da! done. */ + return Y4M_OK; +} + + + +static int y4m_parse_frame_tags(char *s, const y4m_stream_info_t *si, + y4m_frame_info_t *fi) +{ + char *token, *value; + char tag; + int err; + + /* parse fields */ + for (token = strtok(s, Y4M_DELIM); + token != NULL; + token = strtok(NULL, Y4M_DELIM)) { + if (token[0] == '\0') continue; /* skip empty strings */ + tag = token[0]; + value = token + 1; + switch (tag) { + case 'I': + /* frame 'I' tag requires feature level >= 1 */ + if (_y4mparam_feature_level < 1) return Y4M_ERR_FEATURE; + if (si->interlace != Y4M_ILACE_MIXED) return Y4M_ERR_BADTAG; + switch (value[0]) { + case 't': fi->presentation = Y4M_PRESENT_TOP_FIRST; break; + case 'T': fi->presentation = Y4M_PRESENT_TOP_FIRST_RPT; break; + case 'b': fi->presentation = Y4M_PRESENT_BOTTOM_FIRST; break; + case 'B': fi->presentation = Y4M_PRESENT_BOTTOM_FIRST_RPT; break; + case '1': fi->presentation = Y4M_PRESENT_PROG_SINGLE; break; + case '2': fi->presentation = Y4M_PRESENT_PROG_DOUBLE; break; + case '3': fi->presentation = Y4M_PRESENT_PROG_TRIPLE; break; + default: + return Y4M_ERR_BADTAG; + } + switch (value[1]) { + case 'p': fi->temporal = Y4M_SAMPLING_PROGRESSIVE; break; + case 'i': fi->temporal = Y4M_SAMPLING_INTERLACED; break; + default: + return Y4M_ERR_BADTAG; + } + switch (value[2]) { + case 'p': fi->spatial = Y4M_SAMPLING_PROGRESSIVE; break; + case 'i': fi->spatial = Y4M_SAMPLING_INTERLACED; break; + case '?': fi->spatial = Y4M_UNKNOWN; break; + default: + return Y4M_ERR_BADTAG; + } + break; + case 'X': /* 'X' meta-tag */ + if ((err = y4m_xtag_add(&(fi->x_tags), token)) != Y4M_OK) return err; + break; + default: + /* possible error on unknown options */ + if (_y4mparam_allow_unknown_tags) { + /* unknown tags ok: store in xtag list and warn... */ + if ((err = y4m_xtag_add(&(fi->x_tags), token)) != Y4M_OK) return err; + mjpeg_warn("Unknown frame tag encountered: '%s'", token); + } else { + /* unknown tags are *not* ok */ + return Y4M_ERR_BADTAG; + } + break; + } + } + /* error-checking and/or non-mixed defaults */ + switch (si->interlace) { + case Y4M_ILACE_MIXED: + /* T and P are required if stream "Im" */ + if ((fi->presentation == Y4M_UNKNOWN) || (fi->temporal == Y4M_UNKNOWN)) + return Y4M_ERR_HEADER; + /* and S is required if stream is also 4:2:0 */ + if ( ((si->chroma == Y4M_CHROMA_420JPEG) || + (si->chroma == Y4M_CHROMA_420MPEG2) || + (si->chroma == Y4M_CHROMA_420PALDV)) && + (fi->spatial == Y4M_UNKNOWN) ) + return Y4M_ERR_HEADER; + break; + case Y4M_ILACE_NONE: + /* stream "Ip" --> equivalent to frame "I1pp" */ + fi->spatial = Y4M_SAMPLING_PROGRESSIVE; + fi->temporal = Y4M_SAMPLING_PROGRESSIVE; + fi->presentation = Y4M_PRESENT_PROG_SINGLE; + break; + case Y4M_ILACE_TOP_FIRST: + /* stream "It" --> equivalent to frame "Itii" */ + fi->spatial = Y4M_SAMPLING_INTERLACED; + fi->temporal = Y4M_SAMPLING_INTERLACED; + fi->presentation = Y4M_PRESENT_TOP_FIRST; + break; + case Y4M_ILACE_BOTTOM_FIRST: + /* stream "Ib" --> equivalent to frame "Ibii" */ + fi->spatial = Y4M_SAMPLING_INTERLACED; + fi->temporal = Y4M_SAMPLING_INTERLACED; + fi->presentation = Y4M_PRESENT_BOTTOM_FIRST; + break; + default: + /* stream unknown: then, whatever */ + break; + } + /* ta da! done. */ + return Y4M_OK; +} + + + + + +/************************************************************************* + * + * Read/Write stream header + * + *************************************************************************/ + + +static int y4m_read_stream_header_line_cb(y4m_cb_reader_t * fd, y4m_stream_info_t *i,char *line,int n) +{ + int err; + + /* start with a clean slate */ + y4m_clear_stream_info(i); + /* read the header line */ + for (; n < Y4M_LINE_MAX; n++) { + if (y4m_read_cb(fd, line+n, 1)) + return Y4M_ERR_SYSTEM; + if (line[n] == '\n') { + line[n] = '\0'; /* Replace linefeed by end of string */ + break; + } + } + /* look for keyword in header */ + if (strncmp(line, Y4M_MAGIC, strlen(Y4M_MAGIC))) + return Y4M_ERR_MAGIC; + if (n >= Y4M_LINE_MAX) + return Y4M_ERR_HEADER; + if ((err = y4m_parse_stream_tags(line + strlen(Y4M_MAGIC), i)) != Y4M_OK) + return err; + + return Y4M_OK; +} + +static int y4m_reread_stream_header_line_cb(y4m_cb_reader_t *fd,const y4m_stream_info_t *si,char *line,int n) +{ + y4m_stream_info_t i; + int err=y4m_read_stream_header_line_cb(fd,&i,line,n); + if( err==Y4M_OK && y4m_compare_stream_info(si,&i) ) + err=Y4M_ERR_HEADER; + y4m_fini_stream_info(&i); + return err; +} + +int y4m_read_stream_header_cb(y4m_cb_reader_t *fd, y4m_stream_info_t *i) +{ + char line[Y4M_LINE_MAX]; + + return y4m_read_stream_header_line_cb(fd,i,line,0); +} + +int y4m_read_stream_header(int fd, y4m_stream_info_t *i) +{ + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_stream_header_cb(&r, i); +} + +int y4m_write_stream_header_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *i) +{ + char s[Y4M_LINE_MAX+1]; + int n; + int err; + y4m_ratio_t rate = i->framerate; + y4m_ratio_t aspect = i->sampleaspect; + const char *chroma_keyword = y4m_chroma_keyword(i->chroma); + + if ((i->chroma == Y4M_UNKNOWN) || (chroma_keyword == NULL)) + return Y4M_ERR_HEADER; + if (_y4mparam_feature_level < 1) { + if ((i->chroma != Y4M_CHROMA_420JPEG) && + (i->chroma != Y4M_CHROMA_420MPEG2) && + (i->chroma != Y4M_CHROMA_420PALDV)) + return Y4M_ERR_FEATURE; + if (i->interlace == Y4M_ILACE_MIXED) + return Y4M_ERR_FEATURE; + } + y4m_ratio_reduce(&rate); + y4m_ratio_reduce(&aspect); + n = snprintf(s, sizeof(s), "%s W%d H%d F%d:%d I%s A%d:%d C%s", + Y4M_MAGIC, + i->width, + i->height, + rate.n, rate.d, + (i->interlace == Y4M_ILACE_NONE) ? "p" : + (i->interlace == Y4M_ILACE_TOP_FIRST) ? "t" : + (i->interlace == Y4M_ILACE_BOTTOM_FIRST) ? "b" : + (i->interlace == Y4M_ILACE_MIXED) ? "m" : "?", + aspect.n, aspect.d, + chroma_keyword + ); + if ((n < 0) || (n > Y4M_LINE_MAX)) return Y4M_ERR_HEADER; + if ((err = y4m_snprint_xtags(s + n, sizeof(s) - n - 1, &(i->x_tags))) + != Y4M_OK) + return err; + /* non-zero on error */ + return (y4m_write_cb(fd, s, strlen(s)) ? Y4M_ERR_SYSTEM : Y4M_OK); +} + +int y4m_write_stream_header(int fd, const y4m_stream_info_t *i) +{ + y4m_cb_writer_t w; + set_cb_writer_from_fd(&w, &fd); + return y4m_write_stream_header_cb(&w, i); +} + + + + +/************************************************************************* + * + * Read/Write frame header + * + *************************************************************************/ + +int y4m_read_frame_header_cb(y4m_cb_reader_t * fd, + const y4m_stream_info_t *si, + y4m_frame_info_t *fi) +{ + char line[Y4M_LINE_MAX]; + char *p; + int n; + ssize_t remain; + + again: + /* start with a clean slate */ + y4m_clear_frame_info(fi); + /* This is more clever than read_stream_header... + Try to read "FRAME\n" all at once, and don't try to parse + if nothing else is there... + */ + remain = y4m_read_cb(fd, line, sizeof(Y4M_FRAME_MAGIC)-1+1); /* -'\0', +'\n' */ + if (remain < 0) return Y4M_ERR_SYSTEM; + if (remain > 0) { + /* A clean EOF should end exactly at a frame-boundary */ + if (remain == sizeof(Y4M_FRAME_MAGIC)) + return Y4M_ERR_EOF; + else + return Y4M_ERR_BADEOF; + } + if (strncmp(line, Y4M_FRAME_MAGIC, sizeof(Y4M_FRAME_MAGIC)-1)) { + int err=y4m_reread_stream_header_line_cb(fd,si,line,sizeof(Y4M_FRAME_MAGIC)-1+1); + if( err!=Y4M_OK ) + return err; + goto again; + } + if (line[sizeof(Y4M_FRAME_MAGIC)-1] == '\n') + return Y4M_OK; /* done -- no tags: that was the end-of-line. */ + + if (line[sizeof(Y4M_FRAME_MAGIC)-1] != Y4M_DELIM[0]) { + return Y4M_ERR_MAGIC; /* wasn't a space -- what was it? */ + } + + /* proceed to get the tags... (overwrite the magic) */ + for (n = 0, p = line; n < Y4M_LINE_MAX; n++, p++) { + if (y4m_read_cb(fd, p, 1)) + return Y4M_ERR_SYSTEM; + if (*p == '\n') { + *p = '\0'; /* Replace linefeed by end of string */ + break; + } + } + if (n >= Y4M_LINE_MAX) return Y4M_ERR_HEADER; + /* non-zero on error */ + return y4m_parse_frame_tags(line, si, fi); +} + +int y4m_read_frame_header(int fd, + const y4m_stream_info_t *si, + y4m_frame_info_t *fi) + { + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_frame_header_cb(&r, si, fi); + } + + +int y4m_write_frame_header_cb(y4m_cb_writer_t * fd, + const y4m_stream_info_t *si, + const y4m_frame_info_t *fi) +{ + char s[Y4M_LINE_MAX+1]; + int n, err; + + if (si->interlace == Y4M_ILACE_MIXED) { + if (_y4mparam_feature_level < 1) return Y4M_ERR_FEATURE; + n = snprintf(s, sizeof(s), "%s I%c%c%c", Y4M_FRAME_MAGIC, + (fi->presentation == Y4M_PRESENT_TOP_FIRST) ? 't' : + (fi->presentation == Y4M_PRESENT_TOP_FIRST_RPT) ? 'T' : + (fi->presentation == Y4M_PRESENT_BOTTOM_FIRST) ? 'b' : + (fi->presentation == Y4M_PRESENT_BOTTOM_FIRST_RPT) ? 'B' : + (fi->presentation == Y4M_PRESENT_PROG_SINGLE) ? '1' : + (fi->presentation == Y4M_PRESENT_PROG_DOUBLE) ? '2' : + (fi->presentation == Y4M_PRESENT_PROG_TRIPLE) ? '3' : + '?', + (fi->temporal == Y4M_SAMPLING_PROGRESSIVE) ? 'p' : + (fi->temporal == Y4M_SAMPLING_INTERLACED) ? 'i' : + '?', + (fi->spatial == Y4M_SAMPLING_PROGRESSIVE) ? 'p' : + (fi->spatial == Y4M_SAMPLING_INTERLACED) ? 'i' : + '?' + ); + } else { + n = snprintf(s, sizeof(s), "%s", Y4M_FRAME_MAGIC); + } + + if ((n < 0) || (n > Y4M_LINE_MAX)) return Y4M_ERR_HEADER; + if ((err = y4m_snprint_xtags(s + n, sizeof(s) - n - 1, &(fi->x_tags))) + != Y4M_OK) + return err; + /* non-zero on error */ + return (y4m_write_cb(fd, s, strlen(s)) ? Y4M_ERR_SYSTEM : Y4M_OK); +} + +int y4m_write_frame_header(int fd, + const y4m_stream_info_t *si, + const y4m_frame_info_t *fi) +{ + y4m_cb_writer_t w; + set_cb_writer_from_fd(&w, &fd); + return y4m_write_frame_header_cb(&w, si, fi); +} + +/************************************************************************* + * + * Read/Write entire frame + * + *************************************************************************/ + +int y4m_read_frame_data_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *frame) +{ + int planes = y4m_si_get_plane_count(si); + int p; + + /* Read each plane */ + for (p = 0; p < planes; p++) { + int w = y4m_si_get_plane_width(si, p); + int h = y4m_si_get_plane_height(si, p); + if (y4m_read_cb(fd, frame[p], w*h)) return Y4M_ERR_SYSTEM; + } + return Y4M_OK; +} + +int y4m_read_frame_data(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *frame) +{ + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_frame_data_cb(&r, si, fi, frame); +} + +int y4m_read_frame_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *frame) +{ + int err; + + /* Read frame header */ + if ((err = y4m_read_frame_header_cb(fd, si, fi)) != Y4M_OK) return err; + /* Read date */ + return y4m_read_frame_data_cb(fd, si, fi, frame); +} + +int y4m_read_frame(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *frame) +{ + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_frame_cb(&r, si, fi, frame); +} + + + +int y4m_write_frame_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, uint8_t * const *frame) +{ + int planes = y4m_si_get_plane_count(si); + int err, p; + + /* Write frame header */ + if ((err = y4m_write_frame_header_cb(fd, si, fi)) != Y4M_OK) return err; + /* Write each plane */ + for (p = 0; p < planes; p++) { + int w = y4m_si_get_plane_width(si, p); + int h = y4m_si_get_plane_height(si, p); + if (y4m_write_cb(fd, frame[p], w*h)) return Y4M_ERR_SYSTEM; + } + return Y4M_OK; +} + +int y4m_write_frame(int fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, uint8_t * const *frame) +{ + y4m_cb_writer_t w; + set_cb_writer_from_fd(&w, &fd); + return y4m_write_frame_cb(&w, si, fi, frame); +} + +/************************************************************************* + * + * Read/Write entire frame, (de)interleaved (to)from two separate fields + * + *************************************************************************/ + + +int y4m_read_fields_data_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + int p; + int planes = y4m_si_get_plane_count(si); + const int maxrbuf=32*1024; + uint8_t *rbuf=_y4m_alloc(maxrbuf); + int rbufpos=0,rbuflen=0; + + /* Read each plane */ + for (p = 0; p < planes; p++) { + uint8_t *dsttop = upper_field[p]; + uint8_t *dstbot = lower_field[p]; + int height = y4m_si_get_plane_height(si, p); + int width = y4m_si_get_plane_width(si, p); + int y; + /* alternately read one line into each field */ + for (y = 0; y < height; y += 2) { + if( width*2 >= maxrbuf ) { + if (y4m_read_cb(fd, dsttop, width)) goto y4merr; + if (y4m_read_cb(fd, dstbot, width)) goto y4merr; + } else { + if( rbufpos==rbuflen ) { + rbuflen=(height-y)*width; + if( rbuflen>maxrbuf ) + rbuflen=maxrbuf-maxrbuf%(2*width); + if( y4m_read_cb(fd,rbuf,rbuflen) ) + goto y4merr; + rbufpos=0; + } + + memcpy(dsttop,rbuf+rbufpos,width); rbufpos+=width; + memcpy(dstbot,rbuf+rbufpos,width); rbufpos+=width; + } + dsttop+=width; + dstbot+=width; + } + } + _y4m_free(rbuf); + return Y4M_OK; + + y4merr: + _y4m_free(rbuf); + return Y4M_ERR_SYSTEM; +} + +int y4m_read_fields_data(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_fields_data_cb(&r, si, fi, upper_field, lower_field); +} + + +int y4m_read_fields_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + int err; + /* Read frame header */ + if ((err = y4m_read_frame_header_cb(fd, si, fi)) != Y4M_OK) return err; + /* Read data */ + return y4m_read_fields_data_cb(fd, si, fi, upper_field, lower_field); +} + +int y4m_read_fields(int fd, const y4m_stream_info_t *si, y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + y4m_cb_reader_t r; + set_cb_reader_from_fd(&r, &fd); + return y4m_read_fields_cb(&r, si, fi, upper_field, lower_field); +} + +int y4m_write_fields_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + int p, err; + int planes = y4m_si_get_plane_count(si); + int numwbuf=0; + const int maxwbuf=32*1024; + uint8_t *wbuf; + + /* Write frame header */ + if ((err = y4m_write_frame_header_cb(fd, si, fi)) != Y4M_OK) return err; + /* Write each plane */ + wbuf=_y4m_alloc(maxwbuf); + for (p = 0; p < planes; p++) { + uint8_t *srctop = upper_field[p]; + uint8_t *srcbot = lower_field[p]; + int height = y4m_si_get_plane_height(si, p); + int width = y4m_si_get_plane_width(si, p); + int y; + /* alternately write one line from each field */ + for (y = 0; y < height; y += 2) { + if( width*2 >= maxwbuf ) { + if (y4m_write_cb(fd, srctop, width)) goto y4merr; + if (y4m_write_cb(fd, srcbot, width)) goto y4merr; + } else { + if (numwbuf + 2 * width > maxwbuf) { + if(y4m_write_cb(fd, wbuf, numwbuf)) goto y4merr; + numwbuf=0; + } + + memcpy(wbuf+numwbuf,srctop,width); numwbuf += width; + memcpy(wbuf+numwbuf,srcbot,width); numwbuf += width; + } + srctop += width; + srcbot += width; + } + } + if( numwbuf ) + if( y4m_write_cb(fd, wbuf, numwbuf) ) + goto y4merr; + _y4m_free(wbuf); + return Y4M_OK; + + y4merr: + _y4m_free(wbuf); + return Y4M_ERR_SYSTEM; +} + +int y4m_write_fields(int fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field) +{ + y4m_cb_writer_t w; + set_cb_writer_from_fd(&w, &fd); + return y4m_write_fields_cb(&w, si, fi, upper_field, lower_field); +} + +/************************************************************************* + * + * Handy logging of stream info + * + *************************************************************************/ + +void y4m_log_stream_info(log_level_t level, const char *prefix, + const y4m_stream_info_t *i) +{ + char s[256]; + + snprintf(s, sizeof(s), " frame size: "); + if (i->width == Y4M_UNKNOWN) + snprintf(s+strlen(s), sizeof(s)-strlen(s), "(?)x"); + else + snprintf(s+strlen(s), sizeof(s)-strlen(s), "%dx", i->width); + if (i->height == Y4M_UNKNOWN) + snprintf(s+strlen(s), sizeof(s)-strlen(s), "(?) pixels "); + else + snprintf(s+strlen(s), sizeof(s)-strlen(s), "%d pixels ", i->height); + { + int framelength = y4m_si_get_framelength(i); + if (framelength == Y4M_UNKNOWN) + snprintf(s+strlen(s), sizeof(s)-strlen(s), "(? bytes)"); + else + snprintf(s+strlen(s), sizeof(s)-strlen(s), "(%d bytes)", framelength); + mjpeg_log(level, "%s%s", prefix, s); + } + { + const char *desc = y4m_chroma_description(i->chroma); + if (desc == NULL) desc = "unknown!"; + mjpeg_log(level, "%s chroma: %s", prefix, desc); + } + if ((i->framerate.n == 0) && (i->framerate.d == 0)) + mjpeg_log(level, "%s frame rate: ??? fps", prefix); + else + mjpeg_log(level, "%s frame rate: %d/%d fps (~%f)", prefix, + i->framerate.n, i->framerate.d, + (double) i->framerate.n / (double) i->framerate.d); + mjpeg_log(level, "%s interlace: %s", prefix, + (i->interlace == Y4M_ILACE_NONE) ? "none/progressive" : + (i->interlace == Y4M_ILACE_TOP_FIRST) ? "top-field-first" : + (i->interlace == Y4M_ILACE_BOTTOM_FIRST) ? "bottom-field-first" : + (i->interlace == Y4M_ILACE_MIXED) ? "mixed-mode" : + "anyone's guess"); + if ((i->sampleaspect.n == 0) && (i->sampleaspect.d == 0)) + mjpeg_log(level, "%ssample aspect ratio: ?:?", prefix); + else + mjpeg_log(level, "%ssample aspect ratio: %d:%d", prefix, + i->sampleaspect.n, i->sampleaspect.d); +} + + +/************************************************************************* + * + * Convert error code to string + * + *************************************************************************/ + +const char *y4m_strerr(int err) +{ + switch (err) { + case Y4M_OK: return "no error"; + case Y4M_ERR_RANGE: return "parameter out of range"; + case Y4M_ERR_SYSTEM: return "system error (failed read/write)"; + case Y4M_ERR_HEADER: return "bad stream or frame header"; + case Y4M_ERR_BADTAG: return "unknown header tag"; + case Y4M_ERR_MAGIC: return "bad header magic"; + case Y4M_ERR_XXTAGS: return "too many xtags"; + case Y4M_ERR_EOF: return "end-of-file"; + case Y4M_ERR_BADEOF: return "stream ended unexpectedly (EOF)"; + case Y4M_ERR_FEATURE: return "stream requires unsupported features"; + default: + return "unknown error code"; + } +} + + +/************************************************************************* + * + * Chroma subsampling stuff + * + *************************************************************************/ + +y4m_ratio_t y4m_chroma_ss_x_ratio(int chroma_mode) +{ + y4m_ratio_t r; + switch (chroma_mode) { + case Y4M_CHROMA_444ALPHA: + case Y4M_CHROMA_444: + case Y4M_CHROMA_MONO: + r.n = 1; r.d = 1; break; + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + case Y4M_CHROMA_422: + r.n = 1; r.d = 2; break; + case Y4M_CHROMA_411: + r.n = 1; r.d = 4; break; + default: + r.n = 0; r.d = 0; + } + return r; +} + +y4m_ratio_t y4m_chroma_ss_y_ratio(int chroma_mode) +{ + y4m_ratio_t r; + switch (chroma_mode) { + case Y4M_CHROMA_444ALPHA: + case Y4M_CHROMA_444: + case Y4M_CHROMA_MONO: + case Y4M_CHROMA_422: + case Y4M_CHROMA_411: + r.n = 1; r.d = 1; break; + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + r.n = 1; r.d = 2; break; + default: + r.n = 0; r.d = 0; + } + return r; +} + + +#if 0 /* unfinished work here */ +y4m_ratio_t y4m_chroma_ss_x_offset(int chroma_mode, int field, int plane) +{ + y4m_ratio_t r; + switch (chroma_mode) { + case Y4M_CHROMA_444ALPHA: + case Y4M_CHROMA_444: + case Y4M_CHROMA_MONO: + case Y4M_CHROMA_422: + case Y4M_CHROMA_411: + r.n = 0; r.d = 1; break; + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + r.n = 1; r.d = 2; break; + default: + r.n = 0; r.d = 0; + } + return r; +} + +y4m_ratio_t y4m_chroma_ss_y_offset(int chroma_mode, int field, int plane); +{ + y4m_ratio_t r; + switch (chroma_mode) { + case Y4M_CHROMA_444ALPHA: + case Y4M_CHROMA_444: + case Y4M_CHROMA_MONO: + case Y4M_CHROMA_422: + case Y4M_CHROMA_411: + r.n = 0; r.d = 1; break; + case Y4M_CHROMA_420JPEG: + case Y4M_CHROMA_420MPEG2: + case Y4M_CHROMA_420PALDV: + r.n = 1; r.d = 2; break; + default: + r.n = 0; r.d = 0; + } + return r; +} +#endif + +int y4m_chroma_parse_keyword(const char *s) +{ + if (!strcasecmp("420jpeg", s)) + return Y4M_CHROMA_420JPEG; + else if (!strcasecmp("420mpeg2", s)) + return Y4M_CHROMA_420MPEG2; + else if (!strcasecmp("420paldv", s)) + return Y4M_CHROMA_420PALDV; + else if (!strcasecmp("444", s)) + return Y4M_CHROMA_444; + else if (!strcasecmp("422", s)) + return Y4M_CHROMA_422; + else if (!strcasecmp("411", s)) + return Y4M_CHROMA_411; + else if (!strcasecmp("mono", s)) + return Y4M_CHROMA_MONO; + else if (!strcasecmp("444alpha", s)) + return Y4M_CHROMA_444ALPHA; + else + return Y4M_UNKNOWN; +} + +const char *y4m_chroma_keyword(int chroma_mode) +{ + switch (chroma_mode) { + case Y4M_CHROMA_420JPEG: return "420jpeg"; + case Y4M_CHROMA_420MPEG2: return "420mpeg2"; + case Y4M_CHROMA_420PALDV: return "420paldv"; + case Y4M_CHROMA_444: return "444"; + case Y4M_CHROMA_422: return "422"; + case Y4M_CHROMA_411: return "411"; + case Y4M_CHROMA_MONO: return "mono"; + case Y4M_CHROMA_444ALPHA: return "444alpha"; + default: + return NULL; + } +} + +const char *y4m_chroma_description(int chroma_mode) +{ + switch (chroma_mode) { + case Y4M_CHROMA_420JPEG: return "4:2:0 JPEG/MPEG-1 (interstitial)"; + case Y4M_CHROMA_420MPEG2: return "4:2:0 MPEG-2 (horiz. cositing)"; + case Y4M_CHROMA_420PALDV: return "4:2:0 PAL-DV (altern. siting)"; + case Y4M_CHROMA_444: return "4:4:4 (no subsampling)"; + case Y4M_CHROMA_422: return "4:2:2 (horiz. cositing)"; + case Y4M_CHROMA_411: return "4:1:1 (horiz. cositing)"; + case Y4M_CHROMA_MONO: return "luma plane only"; + case Y4M_CHROMA_444ALPHA: return "4:4:4 with alpha channel"; + default: + return NULL; + } +} diff --git a/veejay-current/reloaded-gtk3/src/yuv4mpeg.h b/veejay-current/reloaded-gtk3/src/yuv4mpeg.h new file mode 100644 index 00000000..79a41f64 --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/yuv4mpeg.h @@ -0,0 +1,757 @@ +/* + * yuv4mpeg.h: Functions for reading and writing "new" YUV4MPEG2 streams. + * + * Stream format is described at the end of this file. + * + * + * Copyright (C) 2004 Matthew J. Marjanovic + * + * + * 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. + */ + +#ifndef __YUV4MPEG_H__ +#define __YUV4MPEG_H__ + +#include +#include +#ifndef _WIN32 +#include +#endif +#include + + +/************************************************************************ + * error codes returned by y4m_* functions + ************************************************************************/ +#define Y4M_OK 0 +#define Y4M_ERR_RANGE 1 /* argument or tag value out of range */ +#define Y4M_ERR_SYSTEM 2 /* failed system call, check errno */ +#define Y4M_ERR_HEADER 3 /* illegal/malformed header */ +#define Y4M_ERR_BADTAG 4 /* illegal tag character */ +#define Y4M_ERR_MAGIC 5 /* bad header magic */ +#define Y4M_ERR_EOF 6 /* end-of-file (clean) */ +#define Y4M_ERR_XXTAGS 7 /* too many xtags */ +#define Y4M_ERR_BADEOF 8 /* unexpected end-of-file */ +#define Y4M_ERR_FEATURE 9 /* stream requires features beyond allowed level */ + + +/* generic 'unknown' value for integer parameters (e.g. interlace, height) */ +#define Y4M_UNKNOWN -1 + +/************************************************************************ + * values for the "interlace" parameter [y4m_*_interlace()] + ************************************************************************/ +#define Y4M_ILACE_NONE 0 /* non-interlaced, progressive frame */ +#define Y4M_ILACE_TOP_FIRST 1 /* interlaced, top-field first */ +#define Y4M_ILACE_BOTTOM_FIRST 2 /* interlaced, bottom-field first */ +#define Y4M_ILACE_MIXED 3 /* mixed, "refer to frame header" */ + +/************************************************************************ + * values for the "chroma" parameter [y4m_*_chroma()] + ************************************************************************/ +#define Y4M_CHROMA_420JPEG 0 /* 4:2:0, H/V centered, for JPEG/MPEG-1 */ +#define Y4M_CHROMA_420MPEG2 1 /* 4:2:0, H cosited, for MPEG-2 */ +#define Y4M_CHROMA_420PALDV 2 /* 4:2:0, alternating Cb/Cr, for PAL-DV */ +#define Y4M_CHROMA_444 3 /* 4:4:4, no subsampling, phew. */ +#define Y4M_CHROMA_422 4 /* 4:2:2, H cosited */ +#define Y4M_CHROMA_411 5 /* 4:1:1, H cosited */ +#define Y4M_CHROMA_MONO 6 /* luma plane only */ +#define Y4M_CHROMA_444ALPHA 7 /* 4:4:4 with an alpha channel */ + +/************************************************************************ + * values for sampling parameters [y4m_*_spatial(), y4m_*_temporal()] + ************************************************************************/ +#define Y4M_SAMPLING_PROGRESSIVE 0 +#define Y4M_SAMPLING_INTERLACED 1 + +/************************************************************************ + * values for "presentation" parameter [y4m_*_presentation()] + ************************************************************************/ +#define Y4M_PRESENT_TOP_FIRST 0 /* top-field-first */ +#define Y4M_PRESENT_TOP_FIRST_RPT 1 /* top-first, repeat top */ +#define Y4M_PRESENT_BOTTOM_FIRST 2 /* bottom-field-first */ +#define Y4M_PRESENT_BOTTOM_FIRST_RPT 3 /* bottom-first, repeat bottom */ +#define Y4M_PRESENT_PROG_SINGLE 4 /* single progressive frame */ +#define Y4M_PRESENT_PROG_DOUBLE 5 /* progressive frame, repeat once */ +#define Y4M_PRESENT_PROG_TRIPLE 6 /* progressive frame, repeat twice */ + +#define Y4M_MAX_NUM_PLANES 4 + +/************************************************************************ + * 'ratio' datatype, for rational numbers + * (see 'ratio' functions down below) + ************************************************************************/ +typedef struct _y4m_ratio { + int n; /* numerator */ + int d; /* denominator */ +} y4m_ratio_t; + + +/************************************************************************ + * useful standard framerates (as ratios) + ************************************************************************/ +extern const y4m_ratio_t y4m_fps_UNKNOWN; +extern const y4m_ratio_t y4m_fps_NTSC_FILM; /* 24000/1001 film (in NTSC) */ +extern const y4m_ratio_t y4m_fps_FILM; /* 24fps film */ +extern const y4m_ratio_t y4m_fps_PAL; /* 25fps PAL */ +extern const y4m_ratio_t y4m_fps_NTSC; /* 30000/1001 NTSC */ +extern const y4m_ratio_t y4m_fps_30; /* 30fps */ +extern const y4m_ratio_t y4m_fps_PAL_FIELD; /* 50fps PAL field rate */ +extern const y4m_ratio_t y4m_fps_NTSC_FIELD; /* 60000/1001 NTSC field rate */ +extern const y4m_ratio_t y4m_fps_60; /* 60fps */ + +/************************************************************************ + * useful standard sample (pixel) aspect ratios (W:H) + ************************************************************************/ +extern const y4m_ratio_t y4m_sar_UNKNOWN; +extern const y4m_ratio_t y4m_sar_SQUARE; /* square pixels */ +extern const y4m_ratio_t y4m_sar_NTSC_CCIR601; /* 525-line (NTSC) Rec.601 */ +extern const y4m_ratio_t y4m_sar_NTSC_16_9; /* 16:9 NTSC/Rec.601 */ +extern const y4m_ratio_t y4m_sar_NTSC_SVCD_4_3; /* NTSC SVCD 4:3 */ +extern const y4m_ratio_t y4m_sar_NTSC_SVCD_16_9;/* NTSC SVCD 16:9 */ +extern const y4m_ratio_t y4m_sar_PAL_CCIR601; /* 625-line (PAL) Rec.601 */ +extern const y4m_ratio_t y4m_sar_PAL_16_9; /* 16:9 PAL/Rec.601 */ +extern const y4m_ratio_t y4m_sar_PAL_SVCD_4_3; /* PAL SVCD 4:3 */ +extern const y4m_ratio_t y4m_sar_PAL_SVCD_16_9; /* PAL SVCD 16:9 */ +extern const y4m_ratio_t y4m_sar_SQR_ANA16_9; /* anamorphic 16:9 sampled */ + /* from 4:3 with square pixels */ + +/************************************************************************ + * useful standard display aspect ratios (W:H) + ************************************************************************/ +extern const y4m_ratio_t y4m_dar_UNKNOWN; +extern const y4m_ratio_t y4m_dar_4_3; /* standard TV */ +extern const y4m_ratio_t y4m_dar_16_9; /* widescreen TV */ +extern const y4m_ratio_t y4m_dar_221_100; /* word-to-your-mother TV */ + + +#define Y4M_MAX_XTAGS 32 /* maximum number of xtags in list */ +#define Y4M_MAX_XTAG_SIZE 32 /* max length of an xtag (including 'X') */ + +typedef struct _y4m_xtag_list y4m_xtag_list_t; +typedef struct _y4m_stream_info y4m_stream_info_t; +typedef struct _y4m_frame_info y4m_frame_info_t; + + +#ifdef __cplusplus +#define BEGIN_CDECLS extern "C" { +#define END_CDECLS } +#else +#define BEGIN_CDECLS +#define END_CDECLS +#endif + +BEGIN_CDECLS + +/************************************************************************ + * 'ratio' functions + ************************************************************************/ + +/* 'normalize' a ratio (remove common factors) */ +void y4m_ratio_reduce(y4m_ratio_t *r); + +/* parse "nnn:ddd" into a ratio (returns Y4M_OK or Y4M_ERR_RANGE) */ +int y4m_parse_ratio(y4m_ratio_t *r, const char *s); + +/* quick test of two ratios for equality (i.e. identical components) */ +#define Y4M_RATIO_EQL(a,b) ( ((a).n == (b).n) && ((a).d == (b).d) ) + +/* quick conversion of a ratio to a double (no divide-by-zero check!) */ +#define Y4M_RATIO_DBL(r) ((double)(r).n / (double)(r).d) + +/************************************************************************* + * + * Guess the true SAR (sample aspect ratio) from a list of commonly + * encountered values, given the "suggested" display aspect ratio (DAR), + * and the true frame width and height. + * + * Returns y4m_sar_UNKNOWN if no match is found. + * + *************************************************************************/ +y4m_ratio_t y4m_guess_sar(int width, int height, y4m_ratio_t dar); + + +/************************************************************************* + * + * Chroma Subsampling Mode information + * + * x_ratio, y_ratio - subsampling of chroma planes + * x_offset, y_offset - offset of chroma sample grid, + * relative to luma (0,0) sample + * + *************************************************************************/ + +y4m_ratio_t y4m_chroma_ss_x_ratio(int chroma_mode); +y4m_ratio_t y4m_chroma_ss_y_ratio(int chroma_mode); +#if 0 +y4m_ratio_t y4m_chroma_ss_x_offset(int chroma_mode, int field, int plane); +y4m_ratio_t y4m_chroma_ss_y_offset(int chroma_mode, int field, int plane); +#endif + +/* Given a string containing a (case-insensitive) chroma-tag keyword, + return appropriate chroma mode (or Y4M_UNKNOWN) */ +int y4m_chroma_parse_keyword(const char *s); + +/* Given a Y4M_CHROMA_* mode, return appropriate chroma-tag keyword, + or NULL if there is none. */ +const char *y4m_chroma_keyword(int chroma_mode); + +/* Given a Y4M_CHROMA_* mode, return appropriate chroma mode description, + or NULL if there is none. */ +const char *y4m_chroma_description(int chroma_mode); + + + +/************************************************************************ + * 'xtag' functions + * + * o Before using an xtag_list (but after the structure/memory has been + * allocated), you must initialize it via y4m_init_xtag_list(). + * o After using an xtag_list (but before the structure is released), + * call y4m_fini_xtag_list() to free internal memory. + * + ************************************************************************/ + +/* initialize an xtag_list structure */ +void y4m_init_xtag_list(y4m_xtag_list_t *xtags); + +/* finalize an xtag_list structure */ +void y4m_fini_xtag_list(y4m_xtag_list_t *xtags); + +/* make one xtag_list into a copy of another */ +void y4m_copy_xtag_list(y4m_xtag_list_t *dest, const y4m_xtag_list_t *src); + +/* return number of tags in an xtag_list */ +int y4m_xtag_count(const y4m_xtag_list_t *xtags); + +/* access n'th tag in an xtag_list */ +const char *y4m_xtag_get(const y4m_xtag_list_t *xtags, int n); + +/* append a new tag to an xtag_list + returns: Y4M_OK - success + Y4M_ERR_XXTAGS - list is already full */ +int y4m_xtag_add(y4m_xtag_list_t *xtags, const char *tag); + +/* remove a tag from an xtag_list + returns: Y4M_OK - success + Y4M_ERR_RANGE - n is out of range */ +int y4m_xtag_remove(y4m_xtag_list_t *xtags, int n); + +/* remove all tags from an xtag_list + returns: Y4M_OK - success */ +int y4m_xtag_clearlist(y4m_xtag_list_t *xtags); + +/* append copies of tags from src list to dest list + returns: Y4M_OK - success + Y4M_ERR_XXTAGS - operation would overfill dest list */ +int y4m_xtag_addlist(y4m_xtag_list_t *dest, const y4m_xtag_list_t *src); + + + +/************************************************************************ + * '*_info' functions + * + * o Before using a *_info structure (but after the structure/memory has + * been allocated), you must initialize it via y4m_init_*_info(). + * o After using a *_info structure (but before the structure is released), + * call y4m_fini_*_info() to free internal memory. + * o Use the 'set' and 'get' accessors to modify or access the fields in + * the structures; don't touch the structure directly. (Ok, so there + * is no really convenient C syntax to prevent you from doing this, + * but we are all responsible programmers here, so just don't do it!) + * + ************************************************************************/ + +/* initialize a stream_info structure */ +void y4m_init_stream_info(y4m_stream_info_t *i); + +/* finalize a stream_info structure */ +void y4m_fini_stream_info(y4m_stream_info_t *i); + +/* reset stream_info back to default/unknown values */ +void y4m_clear_stream_info(y4m_stream_info_t *info); + +/* make one stream_info into a copy of another */ +void y4m_copy_stream_info(y4m_stream_info_t *dest, + const y4m_stream_info_t *src); + +/* access or set stream_info fields */ +/* level 0 */ +int y4m_si_get_width(const y4m_stream_info_t *si); +int y4m_si_get_height(const y4m_stream_info_t *si); +int y4m_si_get_interlace(const y4m_stream_info_t *si); +y4m_ratio_t y4m_si_get_framerate(const y4m_stream_info_t *si); +y4m_ratio_t y4m_si_get_sampleaspect(const y4m_stream_info_t *si); +void y4m_si_set_width(y4m_stream_info_t *si, int width); +void y4m_si_set_height(y4m_stream_info_t *si, int height); +void y4m_si_set_interlace(y4m_stream_info_t *si, int interlace); +void y4m_si_set_framerate(y4m_stream_info_t *si, y4m_ratio_t framerate); +void y4m_si_set_sampleaspect(y4m_stream_info_t *si, y4m_ratio_t sar); +/* level 1 */ +void y4m_si_set_chroma(y4m_stream_info_t *si, int chroma_mode); +int y4m_si_get_chroma(const y4m_stream_info_t *si); + +/* derived quantities (no setter) */ +/* level 0 */ +int y4m_si_get_framelength(const y4m_stream_info_t *si); +/* level 1 */ +int y4m_si_get_plane_count(const y4m_stream_info_t *si); +int y4m_si_get_plane_width(const y4m_stream_info_t *si, int plane); +int y4m_si_get_plane_height(const y4m_stream_info_t *si, int plane); +int y4m_si_get_plane_length(const y4m_stream_info_t *si, int plane); + + +/* access stream_info xtag_list */ +y4m_xtag_list_t *y4m_si_xtags(y4m_stream_info_t *si); + + +/* initialize a frame_info structure */ +void y4m_init_frame_info(y4m_frame_info_t *i); + +/* finalize a frame_info structure */ +void y4m_fini_frame_info(y4m_frame_info_t *i); + +/* reset frame_info back to default/unknown values */ +void y4m_clear_frame_info(y4m_frame_info_t *info); + +/* make one frame_info into a copy of another */ +void y4m_copy_frame_info(y4m_frame_info_t *dest, + const y4m_frame_info_t *src); + + +/* access or set frame_info fields (level 1) */ +int y4m_fi_get_presentation(const y4m_frame_info_t *fi); +int y4m_fi_get_temporal(const y4m_frame_info_t *fi); +int y4m_fi_get_spatial(const y4m_frame_info_t *fi); + +void y4m_fi_set_presentation(y4m_frame_info_t *fi, int pres); +void y4m_fi_set_temporal(y4m_frame_info_t *fi, int sampling); +void y4m_fi_set_spatial(y4m_frame_info_t *fi, int sampling); + + +/* access frame_info xtag_list */ +y4m_xtag_list_t *y4m_fi_xtags(y4m_frame_info_t *fi); + + +/************************************************************************ + * blocking read and write functions + * + * o guaranteed to transfer entire payload (or fail) + * o return values: + * 0 (zero) complete success + * -(# of remaining bytes) error (and errno left set) + * +(# of remaining bytes) EOF (for y4m_read only) + * + ************************************************************************/ + +/* read len bytes from fd into buf */ +ssize_t y4m_read(int fd, void *buf, size_t len); + +/* write len bytes from fd into buf */ +ssize_t y4m_write(int fd, const void *buf, size_t len); + +/************************************************************************ + * callback based read and write + * + * The structures y4m_cb_reader_t and y4m_cb_writer_t must be + * set up by the caller before and of the *_read_*_cb() or + * *_write_*_cb() functions are called. Te return values of + * the read() and write() members have the same meaning as for + * y4m_read() and y4m_write() + * + ************************************************************************/ + +typedef struct y4m_cb_reader_s + { + void * data; + ssize_t (*read)(void * data, void *buf, size_t len); + } y4m_cb_reader_t; + +typedef struct y4m_cb_writer_s + { + void * data; + ssize_t (*write)(void * data, const void *buf, size_t len); + } y4m_cb_writer_t; + +/* read len bytes from fd into buf */ +ssize_t y4m_read_cb(y4m_cb_reader_t * fd, void *buf, size_t len); + +/* write len bytes from fd into buf */ +ssize_t y4m_write_cb(y4m_cb_writer_t * fd, const void *buf, size_t len); + + +/************************************************************************ + * stream header processing functions + * + * o return values: + * Y4M_OK - success + * Y4M_ERR_* - error (see y4m_strerr() for descriptions) + * + ************************************************************************/ + +/* parse a string of stream header tags */ +int y4m_parse_stream_tags(char *s, y4m_stream_info_t *i); + +/* read a stream header from file descriptor fd + (the current contents of stream_info are erased first) */ +int y4m_read_stream_header(int fd, y4m_stream_info_t *i); + +/* read a stream header with a callback reader + (the current contents of stream_info are erased first) */ +int y4m_read_stream_header_cb(y4m_cb_reader_t * fd, y4m_stream_info_t *i); + +/* write a stream header to file descriptor fd */ +int y4m_write_stream_header(int fd, const y4m_stream_info_t *i); + +/* write a stream header with a callback writer */ +int y4m_write_stream_header_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *i); + + +/************************************************************************ + * frame processing functions + * + * o return values: + * Y4M_OK - success + * Y4M_ERR_* - error (see y4m_strerr() for descriptions) + * + ************************************************************************/ + +/* write a frame header to file descriptor fd */ +int y4m_write_frame_header(int fd, + const y4m_stream_info_t *si, + const y4m_frame_info_t *fi); + +/* write a frame header with a callback writer fd */ +int y4m_write_frame_header_cb(y4m_cb_writer_t * fd, + const y4m_stream_info_t *si, + const y4m_frame_info_t *fi); + +/* write a complete frame (header + data) to file descriptor fd + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_write_frame(int fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, uint8_t * const *planes); + +/* write a complete frame (header + data) with a callback writer fd + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_write_frame_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, uint8_t * const *planes); + +/* write a complete frame (header + data), to file descriptor fd + but interleave fields from two separate buffers + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_write_fields(int fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/* write a complete frame (header + data), with a callback writer fd + but interleave fields from two separate buffers + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_write_fields_cb(y4m_cb_writer_t * fd, const y4m_stream_info_t *si, + const y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/* read a frame header from file descriptor fd + (the current contents of frame_info are erased first) */ +int y4m_read_frame_header(int fd, + const y4m_stream_info_t *si, + y4m_frame_info_t *fi); + +/* read a frame header with callback reader fd + (the current contents of frame_info are erased first) */ +int y4m_read_frame_header_cb(y4m_cb_reader_t * fd, + const y4m_stream_info_t *si, + y4m_frame_info_t *fi); + +/* read frame data from file descriptor fd + [to be called after y4m_read_frame_header()] + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_read_frame_data(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *planes); + +/* read frame data with callback reader fd + [to be called after y4m_read_frame_header_cb()] + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_read_frame_data_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *planes); + +/* read frame data from file descriptor fd, + but de-interleave fields into two separate buffers + [to be called after y4m_read_frame_header()] + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_read_fields_data(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/* read frame data with callback reader fd, + but de-interleave fields into two separate buffers + [to be called after y4m_read_frame_header_cb()] + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_read_fields_data_cb(y4m_cb_reader_t * fd, + const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/* read a complete frame (header + data) from file descriptor fd, + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_read_frame(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *planes); + +/* read a complete frame (header + data) from callback reader fd, + o planes[] points to 1-4 buffers, one each for image plane */ +int y4m_read_frame_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, uint8_t * const *planes); + +/* read a complete frame (header + data) from file descriptor fd, + but de-interleave fields into two separate buffers + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_read_fields(int fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/* read a complete frame (header + data) from callback_reader fd, + but de-interleave fields into two separate buffers + o upper_field[] same as planes[] above, but for upper field only + o lower_field[] same as planes[] above, but for lower field only +*/ +int y4m_read_fields_cb(y4m_cb_reader_t * fd, const y4m_stream_info_t *si, + y4m_frame_info_t *fi, + uint8_t * const *upper_field, + uint8_t * const *lower_field); + +/************************************************************************ + * miscellaneous functions + ************************************************************************/ + +/* convenient dump of stream header info via mjpeg_log facility + * - each logged/printed line is prefixed by 'prefix' + */ +void y4m_log_stream_info(log_level_t level, const char *prefix, + const y4m_stream_info_t *i); + +/* convert a Y4M_ERR_* error code into mildly explanatory string */ +const char *y4m_strerr(int err); + +/* set 'allow_unknown_tag' flag for library... + o yn = 0 : unknown header tags will produce a parsing error + o yn = 1 : unknown header tags/values will produce a warning, but + are otherwise passed along via the xtags list + o yn = -1: don't change, just return current setting + + return value: previous setting of flag +*/ +int y4m_allow_unknown_tags(int yn); + + +/* set level of "accepted extensions" for the library... + o level = 0: default - conform to original YUV4MPEG2 spec; yield errors + when reading or writing a stream which exceeds it. + o level = 1: allow reading/writing streams which contain non-420jpeg + chroma and/or mixed-mode interlacing + o level = -1: don't change, just return current setting + + return value: previous setting of level + */ +int y4m_accept_extensions(int level); + + +END_CDECLS + + +/************************************************************************ + ************************************************************************ + + Description of the (new!, forever?) YUV4MPEG2 stream format: + + STREAM consists of + o one '\n' terminated STREAM-HEADER + o unlimited number of FRAMEs + + FRAME consists of + o one '\n' terminated FRAME-HEADER + o "length" octets of planar YCrCb 4:2:0 image data + (if frame is interlaced, then the two fields are interleaved) + + + STREAM-HEADER consists of + o string "YUV4MPEG2" + o unlimited number TAGGED-FIELDs, each preceded by ' ' separator + o '\n' line terminator + + FRAME-HEADER consists of + o string "FRAME" + o unlimited number of TAGGED-FIELDs, each preceded by ' ' separator + o '\n' line terminator + + + TAGGED-FIELD consists of + o single ascii character tag + o VALUE (which does not contain whitespace) + + VALUE consists of + o integer (base 10 ascii representation) + or o RATIO + or o single ascii character + or o non-whitespace ascii string + + RATIO consists of + o numerator (integer) + o ':' (a colon) + o denominator (integer) + + + The currently supported tags for the STREAM-HEADER: + W - [integer] frame width, pixels, should be > 0 + H - [integer] frame height, pixels, should be > 0 + C - [string] chroma-subsampling/data format + 420jpeg (default) + 420mpeg2 + 420paldv + 411 + 422 + 444 - non-subsampled Y'CbCr + 444alpha - Y'CbCr with alpha channel (with Y' black/white point) + mono - Y' plane only + I - [char] interlacing: p - progressive (none) + t - top-field-first + b - bottom-field-first + m - mixed -- see 'I' tag in frame header + ? - unknown + F - [ratio] frame-rate, 0:0 == unknown + A - [ratio] sample (pixel) aspect ratio, 0:0 == unknown + X - [character string] 'metadata' (unparsed, but passed around) + + The currently supported tags for the FRAME-HEADER: + Ixyz - framing/sampling (required if-and-only-if stream is "Im") + x: t - top-field-first + T - top-field-first and repeat + b - bottom-field-first + B - bottom-field-first and repeat + 1 - single progressive frame + 2 - double progressive frame (repeat) + 3 - triple progressive frame (repeat twice) + + y: p - progressive: fields sampled at same time + i - interlaced: fields sampled at different times + + z: p - progressive: subsampling over whole frame + i - interlaced: each field subsampled independently + ? - unknown (allowed only for non-4:2:0 subsampling) + + X - character string 'metadata' (unparsed, but passed around) + + ************************************************************************ + ************************************************************************/ + + +/* + + THAT'S ALL FOLKS! + + Thank you for reading the source code. We hope you have thoroughly + enjoyed the experience. + +*/ + + + + + +#ifdef INTERNAL_Y4M_LIBCODE_STUFF_QPX +#define Y4MPRIVATIZE(identifier) identifier +#else +#define Y4MPRIVATIZE(identifier) PRIVATE##identifier +#endif + +/* + * Actual structure definitions of structures which you shouldn't touch. + * + */ + +/************************************************************************ + * 'xtag_list' --- list of unparsed and/or meta/X header tags + * + * Do not touch this structure directly! + * + * Use the y4m_xtag_*() functions (see below). + * You must initialize/finalize this structure before/after use. + ************************************************************************/ +struct _y4m_xtag_list { + int Y4MPRIVATIZE(count); + char *Y4MPRIVATIZE(tags)[Y4M_MAX_XTAGS]; +}; + + +/************************************************************************ + * 'stream_info' --- stream header information + * + * Do not touch this structure directly! + * + * Use the y4m_si_*() functions (see below). + * You must initialize/finalize this structure before/after use. + ************************************************************************/ +struct _y4m_stream_info { + /* values from header/setters */ + int Y4MPRIVATIZE(width); + int Y4MPRIVATIZE(height); + int Y4MPRIVATIZE(interlace); /* see Y4M_ILACE_* definitions */ + y4m_ratio_t Y4MPRIVATIZE(framerate); /* see Y4M_FPS_* definitions */ + y4m_ratio_t Y4MPRIVATIZE(sampleaspect); /* see Y4M_SAR_* definitions */ + int Y4MPRIVATIZE(chroma); /* see Y4M_CHROMA_* definitions */ + + /* mystical X tags */ + y4m_xtag_list_t Y4MPRIVATIZE(x_tags); +}; + + +/************************************************************************ + * 'frame_info' --- frame header information + * + * Do not touch this structure directly! + * + * Use the y4m_fi_*() functions (see below). + * You must initialize/finalize this structure before/after use. + ************************************************************************/ + +struct _y4m_frame_info { + int Y4MPRIVATIZE(spatial); /* see Y4M_SAMPLING_* definitions */ + int Y4MPRIVATIZE(temporal); /* see Y4M_SAMPLING_* definitions */ + int Y4MPRIVATIZE(presentation); /* see Y4M_PRESENT_* definitions */ + /* mystical X tags */ + y4m_xtag_list_t Y4MPRIVATIZE(x_tags); +}; + + +#undef Y4MPRIVATIZE + + +#endif /* __YUV4MPEG_H__ */ + + diff --git a/veejay-current/reloaded-gtk3/src/yuv4mpeg_intern.h b/veejay-current/reloaded-gtk3/src/yuv4mpeg_intern.h new file mode 100644 index 00000000..3ada1cba --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/yuv4mpeg_intern.h @@ -0,0 +1,85 @@ +/* + * yuv4mpeg_intern.h: Internal constants for "new" YUV4MPEG streams + * + * Copyright (C) 2001 Andrew Stevens + * Copyright (C) 2001 Matthew J. Marjanovic + * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * 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. + */ + +#ifndef __YUV4MPEG_INTERN_H__ +#define __YUV4MPEG_INTERN_H__ + + +#define Y4M_MAGIC "YUV4MPEG2" +#define Y4M_FRAME_MAGIC "FRAME" + +#define Y4M_DELIM " " /* single-character(space) separating tagged fields */ + +#define Y4M_LINE_MAX 256 /* max number of characters in a header line + (including the '\n', but not the '\0') */ + + +/* standard framerate ratios */ +#define Y4M_FPS_UNKNOWN { 0, 0 } +#define Y4M_FPS_NTSC_FILM { 24000, 1001 } +#define Y4M_FPS_FILM { 24, 1 } +#define Y4M_FPS_PAL { 25, 1 } +#define Y4M_FPS_NTSC { 30000, 1001 } +#define Y4M_FPS_30 { 30, 1 } +#define Y4M_FPS_PAL_FIELD { 50, 1 } +#define Y4M_FPS_NTSC_FIELD { 60000, 1001 } +#define Y4M_FPS_60 { 60, 1 } + +/* standard sample/pixel aspect ratios */ +#define Y4M_SAR_UNKNOWN { 0, 0 } +#define Y4M_SAR_SQUARE { 1, 1 } +#define Y4M_SAR_SQR_ANA_16_9 { 4, 3 } +#define Y4M_SAR_NTSC_CCIR601 { 10, 11 } +#define Y4M_SAR_NTSC_16_9 { 40, 33 } +#define Y4M_SAR_NTSC_SVCD_4_3 { 15, 11 } +#define Y4M_SAR_NTSC_SVCD_16_9 { 20, 11 } +#define Y4M_SAR_PAL_CCIR601 { 59, 54 } +#define Y4M_SAR_PAL_16_9 { 118, 81 } +#define Y4M_SAR_PAL_SVCD_4_3 { 59, 36 } +#define Y4M_SAR_PAL_SVCD_16_9 { 59, 27 } + +#define Y4M_SAR_MPEG1_1 Y4M_SAR_SQUARE +#define Y4M_SAR_MPEG1_2 { 10000, 6735 } +#define Y4M_SAR_MPEG1_3 { 10000, 7031 } /* Anamorphic 16:9 PAL */ +#define Y4M_SAR_MPEG1_4 { 10000, 7615 } +#define Y4M_SAR_MPEG1_5 { 10000, 8055 } +#define Y4M_SAR_MPEG1_6 { 10000, 8437 } /* Anamorphic 16:9 NTSC */ +#define Y4M_SAR_MPEG1_7 { 10000, 8935 } +#define Y4M_SAR_MPEG1_8 { 10000, 9375 } /* PAL/SECAM 4:3 */ +#define Y4M_SAR_MPEG1_9 { 10000, 9815 } +#define Y4M_SAR_MPEG1_10 { 10000, 10255 } +#define Y4M_SAR_MPEG1_11 { 10000, 10695 } +#define Y4M_SAR_MPEG1_12 { 10000, 11250 } /* NTSC 4:3 */ +#define Y4M_SAR_MPEG1_13 { 10000, 11575 } +#define Y4M_SAR_MPEG1_14 { 10000, 12015 } + +#define Y4M_DAR_UNKNOWN { 0, 0 } +#define Y4M_DAR_4_3 { 4, 3 } +#define Y4M_DAR_16_9 { 16, 9 } +#define Y4M_DAR_221_100 { 221, 100 } + +#define Y4M_DAR_MPEG2_1 { 1, 1 } +#define Y4M_DAR_MPEG2_2 { 4, 3 } +#define Y4M_DAR_MPEG2_3 { 16, 9 } +#define Y4M_DAR_MPEG2_4 { 221, 100 } + +#endif /* __YUV4MPEG_INTERN_H__ */ + diff --git a/veejay-current/reloaded-gtk3/src/yuv4mpeg_ratio.c b/veejay-current/reloaded-gtk3/src/yuv4mpeg_ratio.c new file mode 100644 index 00000000..7b50578c --- /dev/null +++ b/veejay-current/reloaded-gtk3/src/yuv4mpeg_ratio.c @@ -0,0 +1,157 @@ +/* + * yuv4mpeg_ratio.c: Functions for dealing with y4m_ratio_t datatype. + * + * Copyright (C) 2001 Matthew J. Marjanovic + * + * + * 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. + * + */ + +#include + +#include +#include "yuv4mpeg.h" +#include "yuv4mpeg_intern.h" + + +/* useful list of standard framerates */ +const y4m_ratio_t y4m_fps_UNKNOWN = Y4M_FPS_UNKNOWN; +const y4m_ratio_t y4m_fps_NTSC_FILM = Y4M_FPS_NTSC_FILM; +const y4m_ratio_t y4m_fps_FILM = Y4M_FPS_FILM; +const y4m_ratio_t y4m_fps_PAL = Y4M_FPS_PAL; +const y4m_ratio_t y4m_fps_NTSC = Y4M_FPS_NTSC; +const y4m_ratio_t y4m_fps_30 = Y4M_FPS_30; +const y4m_ratio_t y4m_fps_PAL_FIELD = Y4M_FPS_PAL_FIELD; +const y4m_ratio_t y4m_fps_NTSC_FIELD = Y4M_FPS_NTSC_FIELD; +const y4m_ratio_t y4m_fps_60 = Y4M_FPS_60; + +/* useful list of standard sample aspect ratios */ +const y4m_ratio_t y4m_sar_UNKNOWN = Y4M_SAR_UNKNOWN; +const y4m_ratio_t y4m_sar_SQUARE = Y4M_SAR_SQUARE; +const y4m_ratio_t y4m_sar_SQR_ANA_16_9 = Y4M_SAR_SQR_ANA_16_9; +const y4m_ratio_t y4m_sar_NTSC_CCIR601 = Y4M_SAR_NTSC_CCIR601; +const y4m_ratio_t y4m_sar_NTSC_16_9 = Y4M_SAR_NTSC_16_9; +const y4m_ratio_t y4m_sar_NTSC_SVCD_4_3 = Y4M_SAR_NTSC_SVCD_4_3; +const y4m_ratio_t y4m_sar_NTSC_SVCD_16_9 = Y4M_SAR_NTSC_SVCD_16_9; +const y4m_ratio_t y4m_sar_PAL_CCIR601 = Y4M_SAR_PAL_CCIR601; +const y4m_ratio_t y4m_sar_PAL_16_9 = Y4M_SAR_PAL_16_9; +const y4m_ratio_t y4m_sar_PAL_SVCD_4_3 = Y4M_SAR_PAL_SVCD_4_3; +const y4m_ratio_t y4m_sar_PAL_SVCD_16_9 = Y4M_SAR_PAL_SVCD_16_9; + +/* useful list of standard display aspect ratios */ +const y4m_ratio_t y4m_dar_UNKNOWN = Y4M_DAR_UNKNOWN; +const y4m_ratio_t y4m_dar_4_3 = Y4M_DAR_4_3; +const y4m_ratio_t y4m_dar_16_9 = Y4M_DAR_16_9; +const y4m_ratio_t y4m_dar_221_100 = Y4M_DAR_221_100; + +/* + * Euler's algorithm for greatest common divisor + */ + +static int gcd(int a, int b) +{ + a = (a >= 0) ? a : -a; + b = (b >= 0) ? b : -b; + + while (b > 0) { + int x = b; + b = a % b; + a = x; + } + return a; +} + + +/************************************************************************* + * + * Remove common factors from a ratio + * + *************************************************************************/ + + +void y4m_ratio_reduce(y4m_ratio_t *r) +{ + int d; + if ((r->n == 0) && (r->d == 0)) return; /* "unknown" */ + d = gcd(r->n, r->d); + r->n /= d; + r->d /= d; +} + + + +/************************************************************************* + * + * Parse "nnn:ddd" into a ratio + * + * returns: Y4M_OK - success + * Y4M_ERR_RANGE - range error + * + *************************************************************************/ + +int y4m_parse_ratio(y4m_ratio_t *r, const char *s) +{ + char *t = strchr(s, ':'); + if (t == NULL) return Y4M_ERR_RANGE; + r->n = atoi(s); + r->d = atoi(t+1); + if (r->d < 0) return Y4M_ERR_RANGE; + /* 0:0 == unknown, so that is ok, otherwise zero denominator is bad */ + if ((r->d == 0) && (r->n != 0)) return Y4M_ERR_RANGE; + y4m_ratio_reduce(r); + return Y4M_OK; +} + + + +/************************************************************************* + * + * Guess the true SAR (sample aspect ratio) from a list of commonly + * encountered values, given the "suggested" display aspect ratio, and + * the true frame width and height. + * + * Returns y4m_sar_UNKNOWN if no match is found. + * + *************************************************************************/ + +/* this is big enough to accommodate the difference between 720 and 704 */ +#define GUESS_ASPECT_TOLERANCE 0.03 + +y4m_ratio_t y4m_guess_sar(int width, int height, y4m_ratio_t dar) +{ + int i; + double implicit_sar = (double)(dar.n * height) / (double)(dar.d * width); + const y4m_ratio_t *sarray[] = + { + &y4m_sar_SQUARE, + &y4m_sar_NTSC_CCIR601, + &y4m_sar_NTSC_16_9, + &y4m_sar_NTSC_SVCD_4_3, + &y4m_sar_NTSC_SVCD_16_9, + &y4m_sar_PAL_CCIR601, + &y4m_sar_PAL_16_9, + &y4m_sar_PAL_SVCD_4_3, + &y4m_sar_PAL_SVCD_16_9, + &y4m_sar_UNKNOWN + }; + for (i = 0; !(Y4M_RATIO_EQL(*(sarray[i]),y4m_sar_UNKNOWN)); i++) { + double ratio = implicit_sar / Y4M_RATIO_DBL(*(sarray[i])); + if ( (ratio > (1.0 - GUESS_ASPECT_TOLERANCE)) && + (ratio < (1.0 + GUESS_ASPECT_TOLERANCE)) ) + return *(sarray[i]); + } + return y4m_sar_UNKNOWN; +} diff --git a/veejay-current/reloaded-gtk3/veejay.arch b/veejay-current/reloaded-gtk3/veejay.arch new file mode 100644 index 00000000..3f3f5a0d --- /dev/null +++ b/veejay-current/reloaded-gtk3/veejay.arch @@ -0,0 +1 @@ +-march=btver1