Merge lp:~tombeckmann/audience/clutter-audience into lp:~audience-members/audience/trunk
- clutter-audience
- Merge into trunk
Status: | Merged |
---|---|
Merge reported by: | Cody Garver |
Merged at revision: | not available |
Proposed branch: | lp:~tombeckmann/audience/clutter-audience |
Merge into: | lp:~audience-members/audience/trunk |
Diff against target: |
1874 lines (+1781/-0) (has conflicts) 17 files modified
CMakeLists.txt (+35/-0) cmake/FindVala.cmake (+65/-0) cmake/GSettings.cmake (+42/-0) cmake/ParseArguments.cmake (+36/-0) cmake/README (+10/-0) cmake/README.Vala.rst (+173/-0) cmake/Tests.cmake (+5/-0) cmake/Translations.cmake (+41/-0) cmake/ValaPrecompile.cmake (+187/-0) cmake/ValaVersion.cmake (+96/-0) data/audience.desktop (+9/-0) data/audience.svg (+307/-0) po/CMakeLists.txt (+5/-0) src/Config.vala.cmake (+11/-0) src/Widgets/previewer.vala (+19/-0) src/Widgets/tag_view.vala (+184/-0) src/audience.vala (+556/-0) Conflict adding file CMakeLists.txt. Moved existing file to CMakeLists.txt.moved. Conflict adding file cmake. Moved existing file to cmake.moved. Conflict adding file data. Moved existing file to data.moved. Conflict adding file po. Moved existing file to po.moved. |
To merge this branch: | bzr merge lp:~tombeckmann/audience/clutter-audience |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cody Garver | Approve | ||
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
- 6. By Tom Beckmann
-
Hiding controls only when playing
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Pim Vullers (pimvullers) wrote : | # |
The improved UI looks are really nice. But it seems you've changed quite a lot which has resulted in more differences between your version and trunk. We need to find out the differences such that we do not lose any improvements.
The main thing that I do not like about this request that it is more replacing then merging. Hence I'd like to see this list of differences as a TODO list to properly merge these branches.
Cody and I are both quite busy now, but he said that he'd have a look at this and try to help in the merge process. I'll only have time after this month (that's the deadline of my current project).
To be short... your work is nice and thanks for that, but the change is to big to just merge/replace it at once without a proper review. So we will definitely accept it, but it might need some more tweaks.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tom Beckmann (tombeckmann) wrote : | # |
Tell me what you miss from the trunk and I will copy it over and make it work, I think this will be a lot easier since this branch gives a completly new base.
One thing I just noticed is keyboardshortcuts, I will add it soon.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
Tom, our main concern is losing our bazaar history. When I get a spare moment I'll attempt to remedy this and send you a tar of a less offensive tree to submit for approval. Until then, continue hacking away on your branch. Pim and I agree that it is truly impressive. I'll try to get your changes merged as soon as humanly possible.
Again, thank you.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
Tom, here's a directory that contains an uncommited merge of the original lp:audience and your branch (as of revision 6). http://
Extract it, cd into it and perform bzr add then commit something like bzr commit -m "Audience meet Clutter"
Then please fix the following issues
* Title should display media title tag and fallback to filename without extension. A few things need to be replaced when using filename for window title, see Audience.vala in lp:audience for what I'm talking about
* Please make the controls bar the same height as the original Audience as well as its buttons
* Until further maturiy, please remove the Granite popup and move its entries to the AppMenu as "Open File", "Open DVD", "Open CD" and "Open Location"
* Remove the About menu so that we save as much space in the AppMenu as possible
* Buttons/labels in the controls need 10px padding between each other
* Please add time remaining directly to the left of the progress scale with a minus sign, for example: -1:07
* Please enable audience to be executed with a URI argument so that the Slingshot entry works. Example tom$ audience /home/tom/video.avi
I apologize for such a long list of demands.
Pim, what am I missing?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
Tom, can you think of any way for us to fall back to the previous overlay behavior for users that don't have good systems? The reason I ask is because Xubuntu has show some interest in Audience and the master plan is for us to be an easy default choice for others like Lubuntu and maybe even Ubuntu itself. Thanks so much for your hard work.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
Oops, I meant the time remaining countdown should be directly to the RIGHT of the scale.
Also, the size of the window at launch should be 624x352.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tom Beckmann (tombeckmann) wrote : | # |
Sorry, I didn't really get the part with the audience-
The changes won't be a problem, although I would love to keep the PopOver, I hope we can discuss this a bit... I will remove it for now.
- 7. By Tom Beckmann
-
media title is displayed in windowtitle, controls have same height as reference and padding of 10px, remaining time display, starting from commandline with arguments
- 8. By Tom Beckmann
-
Removed unnecessary coverflow.vala widget, added restart at beginning when pressing play, and (hopefully, couldnt test it) display of hours
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cody Garver (codygarver) wrote : | # |
A modified version of these changes has been merged into trunk. Long live Audience.
Preview Diff
1 | === added file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 1970-01-01 00:00:00 +0000 |
3 | +++ CMakeLists.txt 2012-02-17 22:20:22 +0000 |
4 | @@ -0,0 +1,35 @@ |
5 | +project (audience) |
6 | +cmake_minimum_required (VERSION 2.8) |
7 | +cmake_policy (VERSION 2.6) |
8 | +list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala) |
9 | +enable_testing () |
10 | +list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
11 | +configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
12 | +add_definitions(-DGETTEXT_PACKAGE="audience") |
13 | +find_package(PkgConfig) |
14 | +pkg_check_modules(DEPS REQUIRED granite gtk+-3.0 clutter-gtk-1.0 clutter-gst-1.0) |
15 | +add_definitions(${DEPS_CFLAGS}) |
16 | +link_libraries(${DEPS_LIBRARIES}) |
17 | +link_directories(${DEPS_LIBRARY_DIRS}) |
18 | +find_package(Vala REQUIRED) |
19 | +include(ValaVersion) |
20 | +ensure_vala_version("0.14.0" MINIMUM) |
21 | +include(ValaPrecompile) |
22 | +vala_precompile(VALA_C |
23 | + src/audience.vala |
24 | + ${CMAKE_BINARY_DIR}/src/Config.vala |
25 | + src/Widgets/tag_view.vala |
26 | + src/Widgets/previewer.vala |
27 | +PACKAGES |
28 | + gtk+-3.0 |
29 | + granite |
30 | + clutter-gst-1.0 |
31 | + clutter-gtk-1.0 |
32 | +OPTIONS |
33 | + --thread |
34 | +) |
35 | +add_subdirectory (po) |
36 | +add_executable(audience ${VALA_C}) |
37 | +install (TARGETS audience RUNTIME DESTINATION bin) |
38 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION share/applications) |
39 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.svg DESTINATION share/icons/hicolor/48x48/apps) |
40 | |
41 | === renamed file 'CMakeLists.txt' => 'CMakeLists.txt.moved' |
42 | === added directory 'cmake' |
43 | === renamed directory 'cmake' => 'cmake.moved' |
44 | === added file 'cmake/FindVala.cmake' |
45 | --- cmake/FindVala.cmake 1970-01-01 00:00:00 +0000 |
46 | +++ cmake/FindVala.cmake 2012-02-17 22:20:22 +0000 |
47 | @@ -0,0 +1,65 @@ |
48 | +## |
49 | +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
50 | +# |
51 | +# Redistribution and use in source and binary forms, with or without |
52 | +# modification, are permitted provided that the following conditions are met: |
53 | +# |
54 | +# 1. Redistributions of source code must retain the above copyright notice, |
55 | +# this list of conditions and the following disclaimer. |
56 | +# |
57 | +# 2. Redistributions in binary form must reproduce the above copyright notice, |
58 | +# this list of conditions and the following disclaimer in the documentation |
59 | +# and/or other materials provided with the distribution. |
60 | +# |
61 | +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
62 | +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
63 | +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
64 | +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
65 | +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
66 | +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
67 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
68 | +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
69 | +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
70 | +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
71 | +# |
72 | +# The views and conclusions contained in the software and documentation are those |
73 | +# of the authors and should not be interpreted as representing official policies, |
74 | +# either expressed or implied, of Jakob Westhoff |
75 | +## |
76 | + |
77 | +## |
78 | +# Find module for the Vala compiler (valac) |
79 | +# |
80 | +# This module determines wheter a Vala compiler is installed on the current |
81 | +# system and where its executable is. |
82 | +# |
83 | +# Call the module using "find_package(Vala) from within your CMakeLists.txt. |
84 | +# |
85 | +# The following variables will be set after an invocation: |
86 | +# |
87 | +# VALA_FOUND Whether the vala compiler has been found or not |
88 | +# VALA_EXECUTABLE Full path to the valac executable if it has been found |
89 | +# VALA_VERSION Version number of the available valac |
90 | +## |
91 | + |
92 | + |
93 | +# Search for the valac executable in the usual system paths. |
94 | +find_program(VALA_EXECUTABLE |
95 | + NAMES valac) |
96 | + |
97 | +# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. |
98 | +# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. |
99 | +# VALA_EXECUTABLE is set) |
100 | + |
101 | +include(FindPackageHandleStandardArgs) |
102 | +find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) |
103 | + |
104 | +mark_as_advanced(VALA_EXECUTABLE) |
105 | + |
106 | +# Determine the valac version |
107 | +if(VALA_FOUND) |
108 | + execute_process(COMMAND ${VALA_EXECUTABLE} "--version" |
109 | + OUTPUT_VARIABLE "VALA_VERSION") |
110 | + string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) |
111 | + string(STRIP ${VALA_VERSION} "VALA_VERSION") |
112 | +endif(VALA_FOUND) |
113 | |
114 | === added file 'cmake/GSettings.cmake' |
115 | --- cmake/GSettings.cmake 1970-01-01 00:00:00 +0000 |
116 | +++ cmake/GSettings.cmake 2012-02-17 22:20:22 +0000 |
117 | @@ -0,0 +1,42 @@ |
118 | +# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. |
119 | + |
120 | +option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) |
121 | + |
122 | +option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) |
123 | + |
124 | +if(GSETTINGS_LOCALINSTALL) |
125 | + message(STATUS "GSettings schemas will be installed locally.") |
126 | +endif() |
127 | + |
128 | +if(GSETTINGS_COMPILE) |
129 | + message(STATUS "GSettings shemas will be compiled.") |
130 | +endif() |
131 | + |
132 | +macro(add_schema SCHEMA_NAME) |
133 | + |
134 | + set(PKG_CONFIG_EXECUTABLE pkg-config) |
135 | + # Have an option to not install the schema into where GLib is |
136 | + if (GSETTINGS_LOCALINSTALL) |
137 | + SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") |
138 | + else (GSETTINGS_LOCALINSTALL) |
139 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) |
140 | + SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") |
141 | + endif (GSETTINGS_LOCALINSTALL) |
142 | + |
143 | + # Run the validator and error if it fails |
144 | + execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) |
145 | + execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) |
146 | + |
147 | + if (_schemas_invalid) |
148 | + message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") |
149 | + endif (_schemas_invalid) |
150 | + |
151 | + # Actually install and recomple schemas |
152 | + message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") |
153 | + install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) |
154 | + |
155 | + if (GSETTINGS_COMPILE) |
156 | + install (CODE "message (STATUS \"Compiling GSettings schemas\")") |
157 | + install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") |
158 | + endif () |
159 | +endmacro() |
160 | |
161 | === added file 'cmake/ParseArguments.cmake' |
162 | --- cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000 |
163 | +++ cmake/ParseArguments.cmake 2012-02-17 22:20:22 +0000 |
164 | @@ -0,0 +1,36 @@ |
165 | +## |
166 | +# This is a helper Macro to parse optional arguments in Macros/Functions |
167 | +# It has been taken from the public CMake wiki. |
168 | +# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and |
169 | +# licensing. |
170 | +## |
171 | +macro(parse_arguments prefix arg_names option_names) |
172 | + set(DEFAULT_ARGS) |
173 | + foreach(arg_name ${arg_names}) |
174 | + set(${prefix}_${arg_name}) |
175 | + endforeach(arg_name) |
176 | + foreach(option ${option_names}) |
177 | + set(${prefix}_${option} FALSE) |
178 | + endforeach(option) |
179 | + |
180 | + set(current_arg_name DEFAULT_ARGS) |
181 | + set(current_arg_list) |
182 | + foreach(arg ${ARGN}) |
183 | + set(larg_names ${arg_names}) |
184 | + list(FIND larg_names "${arg}" is_arg_name) |
185 | + if(is_arg_name GREATER -1) |
186 | + set(${prefix}_${current_arg_name} ${current_arg_list}) |
187 | + set(current_arg_name ${arg}) |
188 | + set(current_arg_list) |
189 | + else(is_arg_name GREATER -1) |
190 | + set(loption_names ${option_names}) |
191 | + list(FIND loption_names "${arg}" is_option) |
192 | + if(is_option GREATER -1) |
193 | + set(${prefix}_${arg} TRUE) |
194 | + else(is_option GREATER -1) |
195 | + set(current_arg_list ${current_arg_list} ${arg}) |
196 | + endif(is_option GREATER -1) |
197 | + endif(is_arg_name GREATER -1) |
198 | + endforeach(arg) |
199 | + set(${prefix}_${current_arg_name} ${current_arg_list}) |
200 | +endmacro(parse_arguments) |
201 | |
202 | === added file 'cmake/README' |
203 | --- cmake/README 1970-01-01 00:00:00 +0000 |
204 | +++ cmake/README 2012-02-17 22:20:22 +0000 |
205 | @@ -0,0 +1,10 @@ |
206 | + Elementary CMake modules |
207 | + |
208 | +This is a set of CMake modules: Translations, GSettings, and Vala modules. |
209 | + |
210 | +For all the Vala related modules see README.Vala.rst: |
211 | + - ParseArguments.cmake |
212 | + - ValaPrecompile.cmake |
213 | + - ValaVersion.cmake |
214 | + - FindVala.cmake |
215 | + |
216 | |
217 | === added file 'cmake/README.Vala.rst' |
218 | --- cmake/README.Vala.rst 1970-01-01 00:00:00 +0000 |
219 | +++ cmake/README.Vala.rst 2012-02-17 22:20:22 +0000 |
220 | @@ -0,0 +1,173 @@ |
221 | +========== |
222 | +Vala CMake |
223 | +========== |
224 | +:Author: |
225 | + Jakob Westhoff |
226 | +:Version: |
227 | + Draft |
228 | + |
229 | + |
230 | +Overview |
231 | +======== |
232 | + |
233 | +Vala CMake is a collection of macros for the CMake_ build system to allow the |
234 | +creation and management of projects developed using the Vala_ programming |
235 | +language or its "Genie" flavor (less tested). |
236 | + |
237 | + |
238 | +Installation |
239 | +============ |
240 | + |
241 | +To use the Vala macros in your own project you need to copy the macro files to |
242 | +an arbitrary folder in your projects directory and reference them in your |
243 | +``CMakeLists.txt`` file. |
244 | + |
245 | +Assuming the macros are stored under ``cmake/vala`` in your projects folder you |
246 | +need to add the following information to your base ``CMakeLists.txt``:: |
247 | + |
248 | + list(APPEND CMAKE_MODULE_PATH |
249 | + ${CMAKE_SOURCE_DIR}/cmake/vala |
250 | + ) |
251 | + |
252 | +After the new module path as been added you can simply include the provided |
253 | +modules or use the provided find routines. |
254 | + |
255 | + |
256 | +Finding Vala |
257 | +============ |
258 | + |
259 | +The find module for vala works like any other Find module in CMake. |
260 | +You can use it by simply calling the usual ``find_package`` function. Default |
261 | +parameters like ``REQUIRED`` and ``QUIETLY`` are supported. |
262 | + |
263 | +:: |
264 | + |
265 | + find_package(Vala REQUIRED) |
266 | + |
267 | +After a successful call to the find_package function the following variables |
268 | +will be set: |
269 | + |
270 | +VALA_FOUND |
271 | + Whether the vala compiler has been found or not |
272 | + |
273 | +VALA_EXECUTABLE |
274 | + Full path to the valac executable if it has been found |
275 | + |
276 | +VALA_VERSION |
277 | + Version number of the available valac |
278 | + |
279 | + |
280 | +Precompiling Vala sources |
281 | +========================= |
282 | + |
283 | +CMake is mainly supposed to handle c or c++ based projects. Luckily every vala |
284 | +program is translated into plain c code using the vala compiler, followed by |
285 | +normal compilation of the generated c program using gcc. |
286 | + |
287 | +The macro ``vala_precompile`` uses that fact to create c files from your .vala |
288 | +sources for further CMake processing. |
289 | + |
290 | +The first parameter provided is a variable, which will be filled with a list of |
291 | +c files outputted by the vala compiler. This list can than be used in |
292 | +conjunction with functions like ``add_executable`` or others to create the |
293 | +necessary compile rules with CMake. |
294 | + |
295 | +The initial variable is followed by a list of .vala files to be compiled. |
296 | +Please take care to add every vala file belonging to the currently compiled |
297 | +project or library as Vala will otherwise not be able to resolve all |
298 | +dependencies. |
299 | + |
300 | +The following sections may be specified afterwards to provide certain options |
301 | +to the vala compiler: |
302 | + |
303 | +PACKAGES |
304 | + A list of vala packages/libraries to be used during the compile cycle. The |
305 | + package names are exactly the same, as they would be passed to the valac |
306 | + "--pkg=" option. |
307 | + |
308 | +OPTIONS |
309 | + A list of optional options to be passed to the valac executable. This can be |
310 | + used to pass "--thread" for example to enable multi-threading support. |
311 | + |
312 | +DIRECTORY |
313 | + Specify the directory where the output source files will be stored. If |
314 | + ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. |
315 | + |
316 | +CUSTOM_VAPIS |
317 | + A list of custom vapi files to be included for compilation. This can be |
318 | + useful to include freshly created vala libraries without having to install |
319 | + them in the system. |
320 | + |
321 | +GENERATE_VAPI |
322 | + Pass all the needed flags to the compiler to create an internal vapi for |
323 | + the compiled library. The provided name will be used for this and a |
324 | + <provided_name>.vapi file will be created. |
325 | + |
326 | +GENERATE_HEADER |
327 | + Let the compiler generate a header file for the compiled code. There will |
328 | + be a header file as well as an internal header file being generated called |
329 | + <provided_name>.h and <provided_name>_internal.h |
330 | + |
331 | +The following call is a simple example to the vala_precompile macro showing an |
332 | +example to every of the optional sections:: |
333 | + |
334 | + vala_precompile(VALA_C |
335 | + source1.vala |
336 | + source2.vala |
337 | + source3.vala |
338 | + PACKAGES |
339 | + gtk+-2.0 |
340 | + gio-1.0 |
341 | + posix |
342 | + OPTIONS |
343 | + --thread |
344 | + CUSTOM_VAPIS |
345 | + some_vapi.vapi |
346 | + GENERATE_VAPI |
347 | + myvapi |
348 | + GENERATE_HEADER |
349 | + myheader |
350 | + ) |
351 | + |
352 | +Most important is the variable VALA_C which will contain all the generated c |
353 | +file names after the call. The easiest way to use this information is to tell |
354 | +CMake to create an executable out of it. |
355 | + |
356 | +:: |
357 | + |
358 | + add_executable(myexecutable ${VALA_C}) |
359 | + |
360 | + |
361 | +Further reading |
362 | +=============== |
363 | + |
364 | +The `Pdf Presenter Console`__ , which is a vala based project of mine, makes |
365 | +heavy usage of the here described macros. To look at a real world example of |
366 | +these macros the mentioned project is the right place to take a look. The svn |
367 | +trunk of it can be found at:: |
368 | + |
369 | + svn://pureenergy.cc/pdf_presenter_console/trunk |
370 | + |
371 | + |
372 | +__ http://westhoffswelt.de/projects/pdf_presenter_console.html |
373 | + |
374 | + |
375 | +Acknowledgments |
376 | +=============== |
377 | + |
378 | +Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me |
379 | +a lot with the initial version of this macros and always answered my mostly |
380 | +dumb CMake questions. |
381 | + |
382 | +.. _CMake: http://cmake.org |
383 | +.. _Vala: http://live.gnome.org/Vala |
384 | +.. _Genie: http://live.gnome.org/Genie |
385 | + |
386 | + |
387 | + |
388 | |
389 | +.. |
390 | + Local Variables: |
391 | + mode: rst |
392 | + fill-column: 79 |
393 | + End: |
394 | + vim: et syn=rst tw=79 |
395 | |
396 | === added file 'cmake/Tests.cmake' |
397 | --- cmake/Tests.cmake 1970-01-01 00:00:00 +0000 |
398 | +++ cmake/Tests.cmake 2012-02-17 22:20:22 +0000 |
399 | @@ -0,0 +1,5 @@ |
400 | +# Test macros for Marlin, feel free to re-use them. |
401 | + |
402 | +macro(add_test_executable EXE_NAME) |
403 | + add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}) |
404 | +endmacro() |
405 | |
406 | === added file 'cmake/Translations.cmake' |
407 | --- cmake/Translations.cmake 1970-01-01 00:00:00 +0000 |
408 | +++ cmake/Translations.cmake 2012-02-17 22:20:22 +0000 |
409 | @@ -0,0 +1,41 @@ |
410 | +# Translations.cmake, CMake macros written for Marlin, feel free to re-use them |
411 | + |
412 | +macro(add_translations_directory NLS_PACKAGE) |
413 | + add_custom_target (i18n ALL COMMENT “Building i18n messages.”) |
414 | + find_program (MSGFMT_EXECUTABLE msgfmt) |
415 | + file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) |
416 | + foreach (PO_INPUT ${PO_FILES}) |
417 | + get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) |
418 | + set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) |
419 | + add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) |
420 | + |
421 | + install (FILES ${MO_OUTPUT} DESTINATION |
422 | + share/locale/${PO_INPUT_BASE}/LC_MESSAGES |
423 | + RENAME ${NLS_PACKAGE}.mo) |
424 | + endforeach (PO_INPUT ${PO_FILES}) |
425 | +endmacro(add_translations_directory) |
426 | + |
427 | + |
428 | +macro(add_translations_catalog NLS_PACKAGE) |
429 | + add_custom_target (pot COMMENT “Building translation catalog.”) |
430 | + find_program (XGETTEXT_EXECUTABLE xgettext) |
431 | + |
432 | + |
433 | + set(C_SOURCE "") |
434 | + |
435 | + foreach(FILES_INPUT ${ARGN}) |
436 | + file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) |
437 | + foreach(C_FILE ${SOURCE_FILES}) |
438 | + set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
439 | + endforeach() |
440 | + file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) |
441 | + foreach(C_FILE ${SOURCE_FILES}) |
442 | + set(C_SOURCE ${C_SOURCE} ${C_FILE}) |
443 | + endforeach() |
444 | + endforeach() |
445 | + |
446 | + add_custom_command (TARGET pot COMMAND |
447 | + ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot |
448 | + ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8 |
449 | + ) |
450 | +endmacro() |
451 | |
452 | === added file 'cmake/ValaPrecompile.cmake' |
453 | --- cmake/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000 |
454 | +++ cmake/ValaPrecompile.cmake 2012-02-17 22:20:22 +0000 |
455 | @@ -0,0 +1,187 @@ |
456 | +## |
457 | +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
458 | +# |
459 | +# Redistribution and use in source and binary forms, with or without |
460 | +# modification, are permitted provided that the following conditions are met: |
461 | +# |
462 | +# 1. Redistributions of source code must retain the above copyright notice, |
463 | +# this list of conditions and the following disclaimer. |
464 | +# |
465 | +# 2. Redistributions in binary form must reproduce the above copyright notice, |
466 | +# this list of conditions and the following disclaimer in the documentation |
467 | +# and/or other materials provided with the distribution. |
468 | +# |
469 | +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
470 | +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
471 | +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
472 | +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
473 | +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
474 | +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
475 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
476 | +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
477 | +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
478 | +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
479 | +# |
480 | +# The views and conclusions contained in the software and documentation are those |
481 | +# of the authors and should not be interpreted as representing official policies, |
482 | +# either expressed or implied, of Jakob Westhoff |
483 | +## |
484 | + |
485 | +include(ParseArguments) |
486 | +find_package(Vala REQUIRED) |
487 | + |
488 | +## |
489 | +# Compile vala files to their c equivalents for further processing. |
490 | +# |
491 | +# The "vala_precompile" macro takes care of calling the valac executable on the |
492 | +# given source to produce c files which can then be processed further using |
493 | +# default cmake functions. |
494 | +# |
495 | +# The first parameter provided is a variable, which will be filled with a list |
496 | +# of c files outputted by the vala compiler. This list can than be used in |
497 | +# conjuction with functions like "add_executable" or others to create the |
498 | +# neccessary compile rules with CMake. |
499 | +# |
500 | +# The initial variable is followed by a list of .vala files to be compiled. |
501 | +# Please take care to add every vala file belonging to the currently compiled |
502 | +# project or library as Vala will otherwise not be able to resolve all |
503 | +# dependencies. |
504 | +# |
505 | +# The following sections may be specified afterwards to provide certain options |
506 | +# to the vala compiler: |
507 | +# |
508 | +# PACKAGES |
509 | +# A list of vala packages/libraries to be used during the compile cycle. The |
510 | +# package names are exactly the same, as they would be passed to the valac |
511 | +# "--pkg=" option. |
512 | +# |
513 | +# OPTIONS |
514 | +# A list of optional options to be passed to the valac executable. This can be |
515 | +# used to pass "--thread" for example to enable multi-threading support. |
516 | +# |
517 | +# CUSTOM_VAPIS |
518 | +# A list of custom vapi files to be included for compilation. This can be |
519 | +# useful to include freshly created vala libraries without having to install |
520 | +# them in the system. |
521 | +# |
522 | +# GENERATE_VAPI |
523 | +# Pass all the needed flags to the compiler to create an internal vapi for |
524 | +# the compiled library. The provided name will be used for this and a |
525 | +# <provided_name>.vapi file will be created. |
526 | +# |
527 | +# GENERATE_HEADER |
528 | +# Let the compiler generate a header file for the compiled code. There will |
529 | +# be a header file as well as an internal header file being generated called |
530 | +# <provided_name>.h and <provided_name>_internal.h |
531 | +# |
532 | +# The following call is a simple example to the vala_precompile macro showing |
533 | +# an example to every of the optional sections: |
534 | +# |
535 | +# vala_precompile(VALA_C |
536 | +# source1.vala |
537 | +# source2.vala |
538 | +# source3.vala |
539 | +# PACKAGES |
540 | +# gtk+-2.0 |
541 | +# gio-1.0 |
542 | +# posix |
543 | +# DIRECTORY |
544 | +# gen |
545 | +# OPTIONS |
546 | +# --thread |
547 | +# CUSTOM_VAPIS |
548 | +# some_vapi.vapi |
549 | +# GENERATE_VAPI |
550 | +# myvapi |
551 | +# GENERATE_HEADER |
552 | +# myheader |
553 | +# ) |
554 | +# |
555 | +# Most important is the variable VALA_C which will contain all the generated c |
556 | +# file names after the call. |
557 | +## |
558 | + |
559 | +macro(vala_precompile output) |
560 | + parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) |
561 | + if(ARGS_DIRECTORY) |
562 | + set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) |
563 | + else(ARGS_DIRECTORY) |
564 | + set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) |
565 | + endif(ARGS_DIRECTORY) |
566 | + include_directories(${DIRECTORY}) |
567 | + set(vala_pkg_opts "") |
568 | + foreach(pkg ${ARGS_PACKAGES}) |
569 | + list(APPEND vala_pkg_opts "--pkg=${pkg}") |
570 | + endforeach(pkg ${ARGS_PACKAGES}) |
571 | + set(in_files "") |
572 | + set(out_files "") |
573 | + set(${output} "") |
574 | + foreach(src ${ARGS_DEFAULT_ARGS}) |
575 | + string(REGEX MATCH "^/" IS_MATCHED ${src}) |
576 | + if(${IS_MATCHED} MATCHES "/") |
577 | + list(APPEND in_files "${src}") |
578 | + else() |
579 | + list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") |
580 | + endif() |
581 | + string(REPLACE ".vala" ".c" src ${src}) |
582 | + string(REPLACE ".gs" ".c" src ${src}) |
583 | + if(${IS_MATCHED} MATCHES "/") |
584 | + string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} src ${src}) |
585 | + #get_filename_component(VALA_FILE_NAME ${src} NAME) |
586 | + set(out_file "${src}") |
587 | + list(APPEND out_files "${src}") |
588 | + else() |
589 | + set(out_file "${DIRECTORY}/${src}") |
590 | + list(APPEND out_files "${DIRECTORY}/${src}") |
591 | + endif() |
592 | + list(APPEND ${output} ${out_file}) |
593 | + endforeach(src ${ARGS_DEFAULT_ARGS}) |
594 | + |
595 | + set(custom_vapi_arguments "") |
596 | + if(ARGS_CUSTOM_VAPIS) |
597 | + foreach(vapi ${ARGS_CUSTOM_VAPIS}) |
598 | + if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
599 | + list(APPEND custom_vapi_arguments ${vapi}) |
600 | + else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
601 | + list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) |
602 | + endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) |
603 | + endforeach(vapi ${ARGS_CUSTOM_VAPIS}) |
604 | + endif(ARGS_CUSTOM_VAPIS) |
605 | + |
606 | + set(vapi_arguments "") |
607 | + if(ARGS_GENERATE_VAPI) |
608 | + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") |
609 | + set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi") |
610 | + |
611 | + # Header and internal header is needed to generate internal vapi |
612 | + if (NOT ARGS_GENERATE_HEADER) |
613 | + set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) |
614 | + endif(NOT ARGS_GENERATE_HEADER) |
615 | + endif(ARGS_GENERATE_VAPI) |
616 | + |
617 | + set(header_arguments "") |
618 | + if(ARGS_GENERATE_HEADER) |
619 | + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") |
620 | + list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") |
621 | + list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") |
622 | + list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") |
623 | + endif(ARGS_GENERATE_HEADER) |
624 | + |
625 | + add_custom_command(OUTPUT ${out_files} |
626 | + COMMAND |
627 | + ${VALA_EXECUTABLE} |
628 | + ARGS |
629 | + "-C" |
630 | + ${header_arguments} |
631 | + ${vapi_arguments} |
632 | + "-b" ${CMAKE_CURRENT_SOURCE_DIR} |
633 | + "-d" ${DIRECTORY} |
634 | + ${vala_pkg_opts} |
635 | + ${ARGS_OPTIONS} |
636 | + ${in_files} |
637 | + ${custom_vapi_arguments} |
638 | + DEPENDS |
639 | + ${in_files} |
640 | + ${ARGS_CUSTOM_VAPIS} |
641 | + ) |
642 | +endmacro(vala_precompile) |
643 | |
644 | === added file 'cmake/ValaVersion.cmake' |
645 | --- cmake/ValaVersion.cmake 1970-01-01 00:00:00 +0000 |
646 | +++ cmake/ValaVersion.cmake 2012-02-17 22:20:22 +0000 |
647 | @@ -0,0 +1,96 @@ |
648 | +## |
649 | +# Copyright 2009-2010 Jakob Westhoff. All rights reserved. |
650 | +# |
651 | +# Redistribution and use in source and binary forms, with or without |
652 | +# modification, are permitted provided that the following conditions are met: |
653 | +# |
654 | +# 1. Redistributions of source code must retain the above copyright notice, |
655 | +# this list of conditions and the following disclaimer. |
656 | +# |
657 | +# 2. Redistributions in binary form must reproduce the above copyright notice, |
658 | +# this list of conditions and the following disclaimer in the documentation |
659 | +# and/or other materials provided with the distribution. |
660 | +# |
661 | +# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR |
662 | +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
663 | +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
664 | +# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
665 | +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
666 | +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
667 | +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
668 | +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
669 | +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
670 | +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
671 | +# |
672 | +# The views and conclusions contained in the software and documentation are those |
673 | +# of the authors and should not be interpreted as representing official policies, |
674 | +# either expressed or implied, of Jakob Westhoff |
675 | +## |
676 | + |
677 | +include(ParseArguments) |
678 | +find_package(Vala REQUIRED) |
679 | + |
680 | +## |
681 | +# Ensure a certain valac version is available |
682 | +# |
683 | +# The initial argument is the version to check for |
684 | +# |
685 | +# It may be followed by a optional parameter to specifiy a version range. The |
686 | +# following options are valid: |
687 | +# |
688 | +# EXACT |
689 | +# Vala needs to be available in the exact version given |
690 | +# |
691 | +# MINIMUM |
692 | +# The provided version is the minimum version. Therefore Vala needs to be |
693 | +# available in the given version or any higher version |
694 | +# |
695 | +# MAXIMUM |
696 | +# The provided version is the maximum. Therefore Vala needs to be available |
697 | +# in the given version or any version older than this |
698 | +# |
699 | +# If no option is specified the version will be treated as a minimal version. |
700 | +## |
701 | +macro(ensure_vala_version version) |
702 | + parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) |
703 | + set(compare_message "") |
704 | + set(error_message "") |
705 | + if(ARGS_MINIMUM) |
706 | + set(compare_message "a minimum ") |
707 | + set(error_message "or greater ") |
708 | + elseif(ARGS_MAXIMUM) |
709 | + set(compare_message "a maximum ") |
710 | + set(error_message "or less ") |
711 | + endif(ARGS_MINIMUM) |
712 | + |
713 | + message(STATUS |
714 | + "checking for ${compare_message}Vala version of ${version}" |
715 | + ) |
716 | + |
717 | + unset(version_accepted) |
718 | + |
719 | + # MINIMUM is the default if no option is specified |
720 | + if(ARGS_EXACT) |
721 | + if(${VALA_VERSION} VERSION_EQUAL ${version} ) |
722 | + set(version_accepted TRUE) |
723 | + endif(${VALA_VERSION} VERSION_EQUAL ${version}) |
724 | + elseif(ARGS_MAXIMUM) |
725 | + if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
726 | + set(version_accepted TRUE) |
727 | + endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
728 | + else(ARGS_MAXIMUM) |
729 | + if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
730 | + set(version_accepted TRUE) |
731 | + endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) |
732 | + endif(ARGS_EXACT) |
733 | + |
734 | + if (NOT version_accepted) |
735 | + message(FATAL_ERROR |
736 | + "Vala version ${version} ${error_message}is required." |
737 | + ) |
738 | + endif(NOT version_accepted) |
739 | + |
740 | + message(STATUS |
741 | + " found Vala, version ${VALA_VERSION}" |
742 | + ) |
743 | +endmacro(ensure_vala_version) |
744 | |
745 | === added directory 'data' |
746 | === renamed directory 'data' => 'data.moved' |
747 | === added file 'data/audience.desktop' |
748 | --- data/audience.desktop 1970-01-01 00:00:00 +0000 |
749 | +++ data/audience.desktop 2012-02-17 22:20:22 +0000 |
750 | @@ -0,0 +1,9 @@ |
751 | +[Desktop Entry] |
752 | +Type=Application |
753 | +Name=Audience |
754 | +Comment=Watch films the best way |
755 | +GenericName=Multimedia Viewer |
756 | +Exec=audience %U |
757 | +Icon=audience |
758 | +Terminal=false |
759 | +Categories=Gtk;Multimedia |
760 | |
761 | === added file 'data/audience.svg' |
762 | --- data/audience.svg 1970-01-01 00:00:00 +0000 |
763 | +++ data/audience.svg 2012-02-17 22:20:22 +0000 |
764 | @@ -0,0 +1,307 @@ |
765 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
766 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
767 | + |
768 | +<svg |
769 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
770 | + xmlns:cc="http://creativecommons.org/ns#" |
771 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
772 | + xmlns:svg="http://www.w3.org/2000/svg" |
773 | + xmlns="http://www.w3.org/2000/svg" |
774 | + xmlns:xlink="http://www.w3.org/1999/xlink" |
775 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
776 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
777 | + width="128" |
778 | + height="128" |
779 | + id="svg3886" |
780 | + version="1.1" |
781 | + inkscape:version="0.48.2 r9819" |
782 | + sodipodi:docname="gpk-prefs.svg"> |
783 | + <defs |
784 | + id="defs3888"> |
785 | + <linearGradient |
786 | + inkscape:collect="always" |
787 | + xlink:href="#linearGradient3924" |
788 | + id="linearGradient2984" |
789 | + gradientUnits="userSpaceOnUse" |
790 | + gradientTransform="matrix(2.7297298,0,0,2.7297298,-1.5135108,-62.513486)" |
791 | + x1="23.99999" |
792 | + y1="4.999989" |
793 | + x2="23.99999" |
794 | + y2="43" /> |
795 | + <linearGradient |
796 | + id="linearGradient3924"> |
797 | + <stop |
798 | + id="stop3926" |
799 | + style="stop-color:#ffffff;stop-opacity:1;" |
800 | + offset="0" /> |
801 | + <stop |
802 | + offset="0.06316455" |
803 | + style="stop-color:#ffffff;stop-opacity:0.23529412;" |
804 | + id="stop3928" /> |
805 | + <stop |
806 | + id="stop3930" |
807 | + style="stop-color:#ffffff;stop-opacity:0.15686275;" |
808 | + offset="0.95056331" /> |
809 | + <stop |
810 | + id="stop3932" |
811 | + style="stop-color:#ffffff;stop-opacity:0.39215687;" |
812 | + offset="1" /> |
813 | + </linearGradient> |
814 | + <radialGradient |
815 | + inkscape:collect="always" |
816 | + xlink:href="#linearGradient7012-661-145-733-759-865-745-661-970-94-8" |
817 | + id="radialGradient2990" |
818 | + gradientUnits="userSpaceOnUse" |
819 | + gradientTransform="matrix(5.131108e-8,6.1720507,-6.5292935,-1.1371273e-7,119.1713,-93.225241)" |
820 | + cx="7.4956832" |
821 | + cy="8.4497671" |
822 | + fx="7.4956832" |
823 | + fy="8.4497671" |
824 | + r="19.99999" /> |
825 | + <linearGradient |
826 | + id="linearGradient7012-661-145-733-759-865-745-661-970-94-8"> |
827 | + <stop |
828 | + id="stop3618-1" |
829 | + style="stop-color:#ed665f;stop-opacity:1;" |
830 | + offset="0" /> |
831 | + <stop |
832 | + id="stop3270-2" |
833 | + style="stop-color:#eb564e;stop-opacity:1;" |
834 | + offset="0.5" /> |
835 | + <stop |
836 | + id="stop3620-8" |
837 | + style="stop-color:#de291f;stop-opacity:0.94117647;" |
838 | + offset="1" /> |
839 | + </linearGradient> |
840 | + <linearGradient |
841 | + inkscape:collect="always" |
842 | + xlink:href="#linearGradient3390-178-986-453-3" |
843 | + id="linearGradient2992" |
844 | + gradientUnits="userSpaceOnUse" |
845 | + gradientTransform="matrix(2.6410257,0,0,2.6410257,0.6153792,-60.384617)" |
846 | + x1="24" |
847 | + y1="44" |
848 | + x2="24" |
849 | + y2="3.8990016" /> |
850 | + <linearGradient |
851 | + id="linearGradient3390-178-986-453-3"> |
852 | + <stop |
853 | + id="stop3624-6" |
854 | + style="stop-color:#ba4712;stop-opacity:1;" |
855 | + offset="0" /> |
856 | + <stop |
857 | + offset="0.5" |
858 | + style="stop-color:#cf671c;stop-opacity:1;" |
859 | + id="stop3856-8" /> |
860 | + <stop |
861 | + id="stop3626-0" |
862 | + style="stop-color:#e27f39;stop-opacity:1;" |
863 | + offset="1" /> |
864 | + </linearGradient> |
865 | + <radialGradient |
866 | + cx="4.9929786" |
867 | + cy="43.5" |
868 | + r="2.5" |
869 | + fx="4.9929786" |
870 | + fy="43.5" |
871 | + id="radialGradient2455" |
872 | + xlink:href="#linearGradient3688-166-749" |
873 | + gradientUnits="userSpaceOnUse" |
874 | + gradientTransform="matrix(2.003784,0,0,1.4,27.98813,-17.4)" /> |
875 | + <linearGradient |
876 | + id="linearGradient3688-166-749"> |
877 | + <stop |
878 | + id="stop2883" |
879 | + style="stop-color:#181818;stop-opacity:1" |
880 | + offset="0" /> |
881 | + <stop |
882 | + id="stop2885" |
883 | + style="stop-color:#181818;stop-opacity:0" |
884 | + offset="1" /> |
885 | + </linearGradient> |
886 | + <radialGradient |
887 | + cx="4.9929786" |
888 | + cy="43.5" |
889 | + r="2.5" |
890 | + fx="4.9929786" |
891 | + fy="43.5" |
892 | + id="radialGradient2457" |
893 | + xlink:href="#linearGradient3688-464-309" |
894 | + gradientUnits="userSpaceOnUse" |
895 | + gradientTransform="matrix(2.003784,0,0,1.4,-20.01187,-104.4)" /> |
896 | + <linearGradient |
897 | + id="linearGradient3688-464-309"> |
898 | + <stop |
899 | + id="stop2889" |
900 | + style="stop-color:#181818;stop-opacity:1" |
901 | + offset="0" /> |
902 | + <stop |
903 | + id="stop2891" |
904 | + style="stop-color:#181818;stop-opacity:0" |
905 | + offset="1" /> |
906 | + </linearGradient> |
907 | + <linearGradient |
908 | + x1="25.058096" |
909 | + y1="47.027729" |
910 | + x2="25.058096" |
911 | + y2="39.999443" |
912 | + id="linearGradient2459" |
913 | + xlink:href="#linearGradient3702-501-757" |
914 | + gradientUnits="userSpaceOnUse" /> |
915 | + <linearGradient |
916 | + id="linearGradient3702-501-757"> |
917 | + <stop |
918 | + id="stop2895" |
919 | + style="stop-color:#181818;stop-opacity:0" |
920 | + offset="0" /> |
921 | + <stop |
922 | + id="stop2897" |
923 | + style="stop-color:#181818;stop-opacity:1" |
924 | + offset="0.5" /> |
925 | + <stop |
926 | + id="stop2899" |
927 | + style="stop-color:#181818;stop-opacity:0" |
928 | + offset="1" /> |
929 | + </linearGradient> |
930 | + <linearGradient |
931 | + inkscape:collect="always" |
932 | + xlink:href="#linearGradient8265-821-176-38-919-66-249-7-7" |
933 | + id="linearGradient3568" |
934 | + gradientUnits="userSpaceOnUse" |
935 | + gradientTransform="matrix(0.82498024,0,0,1.3012336,4.1618797,-1.4329212)" |
936 | + x1="16.626165" |
937 | + y1="15.298182" |
938 | + x2="20.054544" |
939 | + y2="24.627615" /> |
940 | + <linearGradient |
941 | + id="linearGradient8265-821-176-38-919-66-249-7-7"> |
942 | + <stop |
943 | + offset="0" |
944 | + style="stop-color:#ffffff;stop-opacity:1" |
945 | + id="stop2687-1-9" /> |
946 | + <stop |
947 | + offset="1" |
948 | + style="stop-color:#ffffff;stop-opacity:0" |
949 | + id="stop2689-5-4" /> |
950 | + </linearGradient> |
951 | + <linearGradient |
952 | + y2="24.627615" |
953 | + x2="20.054544" |
954 | + y1="15.298182" |
955 | + x1="16.626165" |
956 | + gradientTransform="matrix(2.1375158,0,0,3.3714836,11.830225,-65.192915)" |
957 | + gradientUnits="userSpaceOnUse" |
958 | + id="linearGradient7220" |
959 | + xlink:href="#linearGradient8265-821-176-38-919-66-249-7-7" |
960 | + inkscape:collect="always" /> |
961 | + </defs> |
962 | + <sodipodi:namedview |
963 | + id="base" |
964 | + pagecolor="#ffffff" |
965 | + bordercolor="#666666" |
966 | + borderopacity="1.0" |
967 | + inkscape:pageopacity="0.0" |
968 | + inkscape:pageshadow="2" |
969 | + inkscape:zoom="1" |
970 | + inkscape:cx="181.88759" |
971 | + inkscape:cy="97.72879" |
972 | + inkscape:current-layer="layer1" |
973 | + showgrid="true" |
974 | + inkscape:document-units="px" |
975 | + inkscape:grid-bbox="true" |
976 | + inkscape:window-width="1920" |
977 | + inkscape:window-height="1105" |
978 | + inkscape:window-x="0" |
979 | + inkscape:window-y="24" |
980 | + inkscape:window-maximized="1" /> |
981 | + <metadata |
982 | + id="metadata3891"> |
983 | + <rdf:RDF> |
984 | + <cc:Work |
985 | + rdf:about=""> |
986 | + <dc:format>image/svg+xml</dc:format> |
987 | + <dc:type |
988 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
989 | + <dc:title></dc:title> |
990 | + </cc:Work> |
991 | + </rdf:RDF> |
992 | + </metadata> |
993 | + <g |
994 | + id="layer1" |
995 | + inkscape:label="Layer 1" |
996 | + inkscape:groupmode="layer" |
997 | + transform="translate(0,64)"> |
998 | + <g |
999 | + transform="matrix(2.9499988,0,0,1.2222234,-6.8000012,1.555537)" |
1000 | + id="g2036" |
1001 | + style="display:inline"> |
1002 | + <g |
1003 | + transform="matrix(1.052632,0,0,1.285713,-1.263158,-13.42854)" |
1004 | + id="g3712" |
1005 | + style="opacity:0.4"> |
1006 | + <rect |
1007 | + width="5" |
1008 | + height="7" |
1009 | + x="38" |
1010 | + y="40" |
1011 | + id="rect2801" |
1012 | + style="fill:url(#radialGradient2455);fill-opacity:1;stroke:none" /> |
1013 | + <rect |
1014 | + width="5" |
1015 | + height="7" |
1016 | + x="-10" |
1017 | + y="-47" |
1018 | + transform="scale(-1,-1)" |
1019 | + id="rect3696" |
1020 | + style="fill:url(#radialGradient2457);fill-opacity:1;stroke:none" /> |
1021 | + <rect |
1022 | + width="28" |
1023 | + height="7.0000005" |
1024 | + x="10" |
1025 | + y="40" |
1026 | + id="rect3700" |
1027 | + style="fill:url(#linearGradient2459);fill-opacity:1;stroke:none" /> |
1028 | + </g> |
1029 | + </g> |
1030 | + <rect |
1031 | + style="color:#000000;fill:url(#radialGradient2990);fill-opacity:1;fill-rule:nonzero;stroke:url(#linearGradient2992);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" |
1032 | + id="rect5505-21" |
1033 | + y="-48.5" |
1034 | + x="12.5" |
1035 | + ry="6" |
1036 | + rx="6" |
1037 | + height="103" |
1038 | + width="103" /> |
1039 | + <rect |
1040 | + style="opacity:0.5;fill:none;stroke:url(#linearGradient2984);stroke-width:0.99999994;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" |
1041 | + id="rect6741-7" |
1042 | + y="-47.5" |
1043 | + x="13.5" |
1044 | + ry="5" |
1045 | + rx="5" |
1046 | + height="101" |
1047 | + width="101" /> |
1048 | + <path |
1049 | + inkscape:connector-curvature="0" |
1050 | + style="opacity:0.2;fill:url(#linearGradient7220);fill-opacity:1;fill-rule:evenodd;stroke:none" |
1051 | + id="path3333" |
1052 | + d="m 15.166068,-45.669124 c 0,0 -1.56203,1.74547 -1.164282,4.398617 l 0.03278,57.519984 c 2.832385,-0.06262 97.777614,-23.0548347 99.927464,-24.1544069 l 0,-33.2329941 c 0.44332,-3.031978 -1.27524,-5.659066 -4.11606,-5.840559 l -92.160807,-0.01647 c -0.814226,0.340053 -1.59412,0.542777 -2.519095,1.325825 z" |
1053 | + sodipodi:nodetypes="cccccccc" /> |
1054 | + <path |
1055 | + inkscape:connector-curvature="0" |
1056 | + style="opacity:0.15;fill:#ba4812;fill-opacity:1;stroke:none;display:inline" |
1057 | + d="m 64.220775,-44.023085 c -0.808191,5.400067 -1.423983,10.144207 -1.891401,14.362692 -7.311743,0.43668 -13.852657,3.374713 -18.570169,7.859345 -2.766937,-2.545898 -6.131536,-6.167913 -10.331069,-11.59531 3.353134,7.986617 5.505374,12.1986 7.422327,14.846992 -2.959457,3.958636 -4.693599,8.700569 -4.699851,13.809211 L 24.501279,-9.707598 40.735832,8.9860437 C 45.47524,15.427546 53.464549,19.799382 62.615946,20.263107 l 0.02866,2.407626 c -8.475839,-1.215962 -17.511664,-6.022096 -25.591285,-9.229216 7.941212,4.673732 16.007253,19.633617 25.634262,12.716104 l 0.100294,6.876921 c -1.702309,-1.459101 -3.336721,-3.021613 -6.505282,-2.767343 5.483546,7.200982 4.078272,10.866023 7.938166,14.390345 3.859898,-3.524322 2.454615,-7.189363 7.938165,-14.390345 -3.168559,-0.25427 -4.802972,1.308242 -6.505289,2.767343 l 0.100303,-6.876921 c 9.627027,6.917513 17.693032,-8.042372 25.634191,-12.716104 -8.079541,3.20712 -17.115394,8.013254 -25.591189,9.229216 l 0.02865,-2.407626 C 74.982385,19.803204 82.967813,15.430876 87.705609,8.9860437 L 103.94028,-9.707598 92.276642,-4.726317 c -0.0051,-5.113911 -1.725884,-9.860827 -4.685492,-13.823049 1.916879,-2.648392 4.069147,-6.860375 7.422255,-14.846992 -4.199563,5.427346 -7.549812,9.049412 -10.31676,11.59531 -4.717267,-4.488787 -11.266345,-7.425553 -18.584471,-7.859345 -0.467423,-4.218485 -1.083208,-8.962625 -1.891403,-14.362692 z m 2.263964,17.863431 c 5.682604,0.505347 10.717778,3.386169 14.171154,7.679471 -6.643056,4.803287 -9.055255,3.329907 -14.013546,15.774055 0.782713,-4.126149 1.038112,-11.179288 -0.157608,-23.453526 z m -4.527919,0.110693 c -1.183581,12.206725 -0.938005,19.228945 -0.157618,23.342833 -4.804532,-12.058254 -7.208977,-11.049517 -13.397444,-15.345118 3.270208,-4.283689 8.075894,-7.250616 13.555062,-7.997715 z m 21.306955,11.719842 c 1.401241,2.897034 2.192299,6.157218 2.192299,9.61664 0,11.4696989 -8.666149,20.844962 -19.573153,21.488687 l 0.05735,-3.846652 14.586731,-14.556412 c -2.934995,1.225078 -7.54641,1.833771 -7.809187,4.0265388 l -6.662907,2.2277418 0.04297,-2.9887716 c 9.394109,-11.087628 13.868365,-13.600329 17.165903,-15.967772 z m -37.383894,0.498131 c 3.238289,2.258008 7.728992,5.160226 16.463819,15.469641 l 0.043,2.9887716 -6.66291,-2.2277418 C 55.461006,0.206915 50.849592,-0.401778 47.914575,-1.626856 l 14.586736,14.556412 0.05731,3.777469 C 52.091881,15.604012 43.916815,6.431052 43.916815,-4.712479 c 0,-3.262892 0.709135,-6.346687 1.963047,-9.118509 z" |
1058 | + id="path3708-4" |
1059 | + inkscape:export-filename="/home/codygarver/path18.png" |
1060 | + inkscape:export-xdpi="90" |
1061 | + inkscape:export-ydpi="90" /> |
1062 | + <path |
1063 | + inkscape:connector-curvature="0" |
1064 | + style="fill:#ffcc00;fill-opacity:1;stroke:none;display:inline" |
1065 | + d="m 64.069027,-42.549471 c -0.772526,5.345285 -1.361142,10.041296 -1.807936,14.216988 -6.98909,0.432251 -13.24137,3.340479 -17.750704,7.779614 -2.644841,-2.52007 -5.860966,-6.10534 -9.875182,-11.477679 3.205169,7.905596 5.262433,12.07485 7.094796,14.696376 -2.828863,3.918477 -4.486481,8.6123061 -4.492456,13.6691221 L 26.102273,-8.5821009 41.620429,9.9219031 C 46.150695,16.298057 53.787453,20.625542 62.535018,21.084564 l 0.02742,2.383201 c -8.101839,-1.203628 -16.73893,-5.961004 -24.462016,-9.135587 7.590782,4.626316 15.300887,19.434441 24.503075,12.587102 l 0.09587,6.807159 c -1.627191,-1.4443 -3.18948,-2.99096 -6.218219,-2.73927 5.241568,7.12793 3.898305,10.75579 7.587871,14.24436 3.689567,-3.48857 2.346298,-7.11643 7.58787,-14.24436 -3.028736,-0.25169 -4.591027,1.29497 -6.218225,2.73927 l 0.09588,-6.807159 c 9.202205,6.847339 16.912271,-7.960786 24.503007,-12.587102 -7.723011,3.174583 -16.360131,7.931959 -24.461905,9.135587 l 0.02739,-2.383201 C 74.355755,20.629327 81.9888,16.301354 86.517528,9.9219031 l 15.518262,-18.504004 -11.148945,4.930749 c -0.0043,-5.062032 -1.649718,-9.7607931 -4.478725,-13.6828201 1.832288,-2.621526 3.889588,-6.79078 7.094722,-14.696376 -4.014246,5.372289 -7.216649,8.957609 -9.861498,11.477679 -4.509104,-4.443249 -10.769185,-7.350222 -17.764375,-7.779614 -0.446798,-4.175692 -1.035412,-8.871703 -1.807942,-14.216988 z m 2.16406,17.682211 c 5.431844,0.500224 10.244826,3.35182 13.545812,7.601569 -6.349914,4.754558 -8.655665,3.296127 -13.39516,15.6140331 0.748175,-4.08429 0.992304,-11.0658791 -0.150652,-23.2156021 z m -4.328109,0.109572 c -1.131355,12.082894 -0.896614,19.0338761 -0.150664,23.1060301 -4.592516,-11.9359271 -6.89086,-10.9374231 -12.80624,-15.1894481 3.125899,-4.240231 7.71952,-7.177062 12.956904,-7.916582 z m 20.366721,11.600951 c 1.339407,2.867644 2.095559,6.0947551 2.095559,9.5190821 0,11.353344 -8.283732,20.6334989 -18.709432,21.2706929 l 0.05481,-3.807629 13.943049,-14.40874295 c -2.805481,1.21265 -7.213402,1.81516805 -7.464583,3.98568905 l -6.368888,2.205143 0.04107,-2.958451 C 74.842859,-8.3260999 79.119676,-10.813312 82.271699,-13.156737 z m -35.734218,0.493076 c 3.09539,2.235102 7.387927,5.1078791 15.737302,15.3127081 l 0.04109,2.958451 -6.368886,-2.205143 c -0.251181,-2.170521 -4.6591,-2.77303905 -7.464601,-3.98568905 l 13.943052,14.40874295 0.05478,3.739147 C 52.475358,16.472734 44.661041,7.3928301 44.661041,-3.6376549 c 0,-3.229791 0.677844,-6.282302 1.876421,-9.0260061 z" |
1066 | + id="path3708" |
1067 | + inkscape:export-filename="/home/codygarver/path18.png" |
1068 | + inkscape:export-xdpi="90" |
1069 | + inkscape:export-ydpi="90" /> |
1070 | + </g> |
1071 | +</svg> |
1072 | |
1073 | === added directory 'po' |
1074 | === renamed directory 'po' => 'po.moved' |
1075 | === added file 'po/CMakeLists.txt' |
1076 | --- po/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1077 | +++ po/CMakeLists.txt 2012-02-17 22:20:22 +0000 |
1078 | @@ -0,0 +1,5 @@ |
1079 | +include (Translations) |
1080 | +add_translations_directory (audience) |
1081 | +add_translations_catalog (audience |
1082 | + ../src |
1083 | +) |
1084 | |
1085 | === added directory 'src' |
1086 | === added file 'src/Config.vala.cmake' |
1087 | --- src/Config.vala.cmake 1970-01-01 00:00:00 +0000 |
1088 | +++ src/Config.vala.cmake 2012-02-17 22:20:22 +0000 |
1089 | @@ -0,0 +1,11 @@ |
1090 | + |
1091 | +namespace Constants { |
1092 | + public const string DATADIR = "@DATADIR@"; |
1093 | + public const string PKGDATADIR = "@PKGDATADIR@"; |
1094 | + public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; |
1095 | + public const string RELEASE_NAME = "@RELEASE_NAME@"; |
1096 | + public const string VERSION = "@VERSION@"; |
1097 | + public const string VERSION_INFO = "@VERSION_INFO@"; |
1098 | + public const string PLUGINDIR = "@PLUGINDIR@"; |
1099 | +} |
1100 | + |
1101 | |
1102 | === added directory 'src/Widgets' |
1103 | === added file 'src/Widgets/previewer.vala' |
1104 | --- src/Widgets/previewer.vala 1970-01-01 00:00:00 +0000 |
1105 | +++ src/Widgets/previewer.vala 2012-02-17 22:20:22 +0000 |
1106 | @@ -0,0 +1,19 @@ |
1107 | + |
1108 | + |
1109 | +namespace Audience.Widgets{ |
1110 | + |
1111 | + public class Previewer : ClutterGst.VideoTexture{ |
1112 | + |
1113 | + public Previewer (){ |
1114 | + |
1115 | + this.width = 120; |
1116 | + this.height = 120; |
1117 | + this.y = 2; |
1118 | + this.opacity = 0; |
1119 | + this.audio_volume = 0.0; |
1120 | + |
1121 | + } |
1122 | + |
1123 | + } |
1124 | + |
1125 | +} |
1126 | |
1127 | === added file 'src/Widgets/tag_view.vala' |
1128 | --- src/Widgets/tag_view.vala 1970-01-01 00:00:00 +0000 |
1129 | +++ src/Widgets/tag_view.vala 2012-02-17 22:20:22 +0000 |
1130 | @@ -0,0 +1,184 @@ |
1131 | + |
1132 | +/* |
1133 | + The panel on the right hand side |
1134 | +*/ |
1135 | + |
1136 | +namespace Audience.Widgets{ |
1137 | + |
1138 | + public class TagView : GtkClutter.Actor{ |
1139 | + |
1140 | + public bool expanded; |
1141 | + public Gtk.Grid taggrid; |
1142 | + public Gtk.ListStore playlist; |
1143 | + public AudienceApp app; |
1144 | + |
1145 | + public TagView (AudienceApp app){ |
1146 | + this.app = app; |
1147 | + |
1148 | + var notebook = new Granite.Widgets.StaticNotebook (); |
1149 | + |
1150 | + /*tags*/ |
1151 | + taggrid = new Gtk.Grid (); |
1152 | + taggrid.column_spacing = 10; |
1153 | + taggrid.margin = 12; |
1154 | + |
1155 | + /*chapters*/ |
1156 | + var chaptergrid = new Gtk.Grid (); |
1157 | + chaptergrid.margin = 12; |
1158 | + chaptergrid.attach (new LLabel.markup ("<span weight='bold' font='20'>Go to...</span>"), 0, 0, 1, 1); |
1159 | + |
1160 | + chaptergrid.attach ( |
1161 | + new Gtk.Image.from_icon_name ("edit-find-symbolic", Gtk.IconSize.MENU), 0, 1, 1, 1); |
1162 | + chaptergrid.attach (new Gtk.Button.with_label ("Menu"), 1, 1, 1, 1); |
1163 | + chaptergrid.attach ( |
1164 | + new Gtk.Image.from_icon_name ("folder-music-symbolic", Gtk.IconSize.MENU), 0, 2, 1, 1); |
1165 | + chaptergrid.attach (new Gtk.Button.with_label ("Audio Menu"), 1, 2, 1, 1); |
1166 | + chaptergrid.attach ( |
1167 | + new Gtk.Image.from_icon_name ("folder-videos-symbolic", Gtk.IconSize.MENU), 0, 3, 1, 1); |
1168 | + chaptergrid.attach (new Gtk.Button.with_label ("Chapter Menu"), 1, 3, 1, 1); |
1169 | + for (var i=1;i<10;i++){ |
1170 | + chaptergrid.attach ( |
1171 | + new Gtk.Image.from_icon_name ("view-list-video-symbolic", Gtk.IconSize.MENU), 0, i+3, 1, 1); |
1172 | + var bt = new Gtk.Button.with_label ("Chapter 0"+i.to_string ()); |
1173 | + bt.hexpand = true; |
1174 | + chaptergrid.attach (bt, 1, i+3, 1, 1); |
1175 | + } |
1176 | + |
1177 | + /*setup*/ |
1178 | + var setupgrid = new Gtk.Grid (); |
1179 | + var languages = new Gtk.ComboBoxText (); |
1180 | + var subtitles = new Gtk.ComboBoxText (); |
1181 | + setupgrid.attach (new LLabel.markup ( |
1182 | + "<span weight='bold' font='20'>Setup</span>"), 0, 0, 1, 1); |
1183 | + setupgrid.attach (new Gtk.Label ("Language"), 0, 1, 1, 1); |
1184 | + setupgrid.attach (languages, 1, 1, 1, 1); |
1185 | + setupgrid.attach (new Gtk.Label ("Subtitles"), 0, 2, 1, 1); |
1186 | + setupgrid.attach (subtitles, 1, 2, 1, 1); |
1187 | + setupgrid.column_homogeneous = true; |
1188 | + setupgrid.margin = 12; |
1189 | + |
1190 | + languages.append ("eng", "English (UK)"); |
1191 | + languages.append ("de", "German"); |
1192 | + languages.append ("fr", "French"); |
1193 | + languages.active = 0; |
1194 | + subtitles.append ("0", "None"); |
1195 | + subtitles.append ("eng", "English (UK"); |
1196 | + subtitles.append ("de", "German"); |
1197 | + subtitles.append ("fr", "French"); |
1198 | + subtitles.active = 0; |
1199 | + |
1200 | + /*playlist*/ |
1201 | + var playlistgrid = new Gtk.Grid (); |
1202 | + playlistgrid.margin = 12; |
1203 | + playlist = new Gtk.ListStore (4, typeof (Gdk.Pixbuf), /*playing*/ |
1204 | + typeof (Gdk.Pixbuf), /*icon*/ |
1205 | + typeof (string), /*title*/ |
1206 | + typeof (string)); /*filename*/ |
1207 | + var playlisttree = new Gtk.TreeView.with_model (playlist); |
1208 | + playlisttree.expand = true; |
1209 | + playlisttree.headers_visible = false; |
1210 | + var css = new Gtk.CssProvider (); |
1211 | + try{ |
1212 | + css.load_from_data ("*{background-color:@bg_color;}", -1); |
1213 | + }catch (Error e){warning (e.message);} |
1214 | + playlisttree.get_style_context ().add_provider (css, 12000); |
1215 | + |
1216 | + playlisttree.insert_column_with_attributes (-1, "", new Gtk.CellRendererPixbuf (), |
1217 | + "pixbuf", 0); |
1218 | + playlisttree.insert_column_with_attributes (-1, "", new Gtk.CellRendererPixbuf (), |
1219 | + "pixbuf", 1); |
1220 | + playlisttree.insert_column_with_attributes (-1, "", new Gtk.CellRendererText (), |
1221 | + "text", 2); |
1222 | + |
1223 | + playlisttree.row_activated.connect ( (path ,col) => { |
1224 | + Gtk.TreeIter iter; |
1225 | + playlist.get_iter (out iter, path); |
1226 | + string filename; |
1227 | + playlist.get (iter, 3, out filename); |
1228 | + app.open_file (filename); |
1229 | + }); |
1230 | + |
1231 | + playlistgrid.attach (new LLabel.markup ( |
1232 | + "<span weight='bold' font='20'>Playlist</span>"), 0, 0, 1, 1); |
1233 | + playlistgrid.attach (playlisttree, 0, 1, 1, 1); |
1234 | + |
1235 | + |
1236 | + notebook.append_page (taggrid, new Gtk.Label ("Details")); |
1237 | + notebook.append_page (chaptergrid, new Gtk.Label ("Chapters")); |
1238 | + notebook.append_page (setupgrid, new Gtk.Label ("Setup")); |
1239 | + notebook.append_page (playlistgrid, new Gtk.Label ("Playlist")); |
1240 | + |
1241 | + ((Gtk.Bin)this.get_widget ()).add (notebook); |
1242 | + |
1243 | + notebook.show_all (); |
1244 | + |
1245 | + this.height = this.get_stage ().height; |
1246 | + this.width = 200; |
1247 | + this.expanded = false; |
1248 | + } |
1249 | + |
1250 | + public void add_play_item (string filename){ |
1251 | + try{ |
1252 | + Gtk.TreeIter iter; |
1253 | + var ext = Audience.get_extension (filename); |
1254 | + Gdk.Pixbuf pix = null; |
1255 | + if (ext in Audience.audio) |
1256 | + pix = Gtk.IconTheme.get_default ().load_icon ("folder-music-symbolic", 16, 0); |
1257 | + else |
1258 | + pix = Gtk.IconTheme.get_default ().load_icon ("folder-videos-symbolic", 16, 0); |
1259 | + var playing = Gtk.IconTheme.get_default ().load_icon ("media-playback-start-symbolic", 16, 0); |
1260 | + playlist.append (out iter); |
1261 | + playlist.set (iter, 0, playing, 1, pix, |
1262 | + 2, Audience.get_basename (filename), 3, filename); |
1263 | + }catch (Error e){warning (e.message);} |
1264 | + |
1265 | + } |
1266 | + |
1267 | + public void expand (){ |
1268 | + var x2 = this.get_stage ().width - this.width; |
1269 | + this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x:x2); |
1270 | + this.expanded = true; |
1271 | + } |
1272 | + |
1273 | + public void collapse (){ |
1274 | + var x2 = this.get_stage ().width; |
1275 | + this.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, x:x2); |
1276 | + this.expanded = false; |
1277 | + } |
1278 | + |
1279 | + public void get_tags (string filename, bool set_title){ |
1280 | + var pipe = new Gst.Pipeline ("tagpipe"); |
1281 | + var src = Gst.ElementFactory.make ("uridecodebin", "src"); |
1282 | + var sink = Gst.ElementFactory.make ("fakesink", "sink"); |
1283 | + src.set ("uri", File.new_for_commandline_arg (filename).get_uri ()); |
1284 | + pipe.add_many (src, sink); |
1285 | + |
1286 | + pipe.set_state (Gst.State.PAUSED); |
1287 | + |
1288 | + taggrid.foreach ( (w) => {taggrid.remove (w);}); |
1289 | + taggrid.attach (new LLabel.markup ("<span weight='bold' font='20'>Info</span>"), 0, 0, 1, 1); |
1290 | + var index = 1; |
1291 | + pipe.get_bus ().add_watch ( (bus, msg) => { |
1292 | + if (msg.type == Gst.MessageType.TAG){ |
1293 | + Gst.TagList tag_list; |
1294 | + msg.parse_tag (out tag_list); |
1295 | + tag_list.foreach ( (list, tag) => { |
1296 | + for (var i=0;i<list.get_tag_size (tag);i++){ |
1297 | + var val = list.get_value_index (tag, i); |
1298 | + if (set_title && tag == "title") |
1299 | + this.app.mainwindow.title = val.strdup_contents (); |
1300 | + taggrid.attach (new LLabel.markup ("<b>"+tag+"</b>"), 0, index, 1, 1); |
1301 | + taggrid.attach (new LLabel (val.strdup_contents ()), 1, index, 1, 1); |
1302 | + taggrid.show_all (); |
1303 | + index ++; |
1304 | + } |
1305 | + }); |
1306 | + }else if (msg.type == Gst.MessageType.EOS) |
1307 | + pipe.set_state (Gst.State.NULL); |
1308 | + return true; |
1309 | + }); |
1310 | + pipe.set_state (Gst.State.PLAYING); |
1311 | + } |
1312 | + } |
1313 | + |
1314 | +} |
1315 | |
1316 | === added file 'src/audience.vala' |
1317 | --- src/audience.vala 1970-01-01 00:00:00 +0000 |
1318 | +++ src/audience.vala 2012-02-17 22:20:22 +0000 |
1319 | @@ -0,0 +1,556 @@ |
1320 | + |
1321 | + |
1322 | +namespace Audience{ |
1323 | + |
1324 | + public const string [] video = { |
1325 | + "mpg", |
1326 | + "flv", |
1327 | + "mp4" |
1328 | + }; |
1329 | + public const string [] audio = { |
1330 | + "mp3", |
1331 | + "ogg" |
1332 | + }; |
1333 | + |
1334 | + public static string get_extension (string filename){ |
1335 | + int i=0; |
1336 | + for (i=filename.length;i!=0;i--){ |
1337 | + if (filename [i] == '.') |
1338 | + break; |
1339 | + } |
1340 | + return filename.substring (i+1); |
1341 | + } |
1342 | + public static string get_basename (string filename){ |
1343 | + int i=0; |
1344 | + for (i=filename.length;i!=0;i--){ |
1345 | + if (filename [i] == '.') |
1346 | + break; |
1347 | + } |
1348 | + int j=0; |
1349 | + for (j=filename.length;j!=0;j--){ |
1350 | + if (filename[j] == '/') |
1351 | + break; |
1352 | + } |
1353 | + return filename.substring (j + 1, i - j - 1); |
1354 | + } |
1355 | + |
1356 | + public static string seconds_to_time (int secs){ |
1357 | + int hours = 0; |
1358 | + int min = 0; |
1359 | + while (secs >= 60){ |
1360 | + ++min; |
1361 | + secs -= 60; |
1362 | + } |
1363 | + int min_tmp = min; |
1364 | + while (min >= 60){ |
1365 | + ++hours; |
1366 | + min_tmp -= 60; |
1367 | + } |
1368 | + string seconds = (secs < 10)?"0"+secs.to_string ():secs.to_string (); |
1369 | + |
1370 | + string ret = (hours > 0)?hours.to_string ():""; |
1371 | + ret += min.to_string () + ":" + seconds; |
1372 | + return ret; |
1373 | + } |
1374 | + |
1375 | + class LLabel : Gtk.Label{ |
1376 | + public LLabel (string label){ |
1377 | + this.set_halign (Gtk.Align.START); |
1378 | + this.label = label; |
1379 | + } |
1380 | + public LLabel.indent (string label){ |
1381 | + this (label); |
1382 | + this.margin_left = 10; |
1383 | + } |
1384 | + public LLabel.markup (string label){ |
1385 | + this (label); |
1386 | + this.use_markup = true; |
1387 | + } |
1388 | + public LLabel.right (string label){ |
1389 | + this.set_halign (Gtk.Align.END); |
1390 | + this.label = label; |
1391 | + } |
1392 | + public LLabel.right_with_markup (string label){ |
1393 | + this.set_halign (Gtk.Align.END); |
1394 | + this.use_markup = true; |
1395 | + this.label = label; |
1396 | + } |
1397 | + } |
1398 | + |
1399 | + public class AudienceApp : Granite.Application{ |
1400 | + |
1401 | + construct{ |
1402 | + program_name = "Audience"; |
1403 | + exec_name = "audience"; |
1404 | + |
1405 | + build_data_dir = Constants.DATADIR; |
1406 | + build_pkg_data_dir = Constants.PKGDATADIR; |
1407 | + build_release_name = Constants.RELEASE_NAME; |
1408 | + build_version = Constants.VERSION; |
1409 | + build_version_info = Constants.VERSION_INFO; |
1410 | + |
1411 | + app_years = ""; |
1412 | + app_icon = "audience"; |
1413 | + app_launcher = "audience.desktop"; |
1414 | + application_id = "net.launchpad.audience"; |
1415 | + |
1416 | + main_url = "https://code.launchpad.net/audience"; |
1417 | + bug_url = "https://bugs.launchpad.net/audience"; |
1418 | + help_url = "https://code.launchpad.net/audience"; |
1419 | + translate_url = "https://translations.launchpad.net/audience"; |
1420 | + |
1421 | + about_authors = {""}; |
1422 | + about_documenters = {""}; |
1423 | + about_artists = {""}; |
1424 | + about_comments = "Watch films the best way"; |
1425 | + about_translators = ""; |
1426 | + about_license_type = Gtk.License.GPL_3_0; |
1427 | + } |
1428 | + |
1429 | + public ClutterGst.VideoTexture canvas; |
1430 | + public Gtk.Window mainwindow; |
1431 | + public Audience.Widgets.TagView tagview; |
1432 | + public Gtk.Scale slider; |
1433 | + public Audience.Widgets.Previewer previewer; |
1434 | + public GtkClutter.Actor bar; |
1435 | + public Gtk.Toolbar toolbar; |
1436 | + public Gtk.ToolButton play; |
1437 | + public Gtk.ToolButton pause; |
1438 | + public Gtk.ToolButton unfullscreen; |
1439 | + public Clutter.Stage stage; |
1440 | + public bool fullscreened; |
1441 | + public uint hiding_timer; |
1442 | + |
1443 | + private float video_w; |
1444 | + private float video_h; |
1445 | + private bool just_opened; |
1446 | + private bool reached_end; |
1447 | + |
1448 | + private Gdk.Cursor normal_cursor; |
1449 | + private Gdk.Cursor blank_cursor; |
1450 | + |
1451 | + private inline Gtk.Image? sym (string name){ |
1452 | + try{ |
1453 | + return new Gtk.Image.from_pixbuf (Gtk.IconTheme.get_default ().lookup_icon |
1454 | + (name, 24, 0).load_symbolic ({1.0,1.0,1.0,1.0}, null, null, null, null)); |
1455 | + }catch (Error e){warning (e.message);return null;} |
1456 | + } |
1457 | + |
1458 | + public AudienceApp (){ |
1459 | + Granite.Services.Logger.DisplayLevel = Granite.Services.LogLevel.DEBUG; |
1460 | + |
1461 | + this.flags |= GLib.ApplicationFlags.HANDLES_OPEN; |
1462 | + |
1463 | + this.fullscreened = false; |
1464 | + |
1465 | + this.canvas = new ClutterGst.VideoTexture (); |
1466 | + this.mainwindow = new Gtk.Window (); |
1467 | + this.tagview = new Audience.Widgets.TagView (this); |
1468 | + this.previewer = new Audience.Widgets.Previewer (); |
1469 | + this.bar = new GtkClutter.Actor (); |
1470 | + this.toolbar = new Gtk.Toolbar (); |
1471 | + var mainbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); |
1472 | + var clutter = new GtkClutter.Embed (); |
1473 | + this.stage = (Clutter.Stage)clutter.get_stage (); |
1474 | + this.play = new Gtk.ToolButton (sym ("media-playback-start-symbolic"), ""); |
1475 | + this.pause = new Gtk.ToolButton (sym ("media-playback-pause-symbolic"), ""); |
1476 | + var time_item = new Gtk.ToolItem (); |
1477 | + var slider_item = new Gtk.ToolItem (); |
1478 | + var remain_item = new Gtk.ToolItem (); |
1479 | + var volm = new Gtk.ToolItem (); |
1480 | + var info = new Gtk.ToggleToolButton (); |
1481 | + var open = new Gtk.ToolButton (sym ("document-export-symbolic"),""); |
1482 | + var menu = new Gtk.Menu (); |
1483 | + var appm = this.create_appmenu (menu); |
1484 | + this.slider = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 100, 1); |
1485 | + var volume = new Gtk.VolumeButton (); |
1486 | + var time = new Gtk.Label ("0"); |
1487 | + var remaining = new Gtk.Label ("0"); |
1488 | + this.unfullscreen = new Gtk.ToolButton ( |
1489 | + new Gtk.Image.from_stock (Gtk.Stock.LEAVE_FULLSCREEN, Gtk.IconSize.BUTTON), ""); |
1490 | + this.blank_cursor = new Gdk.Cursor (Gdk.CursorType.BLANK_CURSOR); |
1491 | + this.normal_cursor = this.mainwindow.get_window ().get_cursor (); |
1492 | + |
1493 | + /*UI*/ |
1494 | + stage.add_actor (canvas); |
1495 | + stage.add_actor (tagview); |
1496 | + stage.add_actor (previewer); |
1497 | + stage.add_actor (bar); |
1498 | + stage.color = Clutter.Color.from_string ("#000"); |
1499 | + |
1500 | + this.tagview.x = stage.width; |
1501 | + this.tagview.width = 350; |
1502 | + |
1503 | + this.mainwindow.set_application (this); |
1504 | + this.mainwindow.add (mainbox); |
1505 | + this.mainwindow.set_default_size (654, 352); |
1506 | + |
1507 | + slider_item.set_expand (true); |
1508 | + slider_item.add (slider); |
1509 | + slider.draw_value = false; |
1510 | + |
1511 | + volm.add (volume); |
1512 | + volume.use_symbolic = true; |
1513 | + |
1514 | + time_item.add (time); |
1515 | + remain_item.add (remaining); |
1516 | + |
1517 | + info.icon_widget = sym ("view-list-filter-symbolic"); |
1518 | + appm.icon_widget = sym ("document-properties-symbolic"); |
1519 | + |
1520 | + play.sensitive = false; |
1521 | + |
1522 | + play.margin = time_item.margin = slider_item.margin = pause.margin = |
1523 | + volm.margin = info.margin = open.margin = appm.margin = 5; |
1524 | + |
1525 | + toolbar.insert (play, -1); |
1526 | + toolbar.insert (time_item, -1); |
1527 | + toolbar.insert (slider_item, -1); |
1528 | + toolbar.insert (remain_item, -1); |
1529 | + toolbar.insert (volm, -1); |
1530 | + toolbar.insert (info, -1); |
1531 | + toolbar.insert (open, -1); |
1532 | + toolbar.insert (appm, -1); |
1533 | + |
1534 | + var css = new Gtk.CssProvider (); |
1535 | + try{ |
1536 | + css.load_from_data (" |
1537 | + *{ |
1538 | + background-color:rgba(0,0,0,0); |
1539 | + background-image:none; |
1540 | + color:white; |
1541 | + } |
1542 | + ", -1); |
1543 | + }catch (Error e){warning (e.message);} |
1544 | + toolbar.get_style_context ().add_provider (css, 12000); |
1545 | + remaining.get_style_context ().add_provider (css, 12000); |
1546 | + time.get_style_context ().add_provider (css, 12000); |
1547 | + |
1548 | + bar.get_widget ().draw.connect ( (ctx) => { |
1549 | + ctx.set_operator (Cairo.Operator.SOURCE); |
1550 | + ctx.rectangle (0, 0, bar.get_widget ().get_allocated_width (), |
1551 | + bar.get_widget ().get_allocated_height ()); |
1552 | + ctx.set_source_rgba (0.0, 0.0, 0.0, 0.8); |
1553 | + ctx.fill (); |
1554 | + return false; |
1555 | + }); |
1556 | + |
1557 | + toolbar.show_all (); |
1558 | + ((Gtk.Container)bar.get_widget ()).add (toolbar); |
1559 | + |
1560 | + mainbox.pack_start (clutter); |
1561 | + |
1562 | + this.previewer.get_pipeline ().set_state (Gst.State.PLAYING); |
1563 | + |
1564 | + /*events*/ |
1565 | + //end |
1566 | + this.canvas.eos.connect ( () => { |
1567 | + reached_end = true; |
1568 | + this.toggle_play (false); |
1569 | + }); |
1570 | + |
1571 | + //slider |
1572 | + ulong id = slider.value_changed.connect ( () => { |
1573 | + canvas.progress = slider.get_value () / canvas.duration; |
1574 | + }); |
1575 | + Timeout.add (1000, () => { |
1576 | + SignalHandler.block (slider, id); |
1577 | + slider.set_range (0, canvas.duration); |
1578 | + slider.set_value (canvas.duration * canvas.progress); |
1579 | + SignalHandler.unblock (slider, id); |
1580 | + |
1581 | + time.label = seconds_to_time ((int)slider.get_value ()); |
1582 | + |
1583 | + remaining.label = "-" + seconds_to_time ((int)(canvas.duration - |
1584 | + slider.get_value ())); |
1585 | + return true; |
1586 | + }); |
1587 | + |
1588 | + //volume |
1589 | + volume.value_changed.connect ( () => { |
1590 | + canvas.audio_volume = volume.value; |
1591 | + }); |
1592 | + volume.value = 1.0; |
1593 | + |
1594 | + //preview thing |
1595 | + slider.motion_notify_event.connect ( (e) => { |
1596 | + previewer.x = (float)e.x; |
1597 | + previewer.y = stage.height - 180; |
1598 | + Timeout.add (200, () => { |
1599 | + previewer.progress = e.x / slider.get_allocated_width (); |
1600 | + return false; |
1601 | + }); |
1602 | + return false; |
1603 | + }); |
1604 | + slider.enter_notify_event.connect ( (e) => { |
1605 | + previewer.get_pipeline ().set_state (Gst.State.PLAYING); |
1606 | + var o2 = 255; |
1607 | + previewer.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity:o2); |
1608 | + previewer.raise_top (); |
1609 | + return false; |
1610 | + }); |
1611 | + slider.leave_notify_event.connect ( (e) => { |
1612 | + var o2 = 0; |
1613 | + previewer.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 400, opacity:o2); |
1614 | + previewer.get_pipeline ().set_state (Gst.State.PAUSED); |
1615 | + Timeout.add (400, () => {previewer.lower_bottom ();return false;}); |
1616 | + return false; |
1617 | + }); |
1618 | + |
1619 | + /*slide controls back in*/ |
1620 | + this.mainwindow.motion_notify_event.connect ( () => { |
1621 | + float y2 = this.stage.height - 56; |
1622 | + this.bar.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 100, y:y2); |
1623 | + this.mainwindow.get_window ().set_cursor (normal_cursor); |
1624 | + Gst.State state; |
1625 | + canvas.get_pipeline ().get_state (out state, null, 0); |
1626 | + if (state == Gst.State.PLAYING){ |
1627 | + Source.remove (this.hiding_timer); |
1628 | + this.hiding_timer = GLib.Timeout.add (2000, () => { |
1629 | + this.mainwindow.get_window ().set_cursor (blank_cursor); |
1630 | + float y3 = this.stage.height; |
1631 | + this.bar.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 1000, y:y3); |
1632 | + return false; |
1633 | + }); |
1634 | + } |
1635 | + return false; |
1636 | + }); |
1637 | + |
1638 | + /*open location popover*/ |
1639 | + open.clicked.connect ( () => { |
1640 | + var pop = new Granite.Widgets.PopOver (); |
1641 | + var box = new Gtk.Grid (); |
1642 | + ((Gtk.Box)pop.get_content_area ()).add (box); |
1643 | + |
1644 | + box.row_spacing = 5; |
1645 | + box.column_spacing = 12; |
1646 | + |
1647 | + var fil = new Gtk.Button.with_label ("File"); |
1648 | + var fil_i = new Gtk.Image.from_stock (Gtk.Stock.OPEN, Gtk.IconSize.DND); |
1649 | + var cd = new Gtk.Button.with_label ("CD"); |
1650 | + var cd_i = new Gtk.Image.from_icon_name ("media-cdrom-audio", Gtk.IconSize.DND); |
1651 | + var dvd = new Gtk.Button.with_label ("DVD"); |
1652 | + var dvd_i = new Gtk.Image.from_icon_name ("media-cdrom", Gtk.IconSize.DND); |
1653 | + var net = new Gtk.Button.with_label ("Network File"); |
1654 | + var net_i = new Gtk.Image.from_icon_name ("internet-web-browser", Gtk.IconSize.DND); |
1655 | + |
1656 | + fil.clicked.connect ( () => { |
1657 | + pop.destroy (); |
1658 | + var file = new Gtk.FileChooserDialog ("Open", this.mainwindow, Gtk.FileChooserAction.OPEN, |
1659 | + Gtk.Stock.OPEN, Gtk.ResponseType.ACCEPT, |
1660 | + Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL); |
1661 | + if (file.run () == Gtk.ResponseType.ACCEPT){ |
1662 | + open_file (file.get_uri ()); |
1663 | + } |
1664 | + file.destroy (); |
1665 | + }); |
1666 | + cd.clicked.connect ( () => { |
1667 | + open_file ("cdda://"); |
1668 | + canvas.get_pipeline ().set_state (Gst.State.PLAYING); |
1669 | + pop.destroy (); |
1670 | + }); |
1671 | + dvd.clicked.connect ( () => { |
1672 | + open_file ("dvd://"); |
1673 | + canvas.get_pipeline ().set_state (Gst.State.PLAYING); |
1674 | + pop.destroy (); |
1675 | + }); |
1676 | + net.clicked.connect ( () => { |
1677 | + var entry = new Gtk.Entry (); |
1678 | + entry.secondary_icon_stock = Gtk.Stock.OPEN; |
1679 | + entry.icon_release.connect ( (pos, e) => { |
1680 | + open_file (entry.text); |
1681 | + canvas.get_pipeline ().set_state (Gst.State.PLAYING); |
1682 | + pop.destroy (); |
1683 | + }); |
1684 | + box.remove (net); |
1685 | + box.attach (entry, 1, 3, 1, 1); |
1686 | + entry.show (); |
1687 | + }); |
1688 | + |
1689 | + box.attach (fil_i, 0, 0, 1, 1); |
1690 | + box.attach (fil, 1, 0, 1, 1); |
1691 | + box.attach (dvd_i, 0, 1, 1, 1); |
1692 | + box.attach (dvd, 1, 1, 1, 1); |
1693 | + box.attach (cd_i, 0, 2, 1, 1); |
1694 | + box.attach (cd, 1, 2, 1, 1); |
1695 | + box.attach (net_i, 0, 3, 1, 1); |
1696 | + box.attach (net, 1, 3, 1, 1); |
1697 | + |
1698 | + pop.move_to_widget (open); |
1699 | + pop.show_all (); |
1700 | + pop.present (); |
1701 | + pop.run (); |
1702 | + pop.destroy (); |
1703 | + }); |
1704 | + |
1705 | + play.clicked.connect ( () => {toggle_play (true);}); |
1706 | + pause.clicked.connect ( () => {toggle_play (false);}); |
1707 | + |
1708 | + unfullscreen.clicked.connect (toggle_fullscreen); |
1709 | + |
1710 | + info.toggled.connect ( () => { |
1711 | + if (info.active) |
1712 | + tagview.expand (); |
1713 | + else |
1714 | + tagview.collapse (); |
1715 | + }); |
1716 | + |
1717 | + //fullscreen on maximize |
1718 | + this.mainwindow.window_state_event.connect ( (e) => { |
1719 | + if (!((e.window.get_state () & Gdk.WindowState.MAXIMIZED) == 0) && !this.fullscreened){ |
1720 | + this.mainwindow.fullscreen (); |
1721 | + this.fullscreened = true; |
1722 | + toolbar.insert (unfullscreen, 4); |
1723 | + unfullscreen.show_all (); |
1724 | + return true; |
1725 | + } |
1726 | + return false; |
1727 | + }); |
1728 | + |
1729 | + //positioning |
1730 | + this.just_opened = true;int old_h=0, old_w=0; |
1731 | + this.mainwindow.size_allocate.connect ( () => { |
1732 | + if (this.mainwindow.get_allocated_width () != old_w || |
1733 | + this.mainwindow.get_allocated_height () != old_h){ |
1734 | + this.place (); |
1735 | + old_w = this.mainwindow.get_allocated_width (); |
1736 | + old_h = this.mainwindow.get_allocated_height (); |
1737 | + } |
1738 | + return; |
1739 | + }); |
1740 | + |
1741 | + this.mainwindow.show_all (); |
1742 | + |
1743 | + /*DnD*/ |
1744 | + Gtk.TargetEntry uris = {"text/uri-list", 0, 0}; |
1745 | + Gtk.drag_dest_set (this.mainwindow, |
1746 | + Gtk.DestDefaults.ALL, {uris}, Gdk.DragAction.MOVE); |
1747 | + this.mainwindow.drag_data_received.connect ( (ctx, x, y, sel, info, time) => { |
1748 | + for (var i=0;i<sel.get_uris ().length; i++) |
1749 | + this.tagview.add_play_item (sel.get_uris ()[i]); |
1750 | + this.open_file (sel.get_uris ()[0]); |
1751 | + this.toggle_play (true); |
1752 | + }); |
1753 | + } |
1754 | + |
1755 | + private void toggle_play (bool start){ |
1756 | + Gst.State state; |
1757 | + canvas.get_pipeline ().get_state (out state, null, 0); |
1758 | + if (!start){ |
1759 | + toolbar.remove (this.pause); |
1760 | + toolbar.insert (this.play, 0); |
1761 | + play.show_all (); |
1762 | + canvas.get_pipeline ().set_state (Gst.State.PAUSED); |
1763 | + Source.remove (this.hiding_timer); |
1764 | + }else{ |
1765 | + if (this.reached_end){ |
1766 | + canvas.progress = 0.0; |
1767 | + this.reached_end = false; |
1768 | + } |
1769 | + canvas.get_pipeline ().set_state (Gst.State.PLAYING); |
1770 | + toolbar.remove (this.play); |
1771 | + toolbar.insert (this.pause, 0); |
1772 | + pause.show_all (); |
1773 | + this.place (); |
1774 | + Source.remove (this.hiding_timer); |
1775 | + this.hiding_timer = GLib.Timeout.add (2000, () => { |
1776 | + this.mainwindow.get_window ().set_cursor (blank_cursor); |
1777 | + float y2 = this.stage.height; |
1778 | + this.bar.animate (Clutter.AnimationMode.EASE_OUT_QUAD, 1000, y:y2); |
1779 | + return false; |
1780 | + }); |
1781 | + } |
1782 | + this.place (); |
1783 | + } |
1784 | + |
1785 | + private void toggle_fullscreen (){ |
1786 | + if (fullscreened){ |
1787 | + this.mainwindow.unmaximize (); |
1788 | + this.mainwindow.unfullscreen (); |
1789 | + this.fullscreened = false; |
1790 | + this.toolbar.remove (this.unfullscreen); |
1791 | + }else{ |
1792 | + this.mainwindow.fullscreen (); |
1793 | + this.toolbar.insert (this.unfullscreen, 3); |
1794 | + this.unfullscreen.show_all (); |
1795 | + this.fullscreened = true; |
1796 | + } |
1797 | + } |
1798 | + |
1799 | + internal void open_file (string filename){ |
1800 | + var uri = File.new_for_commandline_arg (filename).get_uri (); |
1801 | + canvas.uri = uri; |
1802 | + canvas.audio_volume = 1.0; |
1803 | + this.just_opened = true; |
1804 | + previewer.uri = uri; |
1805 | + previewer.audio_volume = 0.0; |
1806 | + |
1807 | + mainwindow.title = get_basename (uri); |
1808 | + mainwindow.title = mainwindow.title.replace ("%20", " "). |
1809 | + replace ("%5B", "[").replace ("%5D", "]").replace ("%7B", "{"). |
1810 | + replace ("%7D", "}").replace ("_", " ").replace ("."," ").replace (" "," "); |
1811 | + tagview.get_tags (uri, true); |
1812 | + |
1813 | + play.sensitive = true; |
1814 | + |
1815 | + Timeout.add (100, () => {this.place ();return false;}); |
1816 | + |
1817 | + this.toggle_play (true); |
1818 | + } |
1819 | + |
1820 | + private void place (){ |
1821 | + this.tagview.height = stage.height; |
1822 | + this.tagview.x = (this.tagview.expanded)?stage.width-this.tagview.width:stage.width; |
1823 | + |
1824 | + var tb_height = 56; |
1825 | + this.bar.width = stage.width; |
1826 | + this.bar.y = stage.height - tb_height; |
1827 | + this.bar.height = tb_height; |
1828 | + this.bar.x = 0; |
1829 | + toolbar.width_request = (int)this.bar.width; |
1830 | + toolbar.height_request = tb_height; |
1831 | + |
1832 | + //aspect ratio handling |
1833 | + if (this.just_opened && canvas.width == 0.0f){ |
1834 | + return; |
1835 | + }else if (just_opened){ |
1836 | + canvas.get_base_size (out video_w, out video_h); |
1837 | + this.just_opened = false; |
1838 | + } |
1839 | + if (stage.width > stage.height){ |
1840 | + this.canvas.height = stage.height; |
1841 | + this.canvas.width = stage.height / video_h * video_w; |
1842 | + this.canvas.x = (stage.width - this.canvas.width) / 2.0f; |
1843 | + this.canvas.y = 0.0f; |
1844 | + }else{ |
1845 | + this.canvas.width = stage.width; |
1846 | + this.canvas.height = stage.width / video_w * video_h; |
1847 | + this.canvas.y = (stage.height - this.canvas.height) / 2.0f; |
1848 | + this.canvas.x = 0.0f; |
1849 | + } |
1850 | + } |
1851 | + |
1852 | + //the application started |
1853 | + public override void activate (){ |
1854 | + |
1855 | + } |
1856 | + |
1857 | + //the application was requested to open some files |
1858 | + public override void open (File [] files, string hint){ |
1859 | + for (var i=0;i<files.length;i++) |
1860 | + this.tagview.add_play_item (files[i].get_path ()); |
1861 | + this.open_file (files[0].get_path ()); |
1862 | + } |
1863 | + } |
1864 | +} |
1865 | + |
1866 | +public static void main (string [] args){ |
1867 | + Gtk.init (ref args); |
1868 | + GtkClutter.init (ref args); |
1869 | + ClutterGst.init (ref args); |
1870 | + |
1871 | + var app = new Audience.AudienceApp (); |
1872 | + |
1873 | + app.run (args); |
1874 | +} |
1875 | + |
Tom, the controls should not autohide when no video is being played and when playback is paused. After this, your code will be ready to be merged :)