[gnac] Code cleanup
- From: David Joaquim <djoaquim src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac] Code cleanup
- Date: Wed, 9 Jun 2010 19:43:13 +0000 (UTC)
commit de935852061d92de718f62eda01caad711234fb2
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date: Fri May 28 00:21:35 2010 +0100
Code cleanup
.gitignore | 1 +
ChangeLog | 2747 +-------------------------
INSTALL | 114 +-
Makefile.am | 13 +
NEWS | 4 +-
autogen.sh | 2 +-
libgnac/libgnac-converter.c | 4 +-
libgnac/libgnac-converter.h | 3 +-
libgnac/libgnac-debug.c | 2 +-
libgnac/libgnac-debug.h | 14 +-
libgnac/libgnac-error.c | 2 +-
libgnac/libgnac-error.h | 8 +-
libgnac/libgnac-gst-utils.c | 2 +-
libgnac/libgnac-gst-utils.h | 32 +-
libgnac/libgnac-gst.c | 4 +-
libgnac/libgnac-gst.h | 14 +-
libgnac/libgnac-marshallers.c | 3 +-
libgnac/libgnac-marshallers.h | 41 +-
libgnac/libgnac-media-item.c | 4 +-
libgnac/libgnac-media-item.h | 37 +-
libgnac/libgnac-metadata-tags.h | 2 +-
libgnac/libgnac-metadata.c | 2 +-
libgnac/libgnac-metadata.h | 2 +-
libgnac/libgnac-output.c | 2 +-
libgnac/libgnac-output.h | 24 +-
libgnac/libgnac-profile.h | 4 +-
po/ChangeLog | 179 --
src/Makefile.am | 1 -
src/gnac-bars.c | 2 +-
src/gnac-bars.h | 6 +-
src/gnac-file-list.c | 9 +-
src/gnac-file-list.h | 10 +-
src/gnac-gconf.c | 5 +-
src/gnac-gconf.h | 23 +-
src/gnac-main.c | 118 +-
src/gnac-main.h | 17 +-
src/gnac-options.c | 5 +-
src/gnac-options.h | 5 +-
src/gnac-playlist.c | 2 +-
src/gnac-playlist.h | 6 +-
src/gnac-prefs.c | 2 +-
src/gnac-prefs.h | 6 +-
src/gnac-properties.c | 2 +-
src/gnac-properties.h | 16 +-
src/gnac-stock-items.c | 2 +-
src/gnac-stock-items.h | 6 +-
src/gnac-ui.c | 40 +-
src/gnac-ui.h | 7 +-
src/gnac-utils.c | 2 +-
src/gnac-utils.h | 6 +-
src/gnac.h | 31 -
src/profiles/formats/gnac-profiles-aac.c | 122 +-
src/profiles/formats/gnac-profiles-aac.h | 16 +-
src/profiles/formats/gnac-profiles-flac.c | 54 +-
src/profiles/formats/gnac-profiles-flac.h | 16 +-
src/profiles/formats/gnac-profiles-lame.c | 417 +++--
src/profiles/formats/gnac-profiles-lame.h | 36 +-
src/profiles/formats/gnac-profiles-speex.c | 392 +++--
src/profiles/formats/gnac-profiles-speex.h | 32 +-
src/profiles/formats/gnac-profiles-unknown.c | 108 +-
src/profiles/formats/gnac-profiles-unknown.h | 18 +-
src/profiles/formats/gnac-profiles-vorbis.c | 201 ++-
src/profiles/formats/gnac-profiles-vorbis.h | 24 +-
src/profiles/formats/gnac-profiles-wav.c | 29 +-
src/profiles/formats/gnac-profiles-wav.h | 15 +-
src/profiles/formats/gnac-profiles-wavpack.c | 289 ++--
src/profiles/formats/gnac-profiles-wavpack.h | 28 +-
src/profiles/gnac-profiles-default.c | 179 +-
src/profiles/gnac-profiles-default.h | 59 +-
src/profiles/gnac-profiles-manager.c | 696 ++++---
src/profiles/gnac-profiles-manager.h | 66 +-
src/profiles/gnac-profiles-properties.c | 571 +++---
src/profiles/gnac-profiles-properties.h | 42 +-
src/profiles/gnac-profiles-utils.c | 669 ++++---
src/profiles/gnac-profiles-utils.h | 190 ++-
src/profiles/gnac-profiles-xml-engine.c | 298 ++--
src/profiles/gnac-profiles-xml-engine.h | 63 +-
src/profiles/gnac-profiles.c | 118 +-
src/profiles/gnac-profiles.h | 6 +-
79 files changed, 3159 insertions(+), 5190 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b9e6b72..b5786bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
".guess
*.m4
*~
+*.swp
Makefile
compile
config.guess
diff --git a/ChangeLog b/ChangeLog
index 922290e..fb6567e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,2745 +1,4 @@
-2009-07-14 17:28 bdupasqu
-
- * src/gnac-ui.c: - Update the trayicon's popup menu (Show/Hide)
- depending on the visibility of the main window.
-
-2009-07-14 17:13 bdupasqu
-
- * libgnac/libgnac-converter.c, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-main.c, src/gnac-ui.c: - Don't
- print error messages when the user has chosen not to overwrite a
- file (display rather a GTK_STOCK_DIALOG_INFO).
- - Update the trayicon's tooltip even if it is currently
- displayed.
-
-2009-07-14 06:59 bdupasqu
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-marshallers.c, libgnac/libgnac-marshallers.h,
- src/gnac-file-list.c, src/gnac-main.c: - Better error handling:
- display a dialog when the destination file already
- exists.
-
-2009-07-14 06:55 bdupasqu
-
- * src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-speex.h,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/formats/gnac-profiles-wavpack.h: - Set the svn
- keyword 'Id' on all headers files in src/profiles/formats.
-
-2009-07-09 16:46 bdupasqu
-
- * src/gnac-main.c, src/gnac-ui.c: - Disable the 'APE' filter (the
- Monkey's Audio plug-in has not yet been
- ported to gstreamer-0.10)
-
-2009-07-08 20:57 bdupasqu
-
- * data/gnac-properties-window.xml, libgnac/libgnac-metadata.c,
- src/gnac-properties.c, src/gnac-ui.c, src/gnac-utils.c,
- src/gnac-utils.h: - Fix a bug preventing the tooltip to be
- displayed when a tag contains
- special characters (e.g. '&'),
- - Move the rescaling of images from libgnac-metadata to
- gnac-utils,
- - Add a border to images (trayicon's tooltip, properties window).
-
-2009-07-07 22:15 bdupasqu
-
- * src/gnac-main.c, src/gnac-prefs.c, src/gnac-ui.c, src/gnac-ui.h:
- - Use GtkTooltip to display fancy tooltips on the trayicon.
-
-2009-07-07 20:30 bdupasqu
-
- * data/gnac-pref-window.xml, src/gnac-gconf.c, src/gnac-prefs.c,
- src/gnac-properties.c: - Fix a bug in the handling of
- GNAC_GCONF_FOLDER_TYPE.
- - Ensure the preferences window always starts with the 'General'
- tab selected.
-
-2009-06-30 10:33 bdupasqu
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c:
- Change the shape of the cursor during conversion and file
- addition (only on
- the tree view).
-
-2009-06-24 10:22 bdupasqu
-
- * src/gnac-main.c, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac-utils.c, src/gnac-utils.h: Code refactoring.
-
-2009-06-17 13:32 daiji
-
- * data/gnac.xml, src/gnac-file-list.c: Add accelerators to main
- interface
-
-2009-06-08 06:38 bdupasqu
-
- * data/gnac-pref-window.xml, data/gnac.schemas.in, data/gnac.xml,
- libgnac/libgnac-converter.c, libgnac/libgnac-metadata-tags.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h,
- libgnac/libgnac-output.c, libgnac/libgnac-output.h,
- src/gnac-gconf.c, src/gnac-gconf.h, src/gnac-main.c,
- src/gnac-prefs.c, src/gnac-prefs.h, src/gnac-ui.c: Modification
- of the preferences window to handle custom patterns.
-
-2009-05-31 20:53 bdupasqu
-
- * data/Makefile.am: Modify data/Makefile.am to ensure compatibility
- with gentoo ebuilds
- (thanks to Christian Ludwig for the patch).
-
-2009-05-29 14:56 bdupasqu
-
- * libgnac/libgnac-output.c, src/gnac-main.c, src/gnac-prefs.c:
- Handle properly the case when the output pattern is unspecified
- (keep the original filename, but replace the extension).
-
-2009-05-25 14:48 bdupasqu
-
- * libgnac/libgnac-output.c: Sanitize filenames before creating
- files.
-
-2009-05-25 07:07 bdupasqu
-
- * libgnac/libgnac-metadata-tags.h, libgnac/libgnac-metadata.c,
- libgnac/libgnac-metadata.h, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, m4/intltool.m4: Add code to handle
- customized rename patterns (e.g. to create a subfolder
- hierarchy (artist/album)).
-
-2009-05-08 15:11 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-metadata-tags.h,
- src/gnac-properties.c: Backported bugfix from branch gnac-video.
- Add display of replaygain values, track gain and peak
-
-2009-04-09 07:47 daiji
-
- * po/de.po: Forgot to add de.po
-
-2009-04-09 07:42 daiji
-
- * po/LINGUAS, po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po,
- po/ro.po, po/sv.po: Add incomplete german translation, Thanks to
- Martin Lettner
-
-2009-04-08 08:12 bdupasqu
-
- * configure.ac, src/gnac-main.c: On the road to gnac-0.2.1!
- Make the links in the about box clickable.
-
-2009-04-06 17:13 bdupasqu
-
- * configure.ac, src/gnac-main.c: Make distcheck now also generates
- a .tar.gz.
-
-2009-04-05 13:45 daiji
-
- * ChangeLog, po/POTFILES.in: Update Changelog and POTFILES.in
-
-2009-04-05 12:28 daiji
-
- * po/he.po, po/it.po, po/ro.po: Update romanian and italian
- translations
-
-2009-04-05 10:34 daiji
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po: Add plural support in translation files
-
-2009-04-05 10:25 daiji
-
- * po/fr.po: Fix french translation
-
-2009-04-05 09:53 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c: - correct a segfault
- - improve file import
-
-2009-04-03 21:08 daiji
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-main.c, src/gnac-ui.c: Fix translation issues.
- Thanks to Lubos, again!
-
-2009-04-03 20:06 daiji
-
- * po/sv.po: Update translation
-
-2009-04-03 19:22 alexandreroux
-
- * src/gnac-main.c, src/gnac-properties.c: Center properties and
- file-chooser windows
-
-2009-04-03 17:59 bdupasqu
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po: Translations updated (freezed for gnac-0.2).
-
-2009-04-03 09:43 daiji
-
- * data/gnac.xml, src/gnac-file-list.c: Fix a display bug
-
-2009-04-03 09:23 daiji
-
- * libgnac/libgnac-converter.c: Fix clear bug correctly this time!
-
-2009-04-03 08:37 daiji
-
- * libgnac/libgnac-converter.c, src/gnac-file-list.c: Fix clear bug
-
-2009-04-03 08:16 alexandreroux
-
- * src/gnac-main.c: Count only filtered files while adding
-
-2009-04-03 06:59 bdupasqu
-
- * ChangeLog, src/gnac-main.c: Reset the statusbar when clear has
- been hit.
-
-2009-04-02 19:06 alexandreroux
-
- * src/gnac-main.c, src/gnac-ui.c: Add current number of added
- files...
-
-2009-04-02 17:58 alexandreroux
-
- * src/gnac-main.c, src/gnac-ui.c: Exit gracefully while
- importing...
-
-2009-04-02 08:12 daiji
-
- * src/gnac-main.c: Fix a stupid piece of code
-
-2009-04-01 21:20 daiji
-
- * src/gnac-file-list.c: Remove previous introduced bug.
- Clean some code
-
-2009-04-01 21:12 alexandreroux
-
- * src/gnac-file-list.c, src/gnac-utils.c, src/gnac-utils.h: Memory
- leaks with GtkListStore!
-
-2009-04-01 20:15 daiji
-
- * src/gnac-file-list.c: Improve file count from O(n) to O(1)
-
-2009-04-01 20:06 alexandreroux
-
- * src/gnac-main.c: cancel implemented
-
-2009-04-01 19:44 alexandreroux
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c:
- detach the model while adding files...speed increase -> 33%
-
-2009-04-01 18:45 daiji
-
- * src/gnac-bars.c, src/gnac-file-list.c, src/gnac-file-list.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c, src/gnac-ui.h:
- Add a state machine do deal with GUI
- pulse using main_loop
- disconnect row-deleted signal during file clear
-
-2009-04-01 07:07 bdupasqu
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-metadata.c,
- src/gnac-bars.c: Correct a bug thcausing a SEGV (on corrupted
- files).
-
-2009-03-31 14:37 alexandreroux
-
- * data/profiles/base.xml.in, src/gnac-bars.c, src/gnac-bars.h,
- src/gnac-main.c, src/gnac-ui.c, src/gnac-ui.h: First approach for
- the asynchrony(?) add of files
- Still todo:
- - Correctly block the non-wanted user actions while importing (so
- set
- unsensitive the rights button, etc.)
- - Implement the same to the remove/clear actions
- - Find clear bug
-
-2009-03-30 19:37 bdupasqu
-
- * libgnac/libgnac-converter.c: Delete the (partial) destination
- file, if the conversion couldn't end up nicely.
-
-2009-03-30 16:54 bdupasqu
-
- * libgnac/libgnac-converter.c: Correct an error in a message.
-
-2009-03-29 08:49 daiji
-
- * po/cs.po: update cs translation
-
-2009-03-27 15:45 bdupasqu
-
- * src/gnac-main.c: Restore default filter when drag'n'dropping
- files (otherwise it might be difficult to understand why a dnd is
- not successful).
-
-2009-03-27 12:37 bdupasqu
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-playlist.c: Bug fixes in gnac-playlist.
-
-2009-03-27 07:53 bdupasqu
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/Makefile.am, src/gnac-main.c, src/gnac-playlist.c,
- src/gnac-properties.c: Remove duplicate code causing warnings in
- src/Makefile.am
-
-2009-03-26 17:33 bdupasqu
-
- * ChangeLog, libgnac/libgnac-metadata-tags.h,
- libgnac/libgnac-metadata.c, po/cs.po, po/fr.po, po/gnac.pot,
- po/he.po, po/it.po, po/ro.po, po/sv.po, src/gnac-properties.c:
- Code refactoring.
-
-2009-03-26 14:06 bdupasqu
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-utils.c, src/gnac-utils.h: Code refactoring.
-
-2009-03-26 07:47 bdupasqu
-
- * po/cs.po, po/fr.po, po/gnac.pot, po/he.po, po/it.po, po/ro.po,
- po/sv.po: Update translations.
-
-2009-03-26 07:46 bdupasqu
-
- * libgnac/libgnac-converter.c: Prevent the remaining time to get
- crazy when dealing with unexpected situations.
-
-2009-03-25 22:17 daiji
-
- * po/gnac.pot: Add gnac.pot to point directly from the website
-
-2009-03-25 22:16 daiji
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Edit
- translations
-
-2009-03-25 22:15 daiji
-
- * data/gnac.schemas.in, src/gnac-gconf.c, src/gnac-gconf.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c: Remember last
- used profile
-
-2009-03-25 20:30 alexandreroux
-
- * src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: Add
- two fonctions to get and set current profile name.
-
-2009-03-25 13:29 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/gnac-ui.c: Code refactoring.
-
-2009-03-25 08:29 bdupasqu
-
- * ChangeLog: Use 'gnac_bars_activate' to make the pause menu item
- invisible.
-
-2009-03-25 08:27 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Use
- 'gnac_bars_activate' to make the pause menu item invisible.
-
-2009-03-25 08:25 bdupasqu
-
- * ChangeLog, libgnac/libgnac-metadata.c, src/gnac-bars.c,
- src/gnac-ui.c: Make use of the existing function.
-
-2009-03-25 08:20 daiji
-
- * src/gnac-ui.c: Hide pause menuitem when needed
-
-2009-03-24 23:34 alexandreroux
-
- * src/Makefile.am, src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-speex.c,
- src/profiles/formats/gnac-profiles-speex.h,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/formats/gnac-profiles-wavpack.h,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-properties.c: - Remove dll and use
- static stuff instead...
- - No gstreamer verification is done for format, i.e. all profile
- are displayed
- even if the format is not supported by the gestreamer setup
-
-2009-03-24 21:38 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.c,
- src/gnac-main.c, src/gnac-properties.c: Create metadata
- information only once during gnac execution.
-
-2009-03-24 19:30 daiji
-
- * src/gnac-main.c, src/gnac-ui.c, src/gnac-ui.h: Do not display
- pause button when no conversion is running
-
-2009-03-24 18:11 bdupasqu
-
- * ChangeLog, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-bars.c, src/gnac-main.c, src/gnac-ui.c,
- src/gnac-ui.h: Update the statusbar when the conversion is
- paused.
-
-2009-03-24 17:43 bdupasqu
-
- * src/gnac-ui.c: Change some spacing to conform to the GNOME
- standard.
-
-2009-03-24 17:27 bdupasqu
-
- * po/POTFILES.in, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/Makefile.am, src/gnac-bars.c,
- src/gnac-stock-items.c, src/gnac-stock-items.h, src/gnac-ui.c:
- Add a new stock item (resume).
-
-2009-03-24 15:49 bdupasqu
-
- * data/gnac.xml, libgnac/libgnac-converter.c,
- libgnac/libgnac-converter.h, libgnac/libgnac-gst.c,
- libgnac/libgnac-gst.h, po/cs.po, po/fr.po, po/he.po, po/it.po,
- po/ro.po, po/sv.po, src/gnac-bars.c, src/gnac-bars.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c, src/gnac-ui.h:
- Add the possibility to pause/resume a conversion.
-
-2009-03-23 10:47 bdupasqu
-
- * libgnac/libgnac-converter.c: Bug in the remaining time corrected.
-
-2009-03-23 08:06 bdupasqu
-
- * AUTHORS, ChangeLog, README, THANKS, data/Makefile.am,
- libgnac/libgnac-converter.c, src/gnac-main.c, src/gnac-utils.c,
- src/gnac-utils.h: Code refactoring.
-
-2009-03-23 07:56 daiji
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Try
- to correct some bugs
-
-2009-03-22 23:04 daiji
-
- * po/cs.po: Update Czech translation
-
-2009-03-22 22:57 daiji
-
- * po/cs.po: Fix CR+LFs bug
-
-2009-03-22 09:40 daiji
-
- * src/gnac-main.c, src/gnac-utils.c, src/gnac-utils.h: Move some
- utility code
-
-2009-03-22 09:03 daiji
-
- * data/profiles/gnac-profiles-speex.xml,
- data/profiles/gnac-profiles-wavpack.xml, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po: Translations updates
-
-2009-03-21 22:10 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po:
- Translations updated.
-
-2009-03-21 22:06 bdupasqu
-
- * src/gnac-main.c, src/gnac-ui.c: Remove a useless (!) piece of
- code causing a segmentation fault.
- Fix a memory leak.
-
-2009-03-21 21:49 daiji
-
- * po/cs.po: Update Czech translation
-
-2009-03-21 21:44 bdupasqu
-
- * ChangeLog, src/gnac-main.c: Prevent arithmetic/floating point
- exception on progressbar update.
-
-2009-03-21 20:57 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- src/gnac-main.c, src/gnac-utils.c: Compute estimated time left
- using a moving average
-
-2009-03-21 19:04 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po:
- Translations updated.
-
-2009-03-21 18:58 bdupasqu
-
- * libgnac/libgnac-metadata.c: If there is only one image tagged,
- and its type is undefined, display it anyway.
-
-2009-03-21 18:54 bdupasqu
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-metadata-tags.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h,
- src/gnac-main.c, src/gnac-properties.c: Update the progressbar
- according to the length (duration) of the files.
-
-2009-03-20 21:53 daiji
-
- * data/Makefile.am, src/profiles/gnac-profiles-manager.c: Fix some
- translation issues (Thanks to Lubos Stanek)
-
-2009-03-20 13:33 daiji
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po:
- Update romanian and italian translations
-
-2009-03-18 08:36 bdupasqu
-
- * ChangeLog, libgnac/libgnac-converter.c, src/gnac-main.c,
- src/gnac-properties.c, src/gnac-ui.c, src/gnac-utils.c,
- src/gnac-utils.h: Move 'format_duration_for_display' in
- gnac-utils.c
-
-2009-03-17 22:47 daiji
-
- * libgnac/libgnac-converter.c: Add some duration code
-
-2009-03-17 19:19 daiji
-
- * libgnac/libgnac-converter.c: Add total duration computation
- basecode
-
-2009-03-17 19:15 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-metadata-tags.h, libgnac/libgnac-metadata.c,
- libgnac/libgnac-metadata.h, libgnac/libgnac-output.c, po/cs.po,
- po/fr.po, po/he.po, po/it.po, po/ro.po: Add metadata to
- LibgnacItems, load it automatically
- Move metadata output code
-
-2009-03-17 15:49 daiji
-
- * po/sv.po: Updated swedish translation
-
-2009-03-17 13:08 daiji
-
- * libgnac/libgnac-converter.c, po/cs.po, po/fr.po, po/he.po,
- po/it.po, po/ro.po, po/sv.po: Fix a bug when deleting file from
- GtkTreeView
-
-2009-03-17 12:52 bdupasqu
-
- * NEWS, libgnac/libgnac-converter.c, src/gnac-main.c: Update NEWS
- file.
-
-2009-03-16 10:06 daiji
-
- * libgnac/libgnac-converter.c, src/gnac-main.c, src/gnac-ui.c,
- src/gnac-ui.h: Fix a Segv
- Fix some mistakes
- Add example code
-
-2009-03-16 09:12 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-marshallers.c,
- libgnac/libgnac-marshallers.h, libgnac/libgnac-output.h,
- src/gnac-main.c: Complete progress signal for further uses
- Add a file-nb property to libgnac-converter
-
-2009-03-14 10:16 daiji
-
- * libgnac/libgnac-converter.c, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-main.c: Convert files in display
- order
- Current converted file is selected
-
-2009-03-12 13:15 alexandreroux
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po:
- correct a problem in md5 description
-
-2009-03-12 12:51 daiji
-
- * src/gnac-main.c: Wrong directory commit
-
-2009-03-12 12:41 daiji
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Fix
- status message when errors occured
-
-2009-03-12 09:51 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c: - Mask status on selection
- changed
-
-2009-03-12 09:43 daiji
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c: *
- Live from multimedia doc course *
- Hide error column when not needed
-
-2009-03-12 09:04 bdupasqu
-
- * ChangeLog, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-main.c: Add a linebreak after an error
- message.
-
-2009-03-12 07:49 daiji
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- libgnac/libgnac-converter.c, po/cs.po, po/fr.po, po/he.po,
- po/it.po, po/ro.po, po/sv.po: Some esthethic changes
- fix a translation
-
-2009-03-12 00:07 alexandreroux
-
- * configure.ac, data/profiles/Makefile.am,
- data/profiles/aac.xml.in, data/profiles/default,
- data/profiles/default/CD_Quality,_AAC.xml.in,
- data/profiles/default/CD_Quality,_Lossless.xml.in,
- data/profiles/default/CD_Quality,_Lossy.xml.in,
- data/profiles/default/CD_Quality,_MP3.xml.in,
- data/profiles/default/Makefile.am,
- data/profiles/default/Voice,_Lossless.xml.in,
- data/profiles/default/Voice,_Lossy.xml.in,
- data/profiles/flac.xml.in, data/profiles/gnac-profiles-aac.xml,
- data/profiles/mp3-lame.xml.in, data/profiles/speex.xml.in,
- data/profiles/vorbis.xml.in, data/profiles/wavpack.xml.in,
- po/POTFILES.in, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-speex.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h: -Add support for default
- profiles
- -Add two options for aac
- -Improve descriptions
-
-2009-03-11 20:12 alexandreroux
-
- * src/profiles/formats/gnac-profiles-speex.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c: fix description and speex segfault.
- Add special xml chars (<>&) conversion support
-
-2009-03-11 10:09 bdupasqu
-
- * ChangeLog, libgnac/libgnac-converter.c,
- libgnac/libgnac-converter.h, libgnac/libgnac-debug.c,
- libgnac/libgnac-debug.h, libgnac/libgnac-error.c,
- libgnac/libgnac-error.h, libgnac/libgnac-gst.c,
- libgnac/libgnac-gst.h, libgnac/libgnac-marshallers.c,
- libgnac/libgnac-marshallers.h, libgnac/libgnac-metadata-tags.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h,
- libgnac/libgnac-output.c, libgnac/libgnac-output.h,
- src/gnac-bars.c, src/gnac-bars.h, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-gconf.c, src/gnac-gconf.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-playlist.c,
- src/gnac-playlist.h, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac-properties.c, src/gnac-properties.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac-utils.c, src/gnac-utils.h, src/gnac.h,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-speex.c,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c: Copyright notice updated.
-
-2009-03-11 09:40 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-error.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-output.c, src/gnac-main.c:
- Fix TODOs that are involved with translations
-
-2009-03-11 08:33 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Clean
- up .po files.
-
-2009-03-11 07:49 bdupasqu
-
- * ChangeLog, libgnac/libgnac-metadata.c, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po: Fix a memory leak.
-
-2009-03-10 21:57 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h: -- add some shortkeys
-
-2009-03-10 20:41 alexandreroux
-
- * data/profiles/gnac-profiles-properties.xml, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles.c: - description/name filtering and
- length check
-
-2009-03-10 16:31 bdupasqu
-
- * data/Makefile.am: Make sure Gnac is registered to handle the
- supported mime types (otherwise, it
- won't appear in the 'open with' menu).
-
-2009-03-10 14:21 daiji
-
- * libgnac/libgnac-converter.c, src/gnac-file-list.c,
- src/gnac-main.c, src/gnac-prefs.c, src/gnac-ui.c: Fix some
- memorxy leaks
- Fix some TODO's
-
-2009-03-10 14:14 bdupasqu
-
- * src/gnac-properties.c: Fix some memory leaks.
-
-2009-03-10 10:56 alexandreroux
-
- * data/profiles/gnac-profiles-aac.xml,
- data/profiles/gnac-profiles-base-advanced.xml,
- data/profiles/gnac-profiles-flac.xml,
- data/profiles/gnac-profiles-lame.xml,
- data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-speex.xml,
- data/profiles/gnac-profiles-unknown.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- data/profiles/gnac-profiles-wav.xml,
- data/profiles/gnac-profiles-wavpack.xml,
- data/profiles/speex.xml.in, po/cs.po, po/fr.po, po/he.po,
- po/it.po, po/ro.po, po/sv.po,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-speex.c,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c, src/profiles/main.c: - some
- bugfixes
- - remove a lot of memory leaks (but impossible to remove leaks
- comming from gst_plugin_load_by_name and
- gtk_builder_add_from_file).
-
-2009-03-10 08:56 bdupasqu
-
- * data/gnac.desktop.in.in: Add supported mime types in
- gnac.desktop.in.in.
- Only open one instance of Gnac when the user selects multiple
- audio files with
- 'open with Gnac'.
-
-2009-03-10 08:55 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: Add
- supported mime types in gnac.desktop.in.in.
- Only open one instance of Gnac when the user selects multiple
- audio files with 'open with Gnac'.
-
-2009-03-10 07:42 bdupasqu
-
- * ChangeLog, configure.ac, libgnac/libgnac-gst.c,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.c,
- src/gnac-main.c, src/gnac-properties.c: Fix some memory leaks.
-
-2009-03-09 08:33 daiji
-
- * src/gnac-main.c: Print help output when command line parsing
- fails
-
-2009-03-08 16:46 daiji
-
- * data/gnac.xml, src/gnac-file-list.c, src/gnac-main.c,
- src/gnac-ui.c: Fix memory leaks
-
-2009-03-08 14:50 alexandreroux
-
- * data/profiles/gnac-profiles-speex.xml:
-
-2009-03-08 14:23 alexandreroux
-
- * data/profiles/Makefile.am,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- data/profiles/speex.xml.in, po/POTFILES.in, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-speex.c: speex support!
-
-2009-03-08 09:06 daiji
-
- * libgnac/libgnac-converter.c, src/gnac-file-list.c,
- src/gnac-main.c, src/gnac-ui.c: Fix some memory leaks. Still
- needs a lot of work
-
-2009-03-07 20:46 daiji
-
- * src/gnac-main.c, src/gnac-prefs.c, src/gnac-properties.c,
- src/gnac-ui.c: Fix some memory leaks
-
-2009-03-06 09:09 bdupasqu
-
- * src/gnac-main.c, src/gnac-main.h: Code refactoring.
-
-2009-03-06 07:35 bdupasqu
-
- * src/gnac-bars.c, src/gnac-file-list.c, src/gnac-file-list.h,
- src/gnac-gconf.c, src/gnac-gconf.h, src/gnac-main.c,
- src/gnac-main.h, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac-properties.c, src/gnac-properties.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac-utils.c, src/gnac-utils.h: Code
- refactoring.
-
-2009-03-05 13:17 daiji
-
- * data/gnac.xml, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po: Fix a english error, thanks to Hadrien
-
-2009-03-05 08:37 bdupasqu
-
- * ChangeLog, data/gnac.xml, src/gnac-bars.h, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-playlist.c, src/gnac-playlist.h,
- src/gnac-properties.c, src/gnac-properties.h, src/gnac-utils.c,
- src/gnac.h: Some code refactoring (useless stuff removed, ...).
-
-2009-03-04 21:26 alexandreroux
-
- * data/profiles/gnac-profiles-properties.xml, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c: - fix regression
- - fix translations bugs
-
-2009-03-04 19:54 daiji
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml: Fix design problems.
- But add a little bug, sorry for that :p
-
-2009-03-04 11:14 bdupasqu
-
- * configure.ac, data/Makefile.am, data/profiles/Makefile.am,
- data/profiles/base.xml, libgnac/Makefile.am, po/POTFILES.in,
- po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/Makefile.am, src/profiles/formats/Makefile.am,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-utils.c: Get rid of all
- gnome-media-profile dependencies.
- Makefiles modified to handle properly the translation of xml
- files.
-
-2009-03-03 21:52 alexandreroux
-
- * data/profiles/gnac-profiles-flac.xml,
- data/profiles/gnac-profiles-lame.xml, po/POTFILES.in, po/cs.po,
- po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c: - more traductions
-
-2009-03-03 20:01 alexandreroux
-
- * data/profiles/Makefile.am, data/profiles/aac.xml,
- data/profiles/aac.xml.in, data/profiles/base.xml,
- data/profiles/base.xml.in, data/profiles/flac.xml,
- data/profiles/flac.xml.in, data/profiles/gnac-profiles-aac.xml,
- data/profiles/gnac-profiles-lame.xml,
- data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-wavpack.xml,
- data/profiles/mp3-lame.xml, data/profiles/mp3-lame.xml.in,
- data/profiles/vorbis.xml, data/profiles/vorbis.xml.in,
- data/profiles/wav.xml, data/profiles/wav.xml.in,
- data/profiles/wavpack.xml, data/profiles/wavpack.xml.in,
- po/POTFILES.in, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/formats/gnac-profiles-wavpack.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c: - add xml translation
- - clean code
- - apply changes with pipeline text-view and format combo
-
- TODO:
-
- - Test pipelines of different formats
- - fix description label bug
- - memory leaks
- - improve format descriptions
-
-2009-03-03 09:43 bdupasqu
-
- * src/gnac-bars.c, src/profiles/gnac-profiles-properties.c: Display
- the pipeline in the profile editor to everyone.
-
-2009-03-02 20:47 bdupasqu
-
- * ChangeLog, libgnac/libgnac-debug.c,
- src/profiles/gnac-profiles-properties.c: Display the pipeline in
- the profiles editor only in debug mode.
- Print debug warnings only in debug mode.
-
-2009-03-02 19:12 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/gnac-main.c, src/gnac-main.h: Confirm the exit when a
- conversion is running.
-
-2009-03-02 07:41 daiji
-
- * data/profiles/wavpack.xml: Add wavpack fromat description
-
-2009-03-01 23:06 alexandreroux
-
- * data/profiles/gnac-profiles-wavpack.xml,
- data/profiles/wavpack.xml,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h: - Wavpack bugfixes
- - add support for checks parameters
-
-2009-03-01 20:15 alexandreroux
-
- * data/profiles/gnac-profiles-aac.xml,
- data/profiles/gnac-profiles-flac.xml,
- data/profiles/gnac-profiles-lame.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- data/profiles/gnac-profiles-wav.xml,
- data/profiles/gnac-profiles-wavpack.xml,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h:
- Some gui changes...
-
-2009-03-01 17:11 daiji
-
- * data/profiles/gnac-profiles-properties.xml: Fix a display bug in
- profile properties when sub panel is too large
-
-2009-03-01 17:07 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c: Sort!
-
-2009-03-01 15:46 alexandreroux
-
- * data/profiles/gnac-profiles-lame.xml, data/profiles/mp3-lame.xml,
- src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-utils.c, src/profiles/gnac-profiles.c:
- - add support for lame-mp3
- - fix a bug with description tooltip on combo
-
-2009-03-01 12:53 alexandreroux
-
- * src/profiles/gnac-profiles-properties.c: Little change in format
- display...hope it will solve the wavpack display
- problem...or not!
-
-2009-02-28 22:33 alexandreroux
-
- * data/profiles/wavpack.xml: Small bugfix with wavpack
-
-2009-02-28 22:19 alexandreroux
-
- * data/profiles/gnac-profiles-wavpack.xml,
- data/profiles/wavpack.xml, src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/formats/gnac-profiles-wavpack.h,
- src/profiles/gnac-profiles-utils.c: Wavpack support!
-
-2009-02-28 19:24 alexandreroux
-
- * src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h: bug fix with flac
-
-2009-02-28 18:37 alexandreroux
-
- * data/profiles/aac.xml, src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-vorbis.c: Support for aac
- format
-
-2009-02-28 18:05 alexandreroux
-
- * data/profiles/flac.xml, data/profiles/gnac-profiles-flac.xml,
- data/profiles/wav.xml, src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-utils.c: - bugfixes
- - custom format at the end
- - add support for flac
-
-2009-02-28 16:35 daiji
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/gnac-properties.c: Add translations in properties
- Fix some erroneous french translations
-
-2009-02-28 16:22 alexandreroux
-
- * data/profiles/vorbis.xml, data/profiles/wav.xml,
- src/profiles/formats/Makefile.am,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-properties.c: - fix a bug when plugin
- was not found
- - add support for wav
-
-2009-02-28 15:46 alexandreroux
-
- * data/profiles/gnac-profiles-unknown.xml,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h: - some bugfixes
- - status message showed only when necessary
- - remove use of hash_table (use only gtkbuidler)
-
- TODO:
- - Integreate other plugins
- - xml file translation
-
-2009-02-28 14:19 daiji
-
- * data/gnac-properties-window.xml,
- data/profiles/gnac-profiles-combo.xml, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po, src/gnac-main.c,
- src/gnac-main.h: Fix some translation issues
- Fix a static issue
-
-2009-02-28 13:55 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles.c: - properties window resize when
- expander is expanded/unexpanded
- - description tootlip
-
- TODO:
- - remove hashtable in profiles --> use only gtk_builder
- - remove status when not necessary
- - add other profiles
-
-2009-02-28 13:49 daiji
-
- * po/fr.po: Correct an error in email address
-
-2009-02-28 13:45 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-gst.c,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.c, po/cs.po,
- po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po: remove all
- translated debug messages
- update some translations
- Add Alexandre as translator :p
-
-2009-02-28 13:18 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- src/gnac-bars.c, src/gnac-file-list.c, src/gnac-file-list.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-properties.c, src/gnac-ui.c: Clean
- code, move many function and variables to static ones
-
-2009-02-28 11:43 daiji
-
- * data/gnac-properties-window.xml, libgnac/libgnac-debug.c,
- src/gnac-main.c, src/gnac-properties.c: Fix a little memory leak
- Fix error introduced in a commit yesterday
- Stop resizing property window when there is no front cover
-
-2009-02-28 11:41 alexandreroux
-
- * data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c: - bugfixes for the
- vorbis format
- - some checks added (empty name, empty extension
-
-2009-02-28 09:36 daiji
-
- * data/gnac-properties-window.xml, libgnac/libgnac-output.c: Fix a
- bug that creates wrong filenames
- Block the size of the peoperty window
-
-2009-02-27 22:48 daiji
-
- * data/gnac-properties-window.xml, src/gnac-properties.c,
- src/gnac-properties.h: Handle gracefully missing information in
- properties GtkTreeView
-
- Unfortunately many warnings appears with g_value_get_..
-
-2009-02-27 20:14 daiji
-
- * libgnac/libgnac-debug.c, libgnac/libgnac-debug.h: Add two message
- logging convenient functions:
-
-2009-02-27 10:34 bdupasqu
-
- * src/profiles/formats/Makefile.am: The integration of the profiles
- should work now.
-
-2009-02-27 09:53 bdupasqu
-
- * data/Makefile.am, data/profiles/Makefile.am,
- src/profiles/formats/Makefile.am: Bug in the Makefiles corrected.
-
-2009-02-27 09:40 bdupasqu
-
- * data/Makefile.am, data/profiles/Makefile.am, libgnac/Makefile.am,
- po/POTFILES.in, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po, src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c,
- src/gnac-ui.h: Makefiles modified in order to successfully pass
- make-distcheck.
- Some code refactoring.
-
-2009-02-27 09:31 alexandreroux
-
- * src/profiles/formats/Makefile.am: plugins ok now...
-
-2009-02-27 08:43 bdupasqu
-
- * po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/Makefile.am, src/profiles/formats/Makefile.am: Some
- corrections in the Makefiles.
-
-2009-02-27 00:43 alexandreroux
-
- * data/gnac.xml, src/gnac-main.c, src/gnac-ui.c,
- src/profiles/Makefile, src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: it
- works! :-D
-
-2009-02-26 23:31 daiji
-
- * configure.ac, src/gnac-main.c, src/gnac-ui.c,
- src/profiles/Makefile: First profile integration, still some bugs
-
-2009-02-26 22:03 alexandreroux
-
- * src/Makefile.am, src/profiles/Makefile,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/gnac-profiles-properties.c: Adding support for
- shared object libraries in autotools
-
-2009-02-26 21:35 alexandreroux
-
- * data/profiles/vorbis.xml, src/Makefile.am, src/profiles/Makefile,
- src/profiles/gnac-profiles-properties.c:
-
-2009-02-26 21:14 bdupasqu
-
- * ChangeLog, configure.ac, data/Makefile.am,
- data/profiles/Makefile.am, src/Makefile.am, src/gnac-main.c,
- src/gnac-ui.c, src/profiles/Makefile, src/profiles/Makefile.am,
- src/profiles/formats/Makefile.am,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles.c: With all the files, it usually
- works better...
-
-2009-02-26 20:57 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-output.c: Fix an
- annoying memory bug, thanks to Valgrind
-
-2009-02-26 19:08 alexandreroux
-
- * src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c:
-
-2009-02-26 19:03 daiji
-
- * configure.ac, libgnac/libgnac-error.h: Add a new error
- Add new configure.ac modules
-
-2009-02-26 14:41 bdupasqu
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-debug.c, libgnac/libgnac-debug.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-gst.h,
- libgnac/libgnac-marshallers.c, libgnac/libgnac-marshallers.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, po/cs.po, po/fr.po, po/he.po, po/it.po,
- po/ro.po, po/sv.po, src/gnac-bars.c, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-gconf.c, src/gnac-gconf.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-properties.c, src/gnac-properties.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac-utils.c: All files in libgnac/ now use
- libgnac-debug.h.
- Some code refactoring.
- Error message internationalized.
-
-2009-02-26 13:12 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-gst.c,
- libgnac/libgnac-output.c, src/gnac-main.c: Improve debugging
- output
- Improve GUI error messages
-
-2009-02-26 08:05 bdupasqu
-
- * libgnac/libgnac-metadata.c, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h: Buf fixes and code refactoring.
-
-2009-02-25 23:33 alexandreroux
-
- * data/profiles/gnac-profiles-unknown.xml, src/profiles/Makefile,
- src/profiles/formats/gnac-profiles-unknown.c,
- src/profiles/formats/gnac-profiles-unknown.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-properties.c: Add support for custom
- format...
-
-2009-02-25 21:08 daiji
-
- * src/gnac-properties.c: Fix empty GtkSpinButtons showing 0 when
- opening properties window
-
-2009-02-25 20:08 daiji
-
- * data/gnac-pref-window.xml, data/gnac-properties-window.xml,
- src/gnac-properties.c: Fix properties window display bug.
-
- Made properties and proferences windows ignore taskbar
-
-2009-02-25 18:29 alexandreroux
-
- * data/profiles/gnac-profiles-combo.xml,
- data/profiles/gnac-profiles-manager.xml, src/profiles/Makefile,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c: gnac_profiles.c finished and ready to be
- integrated!
-
-2009-02-25 17:51 bdupasqu
-
- * libgnac/libgnac-metadata.c: Memory problem solved.
-
-2009-02-25 17:41 bdupasqu
-
- * libgnac/libgnac-metadata.c, src/gnac-properties.c: The gtk_image
- is now cleared when there is nothing to show.
-
-2009-02-25 17:31 daiji
-
- * libgnac/Makefile.am, libgnac/libgnac-converter.c,
- libgnac/libgnac-debug.c, libgnac/libgnac-debug.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-output.c: Add some
- convenient logging functions
- * libgnac_debug(gchar *format, ...) that prints debug
- informations
- * libgnac_error(gchar *format, ...) that prints error
- * libgnac_info(gchar *format, ...) that prints §informations
-
-2009-02-25 16:28 bdupasqu
-
- * libgnac/libgnac-metadata-tags.h, libgnac/libgnac-metadata.c,
- libgnac/libgnac-metadata.h, libgnac/libgnac-output.c,
- src/gnac-properties.c: src/gnac-properties is now almost
- independent of gstreamer.
-
-2009-02-25 08:07 bdupasqu
-
- * libgnac/libgnac-metadata.c, src/gnac-main.c,
- src/gnac-properties.c, src/gnac-ui.c: libgnac-metadata cover-art
- handling improved (there is still some work to do).
- Remove some warnings.
-
-2009-02-24 23:51 alexandreroux
-
- * data/profiles/gnac-profiles-combo.xml:
-
-2009-02-24 23:50 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h:
- -small bug fix
- -combo profile written (nearly finished)
-
-2009-02-24 21:16 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-gst.c,
- libgnac/libgnac-output.c: Add some debug output
- Fix a conversion bug when not all needed tags exist
-
-2009-02-24 19:35 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- src/profiles/Makefile, src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-properties.c,
- src/profiles/gnac-profiles-properties.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: -
- Finish error display
- - fix segfault on save (path problem)
-
-2009-02-24 14:25 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c:
-
-2009-02-24 13:54 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: Add
- better error management. Not finished yet, but import/load of
- file already use it.
-
-2009-02-24 09:39 daiji
-
- * src/gnac-main.c: Deactivate monitoring support
- this was introducing a major regression
-
-2009-02-24 09:35 daiji
-
- * src/gnac-main.c, src/gnac-main.h: Add monitors on files,
- When a file in the list is deleted, remove it from the list
-
-2009-02-23 23:19 alexandreroux
-
- * src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c: Begin of cleaning memory leaks...
-
-2009-02-23 21:00 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles.c, src/profiles/main.c: Still some
- problems with GtkDialog and threads...
-
-2009-02-23 16:22 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: Save
- profiles in .gnac/profiles
-
-2009-02-23 15:46 alexandreroux
-
- * src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h, src/profiles/gnac-profiles.c,
- src/profiles/gnac-profiles.h: Add url drag and drop.
-
-2009-02-23 08:50 bdupasqu
-
- * configure.ac, libgnac/libgnac-metadata.c, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po, src/gnac-properties.c:
- Some code refactoring (image handling move to libgnac-metadata).
-
-2009-02-22 20:04 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: -drag
- and drop export support
-
-2009-02-21 17:28 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: - Add
- drag'n drop support for profile import.
- - Add some check and error display
- - XML engine more stable when erroneous file are loaded
-
-2009-02-21 14:13 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-gst.c,
- src/gnac-main.c, src/gnac-ui.c, src/gnac-ui.h: Some minor
- bugfixes
- Add new dialog when trash operation is not supported by the
- Filesystem.
-
-2009-02-21 09:26 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h: Forgot
- to remove some code
-
-2009-02-21 09:24 daiji
-
- * libgnac/libgnac-converter.h, libgnac/libgnac-gst.c,
- src/gnac-main.c, src/gnac-ui.c: Fix an important UI bug.
- Click on toolbar stop button now works correctly
-
-2009-02-20 22:23 daiji
-
- * src/gnac-bars.c, src/gnac-file-list.c, src/gnac-gconf.c,
- src/gnac-main.c, src/gnac-prefs.c, src/gnac-properties.c,
- src/gnac-ui.c: Many bugfixes, TODO corrected
- Added two file filters (lossless and lossy) codecs
- Disable some error output.
-
- We must add a message logging mechanism:
- http://library.gnome.org/devel/glib/stable/glib-Message-Logging.html
- Deactivable with -DNDEBUG
-
-2009-02-20 16:25 bdupasqu
-
- * libgnac/libgnac-metadata.c: Fixed bug showing strange
- channels/sample rate values for some files.
-
-2009-02-20 16:19 alexandreroux
-
- * data/profiles/gnac-profiles-properties.xml,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c: a non negligeable quantity of bug
- fixes :-D
-
- I think this is the first really usable version of test_profile.
-
- I still need to implement some checks (profile with same name,
- etc...)
-
- ...don't hesitate if you have ideas...
-
- I will implement the TODOS I mentionned in last commit this week
- end!
-
-2009-02-20 08:27 bdupasqu
-
- * libgnac/libgnac-metadata.c, src/gnac-main.c,
- src/gnac-properties.c: Filter for Speex files added.
- Some code simplifications in gnac-properties.
-
-2009-02-19 23:09 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/vorbis.xml, src/profiles/Makefile,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h, src/profiles/gnac-profiles.c:
- Module support added.
- Save file finished. No apparent bug.
-
- TODO:
- drag-and-drop
- other plugins
- tests tests tests
- memory leaks
- clean code
-
-2009-02-18 17:27 daiji
-
- * data/gnac-properties-window.xml, src/gnac-properties.c,
- src/gnac-properties.h: Add complete properties display support.
- Code maybe needs some rewrites..
-
-2009-02-18 15:17 daiji
-
- * data/gnac-properties-window.xml, src/gnac-properties.c: Some
- preparatory work
-
-2009-02-17 22:21 alexandreroux
-
- * src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: Load
- profile file implemented. There is still some (a lot ;-)) bugs, I
- will fix them soon :-)
-
-2009-02-17 20:28 daiji
-
- * configure.ac, data/gnac-properties-window.xml,
- libgnac/libgnac-gst.c, libgnac/libgnac-marshallers.c, po/cs.po,
- po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/gnac-properties.c, src/profiles/Makefile: New gnac properties
- version test.
- No properties support yet.
-
- Some littles fixes
-
-2009-02-17 16:24 alexandreroux
-
- * data/profiles/profile-base-save.xml,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles.c: Saving feature partially done :
- base properties are saved correctly
-
- TODO:
- save format-specific properties
- read saved profile
- Try to see if format used as dynamic libs is feasible (using
- g_module for instance)
-
-2009-02-16 23:14 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/profile-base-save.xml,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c: Some bug fixes, writting of utils
- functions...
-
- Begin of "saving profile" feature...but it is not finished
- (segfault on
- save)
-
- ----> |__ zzZZZzzzZZZzzzZZzz
-
-2009-02-16 18:40 bdupasqu
-
- * src/gnac-ui.c: It works better when the code is not commented...
-
-2009-02-16 18:35 bdupasqu
-
- * src/gnac-ui.c: Set the default icon for every window.
-
-2009-02-16 10:21 daiji
-
- * data/profiles/gnac-profiles-manager.xml: Add profile edit on
- double-click
-
-2009-02-15 23:30 alexandreroux
-
- * data/profiles/gnac-profiles-manager.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/wavpack.xml, src/profiles/Makefile,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/formats/gnac-profiles-wavpack.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-manager.c,
- src/profiles/gnac-profiles-manager.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c:
-
-2009-02-14 13:04 bdupasqu
-
- * data/gnac-properties-window.xml, libgnac/Makefile.am,
- libgnac/libgnac-converter-ng.c, libgnac/libgnac-converter-ng.h,
- libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-gst.h,
- libgnac/libgnac-marshallers.c, libgnac/libgnac-marshallers.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.h, po/cs.po,
- po/fr.po, po/he.po, po/it.po, po/ro.po, po/sv.po,
- src/gnac-main.c, src/gnac-main.h: GUI for gnac-properties
- rewritten.
-
-2009-02-14 12:47 alexandreroux
-
- * src/profiles/formats/gnac-profiles-wavpack.c: Fix small wavpack
- bug
-
-2009-02-14 12:41 alexandreroux
-
- * src/profiles/gnac-profiles-utils.c:
-
-2009-02-14 07:42 daiji
-
- * src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h: Fix
- svn id mistake
-
-2009-02-14 03:01 alexandreroux
-
- * data/profiles, data/profiles/aac.xml, data/profiles/base.xml,
- data/profiles/flac.xml, data/profiles/gnac-profiles-aac.xml,
- data/profiles/gnac-profiles-base-advanced.xml,
- data/profiles/gnac-profiles-flac.xml,
- data/profiles/gnac-profiles-lame.xml,
- data/profiles/gnac-profiles-properties.xml,
- data/profiles/gnac-profiles-vorbis.xml,
- data/profiles/gnac-profiles-wav.xml,
- data/profiles/gnac-profiles-wavpack.xml,
- data/profiles/mp3-lame.xml, data/profiles/vorbis.xml,
- data/profiles/wav.xml, data/profiles/wavpack.xml: End of commit.
-
-2009-02-14 02:59 alexandreroux
-
- * src/profiles, src/profiles/Makefile, src/profiles/formats,
- src/profiles/formats/gnac-profiles-aac.c,
- src/profiles/formats/gnac-profiles-aac.h,
- src/profiles/formats/gnac-profiles-flac.c,
- src/profiles/formats/gnac-profiles-flac.h,
- src/profiles/formats/gnac-profiles-lame.c,
- src/profiles/formats/gnac-profiles-lame.h,
- src/profiles/formats/gnac-profiles-vorbis.c,
- src/profiles/formats/gnac-profiles-vorbis.h,
- src/profiles/formats/gnac-profiles-wav.c,
- src/profiles/formats/gnac-profiles-wav.h,
- src/profiles/formats/gnac-profiles-wavpack.c,
- src/profiles/formats/gnac-profiles-wavpack.h,
- src/profiles/gnac-profiles-default.c,
- src/profiles/gnac-profiles-default.h,
- src/profiles/gnac-profiles-utils.c,
- src/profiles/gnac-profiles-utils.h,
- src/profiles/gnac-profiles-xml-engine.c,
- src/profiles/gnac-profiles-xml-engine.h,
- src/profiles/gnac-profiles.c, src/profiles/gnac-profiles.h,
- src/profiles/main.c: Profiles add. Code is much better than
- previous version.
-
- TODO:
-
- -- Add support for spleex
- -- Finish the profile manager
- -- Save profile in xml files
- -- Gnac integration
-
-2009-02-13 18:25 bdupasqu
-
- * libgnac/libgnac-gst.c, libgnac/libgnac-metadata.c,
- libgnac/libgnac-output.c, src/gnac-main.c, src/gnac-properties.c:
- Some bug fixes...
-
-2009-02-13 16:10 daiji
-
- * libgnac/libgnac-output.c: Fix an omission in error handling
-
-2009-02-13 15:56 daiji
-
- * libgnac/Makefile.am, libgnac/libgnac-converter-ng.c,
- libgnac/libgnac-converter-ng.h, libgnac/libgnac-error.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-gst.h,
- libgnac/libgnac-marshallers.c, libgnac/libgnac-marshallers.h,
- libgnac/libgnac-output.c, src/gnac-main.c, src/gnac-main.h: Add
- better error messages
- Fix a bug when source and destination are the same.
-
-2009-02-11 19:22 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-converter.h: Remove
- old converter code
-
-2009-02-11 18:36 daiji
-
- * data/gnac-properties-window.xml, data/gnac.xml,
- libgnac/Makefile.am, libgnac/libgnac-converter-ng.c,
- libgnac/libgnac-converter-ng.h, libgnac/libgnac-error.h,
- libgnac/libgnac-gst.c, libgnac/libgnac-gst.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-main.c, src/gnac-main.h,
- src/gnac-properties.c, src/gnac-ui.h, src/gnac-utils.c,
- src/gnac-utils.h: Add new conversion backend.
- Better error handling, and better code.
-
- * src/gnac-file-list.c:
- * src/gnac-file-list.h:
- Put back an invisible column to handle uris
- Correct an annoying display problem
-
- * src/gnac-utils.c:
- * src/gnac-utils.h:
- Add error handling support
-
- * libgnac/Makefile.am:
- * src/gnac-main.c:
- * libgnac/libgnac-output.h:
- * libgnac/libgnac-converter-ng.c:
- * libgnac/libgnac-converter-ng.h:
- * libgnac/libgnac-gst.c:
- * libgnac/libgnac-gst.h:
- * libgnac/libgnac-error.h:
- * libgnac/libgnac-output.c:
- Add new conversion backend
-
-
- * libgnac/libgnac-metadata.c:
- Some minor changes
-
-2009-02-09 20:20 bdupasqu
-
- * libgnac/gnac-metadata.c, libgnac/gnac-metadata.h: old
- gnac-metadata files removed
-
-2009-02-09 20:19 bdupasqu
-
- * data/gnac-properties-window.xml, libgnac/Makefile.am,
- libgnac/libgnac-error.h, libgnac/libgnac-metadata.c,
- libgnac/libgnac-metadata.h, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, po/POTFILES.in, po/cs.po, po/fr.po,
- po/he.po, po/it.po, po/ro.po, po/sv.po, src/gnac-main.c,
- src/gnac-playlist.c, src/gnac-prefs.c, src/gnac-properties.c,
- src/gnac-properties.h, src/gnac-ui.c, src/gnac-utils.c:
- libgnac-metadata entirely rewritten (nicer, faster).
- bug in gnac-playlist resolved.
-
-2009-01-27 15:34 daiji
-
- * po/LINGUAS, po/cs.po, po/fr.po, po/he.po, po/it.po, po/ro.po,
- po/sv.po: Add Hebrew translation, special thanks to Amit T.
-
-2009-01-25 20:46 daiji
-
- * libgnac/libgnac-converter-ng.c, libgnac/libgnac-converter-ng.h,
- src/gnac-file-list.c, src/gnac-file-list.h: *
- src/gnac-file-list.c:
- * src/gnac-file-list.h:
- Some code simplification (reading the documentation is sometimes
- useful
-
- * libgnac/libgnac-converter-ng.c:
- * libgnac/libgnac-converter-ng.h:
- new converter basecode
-
-2009-01-24 12:56 daiji
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c: Add
- error reporting with tooltip in GtkTreeView
-
-2009-01-24 11:43 bdupasqu
-
- * data/Makefile.am, data/gnac.xml, libgnac/gnac-metadata.h,
- libgnac/libgnac-converter.h, libgnac/libgnac-error.h,
- libgnac/libgnac-output.h, src/gnac-main.c: * src/gnac-main.c
- - Correct invalid pointer on a free causing gnac to crash.
- - Initialize libgnac converter sooner to allow the user to give
- files on the command line (as arguments).
- * data/gnac.xml
- - Copyright does not need to be translated.
- * data/Makefile.am
- - Some icons were not installed.
-
-2009-01-24 10:14 daiji
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c,
- src/gnac-properties.c: Hash table migration and visual error
- notification basecode
- * src/gnac-file-list.c:
- * src/gnac-properties.c:
- * src/gnac-file-list.h:
- * src/gnac-main.c:
-
-2009-01-23 22:31 daiji
-
- * po/LINGUAS, po/cs.po, po/fr.po, po/it.po, po/ro.po, po/sv.po: Add
- Swedish translation, Thanks to Niklas Grahn
-
-2009-01-23 20:34 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, src/gnac-file-list.h, src/gnac-main.c,
- src/gnac-ui.c, src/gnac-ui.h, src/gnac-utils.c, src/gnac-utils.h:
- Small changes about errors
-
- * src/gnac-file-list.h:
- * src/gnac-ui.h:
- Move enum for file-list in gnac-file-list.h
-
- * src/gnac-utils.c:
- * src/gnac-utils.h:
- Better error handling
-
- * src/gnac-ui.c:
- * src/gnac-main.c:
- Correct some little mistakes about errors. Display more error
- messages.
-
- * libgnac/libgnac-output.h:
- * libgnac/libgnac-converter.c:
- * libgnac/libgnac-output.c:
- Better error handling.
-
-2009-01-20 21:51 daiji
-
- * po/LINGUAS, po/cs.po, po/fr.po, po/it.po, po/ro.po: Add romanian
- translation, special thanks to Cris!
-
-2009-01-17 10:54 daiji
-
- * libgnac/libgnac-converter.c, libgnac/libgnac-output.c,
- libgnac/libgnac-output.h, src/gnac-main.c: * src/gnac-main.c:
- fix uncorrect functions names
-
- * libgnac/libgnac-output.h:
- * libgnac/libgnac-output.c:
- Fix a bug with tags containing "/" character
- Add a sanitize path function (based on sound-juicer code)
-
- * libgnac/libgnac-converter.c:
- fix cleaning a NULL pipeline
-
-2009-01-17 09:41 daiji
-
- * libgnac/libgnac-output.c, src/gnac-main.c, src/gnac-playlist.c:
- Fix some playlist bugs
-
- * src/gnac-playlist.c:
- Compute complete uri for file
- * src/gnac-main.c:
- Activate playlist support
-
- * libgnac/libgnac-output.c:
- Remove ununsed variable
-
-2009-01-17 09:14 daiji
-
- * configure.ac, libgnac/libgnac-converter.c,
- libgnac/libgnac-converter.h, src/gnac-main.c: Basecode handling
- gstreamer missing plugins is there.
-
- * src/gnac-main.c:
- Add initialize code for the library
-
- * libgnac/libgnac-converter.c:
- * libgnac/libgnac-converter.h:
- Add basecode of missing plugin errors
-
- * configure.ac:
- Add the gstreamer-pbutils dependency
-
-2009-01-16 18:31 daiji
-
- * TODO, configure.ac, data/Makefile.am, data/gnac-128.png,
- data/gnac-192.png, data/gnac-256.png, data/gnac-64.png,
- data/gnac-72.png, data/gnac-96.png, data/gnac-pref-window.xml,
- data/gnac.xml, libgnac/Makefile.am, libgnac/gnac-metadata.c,
- libgnac/gnac-metadata.h, libgnac/libgnac-converter.c,
- libgnac/libgnac-converter.h, libgnac/libgnac-error.h,
- libgnac/libgnac-output.c, libgnac/libgnac-output.h, po/cs.po,
- po/fr.po, po/it.po, src/Makefile.am, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-gconf.c, src/gnac-gconf.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-playlist.c,
- src/gnac-playlist.h, src/gnac-prefs.c, src/gnac-properties.c,
- src/gnac-properties.h, src/gnac-ui.c, src/gnac-ui.h,
- src/gnac-utils.c, src/gnac-utils.h: Big commit!
-
- * gnome-vfs repalced by GIO
- * dropped libgnome dependency
- * gnac-main.c totally rewritten
- * Many modifications in libgnac
- * Fixed all file path bugs
- * Updated french translation
- * Playlist support rewritten
- * remove file when not completed (stop conversion)
- * Many bugfixes
-
-2009-01-15 18:29 daiji
-
- * data/gnac-16.png, data/gnac-22.png, data/gnac-24.png,
- data/gnac-32.png, data/gnac-48.png, data/gnac.png, data/gnac.svg:
- New icon set
- Special thanks to Cristian Grada
-
-2009-01-12 14:45 daiji
-
- * data/gnac-pref-window.xml, data/gnac.xml, po/POTFILES.in,
- po/cs.po, po/fr.po, po/it.po, src/gnac-main.c, src/gnac-prefs.c,
- src/gnac-ui.c, src/gnac-ui.h: Show progress bar only during
- conversion
- Disable labels in Preferences dialog
- Forget to remove gnac-trayicon.c in POTFILES.in
-
-2009-01-12 12:09 daiji
-
- * data/gnac.xml: Correct a little mistake in credits
-
-2009-01-12 11:53 daiji
-
- * data/gnac.xml, src/Makefile.am, src/gnac-main.c,
- src/gnac-trayicon.c, src/gnac-trayicon.h, src/gnac-ui.c,
- src/gnac-ui.h: Move status icon to gnac-ui
-
-2009-01-11 21:11 daiji
-
- * data/Makefile.am, data/gnac-pref-window.xml,
- data/gnac-properties-window.xml, data/gnac-trayicon-menu.xml,
- data/gnac.xml, m4/intltool.m4, src/gnac-bars.c, src/gnac-prefs.c,
- src/gnac-properties.c, src/gnac-trayicon.c, src/gnac-ui.c: Remove
- gnac-trayicon-menu.xml, definitions moved in gnac.xml
-
- All signals connected directly from xml file. All useless signal
- connections
- removed from source code.
-
- GtkBuilder problems seem to be all fixed!
-
-2009-01-11 20:51 bdupasqu
-
- * src/gnac-playlist.c: Minor improvements in gnac-playlist.c
-
-2009-01-11 20:31 bdupasqu
-
- * configure.ac, m4/intltool.m4, src/Makefile.am, src/gnac-main.c,
- src/gnac-playlist.c, src/gnac-playlist.h: gnac-playlist.c
- entirely rewritten to use GIO.
-
-2009-01-11 11:34 daiji
-
- * data/Makefile.am, data/gnac-22.png, data/gnac-24.png,
- data/gnac-pref-window.xml, data/gnac-properties-window.xml,
- data/gnac.xml: Fix icon problems
-
-2009-01-10 16:48 daiji
-
- * data/gnac.xml, po/cs.po, po/fr.po, po/it.po, src/gnac-ui.c: *
- Moved about dialog to GtkBuilder
- * Translations updated
-
-2009-01-10 15:09 daiji
-
- * data/gnac-pref-window.xml, data/gnac-properties-window.xml,
- data/gnac.xml, po/POTFILES.in, po/cs.po, po/fr.po, po/it.po,
- src/gnac-ui.c: Fix all translation issues
-
-2009-01-04 20:11 daiji
-
- * configure.ac, data/Makefile.am, data/gnac-pref-window.xml,
- data/gnac-properties-window.xml, data/gnac.schemas.in,
- data/gnac.xml, m4/intltool.m4, src/Makefile.am, src/gnac-about.c,
- src/gnac-about.h, src/gnac-bars.c, src/gnac-convert.c,
- src/gnac-convert.h, src/gnac-file-list.c, src/gnac-gconf.c,
- src/gnac-gconf.h, src/gnac-main.c, src/gnac-prefs-functions.c,
- src/gnac-prefs-functions.h, src/gnac-prefs-utils.c,
- src/gnac-prefs-utils.h, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac-properties.c, src/gnac-properties.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac-utils.c, src/gnac-utils.h, src/gnac.h:
- Big huge commit, road to Gnac 0.2.x
-
- Complete UI uses now GtkBuilder xml files instead of hardcoded
- one.
- gnac-convert is renamed as gnac-utils (that seems more
- apropriate)
- Inteface with gconf and preferences are completely rewritten,
- sorry Alex :p
- Many piece of code rewrite.
-
-2009-01-04 17:49 bdupasqu
-
- * po/LINGUAS, po/cs.po, po/fr.po, po/it.po, src/gnac-about.c: Czech
- and Italian translations added.
-
-2008-08-30 12:12 bdupasqu
-
- * data/Makefile.am, po/fr.po, src/gnac-prefs.c: French translation
- updated.
-
-2008-08-28 22:50 bdupasqu
-
- * data/Makefile.am, po/POTFILES.in, po/fr.po: Some small
- corrections in order to pass make distcheck.
-
-2008-08-28 22:35 bdupasqu
-
- * configure.ac, data/Makefile.am, libgnac/Makefile.am,
- libgnac/gnac-converter.c, libgnac/gnac-converter.h,
- libgnac/gnac-error.c, libgnac/gnac-error.h,
- libgnac/libgnac-converter.c, libgnac/libgnac-converter.h,
- libgnac/libgnac-error.c, libgnac/libgnac-error.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-trayicon.h,
- src/gnac-ui.h: Some renaming...
-
-2008-08-28 20:55 bdupasqu
-
- * configure.ac, data/Makefile.am, libgnac/gnac-converter.c,
- libgnac/gnac-converter.h, libgnac/gnac-error.h,
- libgnac/gnac-metadata.c, libgnac/gnac-metadata.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h, po/fr.po,
- src/gnac-convert.c, src/gnac-main.c, src/gnac-main.h,
- src/gnac-properties.c, src/gnac-trayicon.c, src/gnac-trayicon.h,
- src/gnac-ui.h: Gnac-converter now uses GObject and implements
- signals (error,
- overwrite, progress and completion).
-
-2008-08-23 15:13 bdupasqu
-
- * Makefile.am, configure.ac: Bug in the Makefile corrected (the
- file data/gnac.schemas was not deleted).
-
-2008-08-23 00:14 bdupasqu
-
- * po/fr.po: French translation updated.
-
-2008-08-22 23:57 bdupasqu
-
- * ChangeLog, data/Makefile.am, po/ChangeLog, src/gnac-gconf.c,
- src/gnac-gconf.h, src/gnac-prefs.c: Small bug corrected (in the
- Makefile and in gnac-prefs.c).
-
-2008-08-21 23:39 bdupasqu
-
- * NEWS, configure.ac, data/Makefile.am, gnac.spec.in,
- libgnac/gnac-converter.c, libgnac/gnac-converter.h,
- libgnac/gnac-error.c, libgnac/gnac-error.h,
- libgnac/gnac-metadata.c, libgnac/gnac-metadata.h,
- libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h, po/fr.po,
- src/gnac-about.c, src/gnac-about.h, src/gnac-bars.c,
- src/gnac-bars.h, src/gnac-convert.c, src/gnac-convert.h,
- src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-gconf.c,
- src/gnac-gconf.h, src/gnac-main.c, src/gnac-main.h,
- src/gnac-playlist.c, src/gnac-playlist.h,
- src/gnac-prefs-functions.c, src/gnac-prefs-functions.h,
- src/gnac-prefs-utils.c, src/gnac-prefs-utils.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-trayicon.c, src/gnac-trayicon.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac.h: Some corrections in the Makefiles.
-
-2008-08-18 23:06 bdupasqu
-
- * configure.ac, data/Makefile.am, gnac.spec.in, po/fr.po,
- src/Makefile.am, src/gnac-about.c, src/gnac-about.h,
- src/gnac-main.c, src/gnac-prefs.c, src/gnac-ui.c: GConf schemas
- are now installed at the right place.
-
-2008-07-28 13:54 bdupasqu
-
- * ChangeLog, po/fr.po, src/gnac-main.c: Some file filters were
- missing.
-
-2008-07-26 23:20 bdupasqu
-
- * libgnac/gnac-converter.c, libgnac/gnac-converter.h,
- libgnac/gnac-metadata.c, libgnac/libgnac-metadata.c, po/fr.po,
- src/gnac-about.c, src/gnac-about.h, src/gnac-bars.c,
- src/gnac-bars.h, src/gnac-convert.c, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-main.c, src/gnac-main.h,
- src/gnac-playlist.c, src/gnac-playlist.h,
- src/gnac-prefs-functions.c, src/gnac-prefs-functions.h,
- src/gnac-prefs-utils.c, src/gnac-prefs-utils.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-trayicon.c, src/gnac-trayicon.h, src/gnac-ui.h: Some
- code refactoring.
- Dialog added to warn the user before overwriting existing files.
-
-2008-07-21 17:52 bdupasqu
-
- * ChangeLog, NEWS, configure.ac, data/Makefile.am,
- libgnac/gnac-converter.c, libgnac/gnac-metadata.c,
- m4/intltool.m4, po/POTFILES.in, po/fr.po, src/gnac-main.c,
- src/gnac-prefs.c, src/gnac-ui.c: French translation updated.
-
-2008-07-19 22:30 bdupasqu
-
- * libgnac/gnac-converter.c, libgnac/gnac-converter.h, po/fr.po,
- src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c: Display a
- warning dialog when the user closes the application while a
- conversion process is running.
-
-2008-07-14 23:27 bdupasqu
-
- * ChangeLog, libgnac/gnac-converter.c, src/gnac-about.c,
- src/gnac-convert.c, src/gnac-convert.h, src/gnac-main.c,
- src/gnac-playlist.c, src/gnac-playlist.h, src/gnac-trayicon.c:
- Better control on output filenames (if the needed tags don't
- exist, just keep the old filename). It is now possible to stop
- the conversion.
-
-2008-04-27 07:47 bdupasqu
-
- * src/gnac-bars.c, src/gnac-bars.h, src/gnac-file-list.c:
- Activate/Deactivate functions in gnac-bars.{c|h} merged. Now, a
- gboolean is used to control the action to be done.
-
-2008-04-27 00:58 alexandreroux
-
- * m4/intltool.m4, src/gnac-prefs.c: Fixed compiz issue
-
-2008-04-23 21:49 bdupasqu
-
- * src/gnac-playlist.c: Correction of a bug: some playlists were not
- read correctly due to a strange behavior of GnomeVFS.
-
-2008-04-17 21:25 bdupasqu
-
- * src/gnac-bars.c, src/gnac-bars.h, src/gnac-file-list.c,
- src/gnac-main.c: Mysterious 'remove'-bug solved.
-
-2008-04-17 19:09 bdupasqu
-
- * src/gnac-convert.c, src/gnac-properties.c, src/gnac-properties.h:
- Bug on the permissions while creating a directory corrected.
-
-2008-04-15 16:36 bdupasqu
-
- * src/gnac-properties.c: Awful piece of code rewritten.
-
-2008-04-15 15:59 bdupasqu
-
- * ChangeLog, TODO, src/gnac-gconf.c, src/gnac-gconf.h,
- src/gnac-main.c, src/gnac-properties.c, src/gnac-properties.h:
- Buggy entries of properties box commented.
-
-2008-04-13 14:55 daiji
-
- * libgnac/libgnac-metadata.c: Test
-
-2008-04-12 12:50 daiji
-
- * libgnac/libgnac-metadata.c: Add error handler for example
-
-2008-04-12 12:22 daiji
-
- * libgnac/libgnac-metadata.c: Some speedup
-
-2008-04-12 10:49 daiji
-
- * libgnac/libgnac-metadata.c, libgnac/libgnac-metadata.h: Need tag
- reader, need testing!
-
- TODO :
- replace the old one in gnac-properties
-
-2008-04-10 12:03 bdupasqu
-
- * TODO, gnac.spec.in, m4/intltool.m4, po/fr.po, src/gnac-about.c,
- src/gnac-main.c: Bug corrected, File filters partly rewritten.
-
-2008-04-10 08:52 daiji
-
- * libgnac/gnac-converter.c, libgnac/gnac-converter.h,
- m4/intltool.m4, src/gnac-convert.c, src/gnac-gconf.c,
- src/gnac-gconf.h, src/gnac-main.c, src/gnac.h: *
- src/gnac-gconf.c:
- * src/gnac-gconf.h:
- Provided to handle all gconf parts
-
- * src/gnac.h:
- Move here preffered encoding profile
-
- * src/gnac-convert.c:
- * src/gnac-main.c:
- Treat errors
-
- * libgnac/gnac-converter.h:
- * libgnac/gnac-converter.c:
- Remove stupid dependency from audio_profile.
- Connect the cb for overwriting files (still need to write it).
-
-2008-04-07 19:26 bdupasqu
-
- * src/gnac-main.c: Progressbar reset after conversion.
-
-2008-04-07 18:58 bdupasqu
-
- * configure.ac, data/Makefile.am: Makefile updated to remove the
- ${datadir}/gnac directory on uninstall.
-
-2008-04-07 18:13 bdupasqu
-
- * src/gnac-convert.c, src/gnac-main.c, src/gnac-ui.c: First try
- with the progressbar. Not very efficient, just update the
- progressbar according to the number of files to convert (increase
- of 1/nb_files).
-
-2008-04-07 12:53 bdupasqu
-
- * ChangeLog, configure.ac, src/gnac-convert.c, src/gnac-convert.h,
- src/gnac-main.c, src/gnac-playlist.c, src/gnac-prefs-utils.c,
- src/gnac-trayicon.c: All options are now taken into account
- (rename patterns, directory
- where to save converted files, delete files after conversion).
- A bug in the playlist's reading function has been corrected.
- TODO:
- - verify that a directory exists before creating it
- - delete source file only if conversion is successful
-
-2008-04-05 19:21 bdupasqu
-
- * libgnac/gnac-converter.c, libgnac/gnac-converter.h,
- libgnac/gnac-error.c, libgnac/gnac-error.h,
- libgnac/gnac-metadata.c, libgnac/gnac-metadata.h,
- src/gnac-about.c, src/gnac-about.h, src/gnac-bars.c,
- src/gnac-bars.h, src/gnac-convert.c, src/gnac-convert.h,
- src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c,
- src/gnac-main.h, src/gnac-playlist.c, src/gnac-playlist.h,
- src/gnac-prefs-functions.c, src/gnac-prefs-functions.h,
- src/gnac-prefs-utils.c, src/gnac-prefs-utils.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-trayicon.c, src/gnac-trayicon.h, src/gnac-ui.c,
- src/gnac-ui.h, src/gnac.h: SVN id set on all source files (*.c,
- *.h).
-
-2008-04-05 19:13 bdupasqu
-
- * THANKS, libgnac/gnac-converter.c, libgnac/gnac-metadata.h,
- m4/intltool.m4, po/fr.po, src/gnac-about.c, src/gnac-bars.c,
- src/gnac-convert.c, src/gnac-convert.h, src/gnac-main.c,
- src/gnac-properties.c, template.c: The GUI is now updated when a
- conversion is done.
- The option 'where to save converted files' is now taken into
- account.
-
-2007-07-13 13:02 bdupasqu
-
- * AUTHORS, NEWS, README, THANKS, TODO, configure.ac, gnac.spec.in,
- libgnac/gnac-metadata.c, libgnac/gnac-metadata.h, po/POTFILES.in,
- po/fr.po, src/Makefile.am, src/gnac-about.c, src/gnac-bars.c,
- src/gnac-main.c, src/gnac-playlist.c, src/gnac-playlist.h,
- src/gnac-prefs-utils.c: Gnac handles now the playlists (*.m3u,
- *.pls, *.xspf)
- Some refactoring has been done (mainly in the makefiles)
-
-2007-06-13 00:01 alexandreroux
-
- * data/gnac.schemas.in, src/Makefile.am, src/gnac-prefs-utils.c,
- src/gnac-prefs-utils.h, src/gnac-prefs.c, src/gnac-prefs.h:
-
-2007-05-06 14:56 bdupasqu
-
- * src/gnac-convert.c: Bugfix in output filenames
-
-2007-05-01 08:06 bdupasqu
-
- * TODO, libgnac/gnac-converter.c, m4/intltool.m4, src/gnac-bars.c:
- Little mistake corrected.
- With it, it couldn't compile!
-
-2007-05-01 06:28 daiji
-
- * libgnac/gnac-converter.c, src/gnac-convert.c, src/gnac-convert.h:
- Forgot some files :p
-
-2007-04-30 20:40 daiji
-
- * TODO, libgnac/Makefile.am, libgnac/gnac-converter.c,
- libgnac/gnac-converter.h, libgnac/gnac-error.c,
- libgnac/gnac-error.h, m4/intltool.m4, src/Makefile.am,
- src/gnac-main.c, src/gnac-main.h, src/gnac-trayicon.c: Audio
- conversion is OK ! Now we have to implement the signals of the
- converter to move the progressbar, and to put main GUI on normal
- state.
-
-2007-04-29 19:53 bdupasqu
-
- * TODO, data/Makefile.am, data/gnac-trayicon-menu.xml, docs, help,
- libgnac/gnac-converter.c, libgnac/gnac-metadata.c,
- libgnac/gnac-metadata.h, m4/intltool.m4, po/POTFILES.in,
- po/fr.po, src/Makefile.am, src/gnac-bars.c, src/gnac-main.c,
- src/gnac-prefs.c, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-trayicon.c, src/gnac-trayicon.h: The tray icon has been
- added.
- The accelerators for the main window are now operational.
-
-2007-04-28 15:38 daiji
-
- * libgnac/gnac-converter.c, libgnac/gnac-converter.h: First draw of
- converter. No time to test now, but code is almost done.
-
-2007-04-28 08:52 daiji
-
- * libgnac/gnac-converter.c, src/gnac-prefs.c,
- src/gnac-properties.c: little fixes, properties and preferences
- windows, are now focused when they appear
-
-2007-04-27 21:26 daiji
-
- * data/gnac-16.png, data/gnac-32.png, data/gnac-48.png,
- data/gnac.png, libgnac/Makefile.am, libgnac/gnac-converter.c,
- libgnac/gnac-converter.h, m4/intltool.m4, src/gnac-file-list.c,
- src/gnac-file-list.h, src/gnac-main.c, src/gnac-ui.c: Begin of
- converter lib. Some code stuff, nothing has been tested.
-
-2007-04-27 14:35 bdupasqu
-
- * Makefile.am, data/Makefile.am, libgnac/gnac-metadata.c,
- libgnac/gnac-metadata.h, m4/intltool.m4, po/ChangeLog,
- po/POTFILES.skip, po/fr.po, src/gnac-main.c,
- src/gnac-properties.c, src/gnac-properties.h: Some modifications
- in the gnac-metadata library.
- It's now possible to get the file size, the location, the
- filename and the duration.
-
- Some changes have been made in the po folder in order to do a
- release (make distcheck is now OK)
-
-2007-04-26 10:53 alexandreroux
-
- * data/gnac.schemas.in, po/fr.po, src/gnac-main.c,
- src/gnac-prefs-functions.c, src/gnac-prefs-functions.h,
- src/gnac-prefs.c, src/gnac.h:
-
-2007-04-25 17:48 alexandreroux
-
- * po/fr.po, src/gnac-prefs.c:
-
-2007-04-25 17:31 alexandreroux
-
- * src/gnac-prefs-functions.c, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac.h:
-
-2007-04-25 15:01 daiji
-
- * src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c,
- src/gnac-properties.c: Many Bugfixes
-
-2007-04-25 08:41 alexandreroux
-
- * po/fr.po, src/gnac-prefs.c:
-
-2007-04-25 08:35 alexandreroux
-
- * m4/intltool.m4, src/gnac-prefs-functions.c, src/gnac-prefs.c,
- src/gnac.h: Légère mise à jour
-
- TODO:
- finalise destintion directory
- finalise try icon
-
-2007-04-24 21:04 bdupasqu
-
- * po/fr.po, src/gnac-main.c, src/gnac-prefs-functions.c: All
- warnings have been removed.
- The --help command line argument has been improved.
-
-2007-04-24 19:00 bdupasqu
-
- * TODO, data/Makefile.am, data/gnac.desktop.in.in,
- data/gnac.schemas.in, libgnac/Makefile.in,
- libgnac/gnac-metadata.c, libgnac/gnac-metadata.h, m4/intltool.m4,
- po/fr.po, src/gnac-about.h, src/gnac-bars.h,
- src/gnac-file-list.c, src/gnac-file-list.h, src/gnac-main.c,
- src/gnac-prefs.c, src/gnac-properties.c, src/gnac-properties.h:
- Some bugfixes.
- Commandline option added: it's now possible to give files through
- the commandline.
-
-2007-04-23 23:54 alexandreroux
-
- * data/gnac.schemas.in, po/fr.po, src/gnac-prefs-functions.c,
- src/gnac-prefs-functions.h, src/gnac-prefs.c, src/gnac-prefs.h:
- Mise à jour menu de préférences
-
- TODO :
- -finir destination directory
- -lier systray
-
-2007-04-23 10:13 alexandreroux
-
- * data/gnac.schemas.in, libgnac/Makefile.in, m4/intltool.m4,
- po/fr.po, src/Makefile.am, src/gnac-main.c,
- src/gnac-prefs-functions.c, src/gnac-prefs-functions.h,
- src/gnac-prefs.c, src/gnac-prefs.h, src/gnac-ui.c, src/gnac-ui.h,
- src/gnac.h: Mise à jour des préférences
-
- ATTENTION :
- Exécuter ces commandes en root avant de compiler gnac (ceci afin
- de nettoyer gconf) :
- # export
- GCONF_CONFIG_SOURCE=xml:merged:/etc/gconf/gconf.xml.defaults
- # gconftool-2 --makefile-uninstall-rule
- /usr/local/etc/gconf/schemas/gnac.schemas
-
- Après la compilation, exécuter ceci
- # killall gconfd-2
-
- Il faudrait trouver un moyen de syncroniser gconfd
- automatiquement avec les nouveaux
- schemas installés...
-
-2007-04-21 21:43 bdupasqu
-
- * libgnac/gnac-metadata.c, po/POTFILES.in, po/fr.po,
- src/gnac-properties.c: French translation for the library added.
-
-2007-04-21 21:26 bdupasqu
-
- * Makefile.am, configure.ac, data/Makefile.am, data/gnac-16.png,
- data/gnac-32.png, data/gnac-48.png, libgnac, libgnac/Makefile.am,
- libgnac/Makefile.in, libgnac/gnac-metadata.c,
- libgnac/gnac-metadata.h, m4/intltool.m4, src/Makefile.am,
- src/gnac-main.c, src/gnac-prefs.c, src/gnac-properties.c,
- src/gnac-properties.h: First version of the library to read audio
- metadata.
-
-2007-04-21 20:44 daiji
-
- * src/gnac-about.c, src/gnac-file-list.c, src/gnac-file-list.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-properties.c: Some
- refactoring
- little bugxfix
-
-2007-04-21 16:19 daiji
-
- * TODO, data/Makefile.am, src/Makefile.am, src/gnac-bars.c,
- src/gnac-bars.h, src/gnac-file-list.c, src/gnac-file-list.h,
- src/gnac-main.c, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-ui.c, src/gnac-ui.h: gnac-main code refactoring (many
- duplicate code removed)
- added gnac-file-list.[ch], file list functions for easy actions
- on file list and avoid code duplication.
- Properties dialog actions are ok
-
-2007-04-19 00:21 alexandreroux
-
- * data/gnac.schemas.in, m4/intltool.m4, po/fr.po, src/gnac-main.c,
- src/gnac-prefs.c, src/gnac-prefs.h, src/gnac.h: Avancement dans
- la fenêtre de propriété
-
- TODO : - Rajouter le type liste
- - Rajouter une méthode d'intégration en combo ou radio pour les
- strings
- - Rajouter les notification gconf
- - Rajouter une barre horizontale et un bouton fermer
- - Aller dormir
-
-2007-04-18 20:48 bdupasqu
-
- * data/Makefile.am, data/gnac.desktop.in.in:
-
-2007-04-18 20:36 bdupasqu
-
- * Makefile.am, configure.ac, data/Makefile.am,
- data/gnac-global.schemas.in, data/gnac-logo.png,
- data/gnac.desktop.in.in, data/gnac.png, data/gnac.schemas.in,
- po/POTFILES.in, po/fr.po, src/Makefile.am, src/gnac-prefs.c,
- src/gnac-ui.c:
-
-2007-04-17 17:54 bdupasqu
-
- * data/gnac-global.schemas, data/gnac-global.schemas.in,
- data/gnac.desktop, data/gnac.desktop.in.in, m4, m4/intltool.m4:
-
-2007-04-17 17:49 bdupasqu
-
- * Makefile.am, configure.ac, data/Makefile.am, data/gnac.desktop,
- src/Makefile.am: Makefiles configure to used with GConf.
-
-2007-04-17 06:24 alexandreroux
-
- * data/gnac-global.schemas:
-
-2007-04-17 01:40 alexandreroux
-
- * data/Makefile.am, po/fr.po, src/Makefile.am, src/gnac-main.c,
- src/gnac-main.h, src/gnac-prefs.c, src/gnac-prefs.h,
- src/gnac-ui.c: Version temporaire des préférences :
-
- TODO : - écrire le support pour les autres types d'options (au
- moins string, int et list)
- - écrire la partie gconf
- - Meilleurs support de l'internationalisation
-
-2007-04-15 16:03 daiji
-
- * configure.ac, src/gnac-main.c, src/gnac-properties.c: Gnome
- integration added
-
-2007-04-15 14:44 bdupasqu
-
- * po/fr.po, src/gnac-main.c, src/gnac-properties.c,
- src/gnac-properties.h: The properties window can now be resized
- without affecting its aspect!
-
-2007-04-15 13:56 alexandreroux
-
- * po/fr.po, src/gnac-main.c: WARNING : For the moment, the default
- directory is "/". Should be changed with gconf.
-
-2007-04-15 13:25 alexandreroux
-
- * src/gnac-main.c, src/gnac-ui.c, src/gnac-ui.h: Plus de warnings
- les gars!!! Ouais :-)
-
-2007-04-15 13:12 alexandreroux
-
- * src/gnac-main.c, src/gnac-properties.c, src/gnac-ui.c: Retrait
- d'un warning à la compilation
-
- Fichiers triés par dossier.
- --> TODO : Trier uniquement lorsque les fichiers on été ajoutés
- (Si le tri est activé lors de l'ajout, il prend bcp plus de
- temps). Je n'ai pas trouvé le moyen de désactiver le tri après
- qu'il ai été activé! Si quelqu'un trouve.
-
- Aspect définitif du file-chooser. Ajout du check button close on
- add.
-
-2007-04-15 11:45 daiji
-
- * src/gnac-bars.c, src/gnac-main.c, src/gnac-main.h, src/gnac-ui.c:
- Some code rewritting and refactoring
-
-2007-04-15 09:54 bdupasqu
-
- * data/Makefile.am, data/bars-description.xml, data/gnac-bars.xml,
- po/fr.po, po/gnac.pot, src/gnac-about.c, src/gnac-bars.c,
- src/gnac-main.c, src/gnac-main.h, src/gnac-properties.c,
- src/gnac-ui.c: To be coherent with the code, bars-description.xml
- renamed gnac-bars.xml
- It's now possible to delete files in the list by using the
- 'delete' key
- The icon has been added in all windows.
-
-2007-04-14 15:10 bdupasqu
-
- * po/POTFILES.in, po/fr.po, po/gnac.pot, src/gnac-about.c,
- src/gnac-main.c, src/gnac-properties.c, src/gnac.h: All labels in
- the gnac properties window are now left aligned.
- The license has been translated.
- Some warnings have been removed.
-
-2007-04-14 09:53 daiji
-
- * src/gnac-main.c: Bugfix double free
-
-2007-04-13 21:41 daiji
-
- * src/gnac-bars.c, src/gnac-bars.h, src/gnac-main.c,
- src/gnac-main.h, src/gnac-ui.c: Add all buttons interaction.
-
-2007-04-13 18:01 bdupasqu
-
- * configure.ac, po/POTFILES.in, po/fr.po, src/Makefile.am,
- src/gnac-bars.c, src/gnac-main.c, src/gnac-main.h,
- src/gnac-prefs.c, src/gnac-properties.c, src/gnac-properties.h,
- src/gnac-ui.c: First version of the properties window.
- Bug of the convert button corrected.
- French translation completed.
-
-2007-04-13 15:42 alexandreroux
-
- * src/gnac-main.c, src/gnac-ui.c: Sort the list by directory
-
-2007-04-13 13:52 daiji
-
- * src/gnac-main.c, src/gnac-ui.c: correct the interface bug,
- convert button still smaller than edit button
-
-2007-04-13 13:29 daiji
-
- * data/gnac-logo.png, src/gnac-main.c, src/gnac-main.h,
- src/gnac-ui.c, src/gnac-ui.h: Add 2 developer-friendly functions
- to store and get widgets
- correct some audio-profile bugs
- correct a little memory leak
-
-2007-04-13 10:17 bdupasqu
-
- * po/POTFILES.in, po/fr.po, po/gnac.pot, src/gnac-about.c,
- src/gnac-about.h, src/gnac-bars.c, src/gnac-bars.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-ui.c, src/gnac-ui.h, src/gnac.h:
-
-2007-04-13 08:55 bdupasqu
-
- * Makefile.am, configure.ac, data/Makefile.am, data/gnac-logo.png,
- data/gnac.desktop, pixmaps, po, po/LINGUAS, po/POTFILES.in,
- po/fr.po, po/gnac.pot, src/Makefile.am, src/gnac-about.c,
- src/gnac-about.h, src/gnac-bars.c, src/gnac-bars.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-ui.c, src/gnac-ui.h, src/gnac.h:
- French translation added.
- License added at the beginning of all source files.
- gnac.desktop created.
- All the files in the pixmaps directory moved to the data
- directory.
-
-2007-04-12 17:47 alexandreroux
-
- * src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-prefs.h:
-
-2007-04-12 17:38 daiji
-
- * src/gnac-about.c, src/gnac-main.c, src/gnac-main.h,
- src/gnac-ui.c, src/gnac-ui.h, src/gnac.h: All widget pointers are
- stored in an hashtable
-
-2007-04-11 22:10 alexandreroux
-
- * src/gnac-main.c, src/gnac-main.h: Mise à jour de l'ajout de
- fichier et de dossier
-
- Devrait fonctionner correctement!
-
-2007-04-10 22:15 daiji
-
- * ., AUTHORS, ChangeLog, Makefile.am, NEWS, README, TODO,
- autogen.sh, configure.ac, data, data/Makefile.am,
- data/bars-description.xml, docs, pixmaps, pixmaps/Makefile.am,
- pixmaps/gnac-logo.png, src, src/Makefile.am, src/gnac-about.c,
- src/gnac-about.h, src/gnac-bars.c, src/gnac-bars.h,
- src/gnac-main.c, src/gnac-main.h, src/gnac-prefs.c,
- src/gnac-prefs.h, src/gnac-ui.c, src/gnac-ui.h, src/gnac.h,
- template.c: First commit
+2010-05-27 Benoît Dupasquier <bdupasqu src gnome org>
+ * *: The ChangeLog is auto-generated when releasing. If you are
+ seeing this, use 'git log' for a detailed list of changes.
diff --git a/INSTALL b/INSTALL
index 8b82ade..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,10 +2,12 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
- This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
Basic Installation
==================
@@ -13,7 +15,11 @@ Basic Installation
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -42,7 +48,7 @@ may remove or edit it.
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
-The simplest way to compile this package is:
+ The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
- the package.
+ the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
@@ -67,8 +83,15 @@ The simplest way to compile this package is:
all sorts of other programs in order to regenerate files that came
with the distribution.
- 6. Often, you can also type `make uninstall' to remove the installed
- files again.
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
Compilers and Options
=====================
@@ -93,7 +116,8 @@ same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
@@ -120,7 +144,8 @@ Installation Names
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
@@ -131,15 +156,46 @@ Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-Optional Features
-=================
-
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
@@ -152,6 +208,13 @@ find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
Particular systems
==================
@@ -159,7 +222,7 @@ Particular systems
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
- ./configure CC="cc -Ae"
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
@@ -174,6 +237,16 @@ and if that doesn't work, try
./configure CC="cc -nodtk"
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
Specifying the System Type
==========================
@@ -189,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms:
- OS KERNEL-OS
+ OS
+ KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
@@ -277,7 +351,7 @@ operates.
`configure' can determine that directory automatically.
`--prefix=DIR'
- Use DIR as the installation prefix. *Note Installation Names::
+ Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
diff --git a/Makefile.am b/Makefile.am
index b851178..ed10711 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,3 +24,16 @@ DISTCLEANFILES = \
$(INTLTOOL_BUILT)
DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
+
+dist-hook:
+ @if test -d "$(srcdir)/.git"; then \
+ echo 'Creating ChangeLog' && \
+ ( cd "$(top_srcdir)" && \
+ echo '# Generated by Makefile. Do not edit.'; echo; \
+ $(top_srcdir)/missing --run git log --stat ) > ChangeLog.tmp \
+ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
+ || ( rm -f ChangeLog.tmp ; \
+ echo 'Failed to generate ChangeLog' >&2 ); \
+ else \
+ echo 'A git clone is required to generate a ChangeLog' >&2; \
+ fi
diff --git a/NEWS b/NEWS
index 5dc89fe..2643533 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
Gnac -- History of visible changes.
-Copyright (C) 2007 - 2009, Gnac
+Copyright (C) 2007 - 2010, Gnac
See the end for copying conditions.
Version 0.2.1 (August 2009)
@@ -35,7 +35,7 @@ Version 0.1 (July 2008)
---------------------------------------------
Copying information:
-Copyright (C) 2007 - 2009, Gnac
+Copyright (C) 2007 - 2010, Gnac
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/autogen.sh b/autogen.sh
index 43cd62e..6058ffe 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,7 +7,7 @@ test -z "$srcdir" && srcdir=.
PKG_NAME="gnac"
(test -f $srcdir/configure.ac \
- && test -f $srcdir/src/gnac.h) || {
+ && test -f $srcdir/src/gnac-main.h) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
diff --git a/libgnac/libgnac-converter.c b/libgnac/libgnac-converter.c
index e74a20f..590298e 100644
--- a/libgnac/libgnac-converter.c
+++ b/libgnac/libgnac-converter.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -30,11 +30,11 @@
#include <glib/gi18n.h>
#include "libgnac-converter.h"
-#include "libgnac-profile.h"
#include "libgnac-debug.h"
#include "libgnac-error.h"
#include "libgnac-gst.h"
#include "libgnac-marshallers.h"
+#include "libgnac-profile.h"
// TODO add WARNING and PAUSED, and RESUMED ?
diff --git a/libgnac/libgnac-converter.h b/libgnac/libgnac-converter.h
index ed7f3a4..0c95134 100644
--- a/libgnac/libgnac-converter.h
+++ b/libgnac/libgnac-converter.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -93,7 +93,6 @@ libgnac_converter_get_type(void);
LibgnacOutputConfig *
libgnac_converter_get_config(LibgnacConverter *self);
-
GObject *
libgnac_converter_new(LibgnacMetadata *mdata);
diff --git a/libgnac/libgnac-debug.c b/libgnac/libgnac-debug.c
index a26d5e5..cc1cdc5 100644
--- a/libgnac/libgnac-debug.c
+++ b/libgnac/libgnac-debug.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-debug.h b/libgnac/libgnac-debug.h
index 9cbdc84..52eefd8 100644
--- a/libgnac/libgnac-debug.h
+++ b/libgnac/libgnac-debug.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -60,8 +60,6 @@
#define libgnac_critical
#endif
-
-
G_BEGIN_DECLS
extern gboolean LIBGNAC_DEBUG;
@@ -81,14 +79,12 @@ libgnac_critical_real(const gchar *func,
const gchar *format,
...);
-
void
libgnac_warning_real(const gchar *func,
- const gchar *file,
- gint line,
- const gchar *format,
- ...);
-
+ const gchar *file,
+ gint line,
+ const gchar *format,
+ ...);
void
libgnac_info(const gchar *format, ...);
diff --git a/libgnac/libgnac-error.c b/libgnac/libgnac-error.c
index 8d61ed9..7e54ba6 100644
--- a/libgnac/libgnac-error.c
+++ b/libgnac/libgnac-error.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-error.h b/libgnac/libgnac-error.h
index d458a3e..023c427 100644
--- a/libgnac/libgnac-error.h
+++ b/libgnac/libgnac-error.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,10 +28,10 @@
#include <glib.h>
-G_BEGIN_DECLS
-
#define LIBGNAC_ERROR libgnac_error_quark()
+G_BEGIN_DECLS
+
typedef enum
{
LIBGNAC_ERROR_MISSING_PLUGIN,
@@ -44,7 +44,7 @@ typedef enum
} LibgnacError;
-GQuark libgnac_error_quark (void) G_GNUC_CONST;
+GQuark libgnac_error_quark(void) G_GNUC_CONST;
G_END_DECLS
diff --git a/libgnac/libgnac-gst-utils.c b/libgnac/libgnac-gst-utils.c
index 4802ce9..8141d42 100644
--- a/libgnac/libgnac-gst-utils.c
+++ b/libgnac/libgnac-gst-utils.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-gst-utils.h b/libgnac/libgnac-gst-utils.h
index 9f3e0ae..04a6176 100644
--- a/libgnac/libgnac-gst-utils.h
+++ b/libgnac/libgnac-gst-utils.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -32,40 +32,36 @@
G_BEGIN_DECLS
-
GstElement *
libgnac_gstu_make_pipeline_element(GstElement *bin,
- const gchar *element,
- const gchar *name,
- GError **error);
+ const gchar *element,
+ const gchar *name,
+ GError **error);
GstElement *
libgnac_gstu_pipeline_new(GError **error);
-
gboolean
libgnac_gstu_bin_add(GstElement *bin,
- GstElement *elem,
- GError **error);
+ GstElement *elem,
+ GError **error);
gboolean
libgnac_gstu_element_link(GstElement *src,
- GstElement *dst,
- GError **error);
+ GstElement *dst,
+ GError **error);
GstPadLinkReturn
libgnac_gstu_pad_link(GstPad *src,
- GstPad *sink,
- GError **error);
-
+ GstPad *sink,
+ GError **error);
gboolean
-libgnac_gstu_get_compatible_pad(GstElement *element,
- GstPad *pad,
- GstCaps *caps,
- const gchar *type);
+libgnac_gstu_get_compatible_pad(GstElement *element,
+ GstPad *pad,
+ GstCaps *caps,
+ const gchar *type);
G_END_DECLS
#endif /* __LIBGNAC_GST_UTILS_H__ */
-
diff --git a/libgnac/libgnac-gst.c b/libgnac/libgnac-gst.c
index 9ac6c11..8811c71 100644
--- a/libgnac/libgnac-gst.c
+++ b/libgnac/libgnac-gst.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -31,8 +31,8 @@
#include "libgnac-debug.h"
#include "libgnac-error.h"
-#include "libgnac-gst-utils.h"
#include "libgnac-gst.h"
+#include "libgnac-gst-utils.h"
#define libgnac_gst_element_add_ghost_pad(element, pad, name) \
diff --git a/libgnac/libgnac-gst.h b/libgnac/libgnac-gst.h
index 5855455..62119ad 100644
--- a/libgnac/libgnac-gst.h
+++ b/libgnac/libgnac-gst.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -32,29 +32,29 @@
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
-#include "libgnac-profile.h"
-#include "libgnac-media-item.h"
#include "libgnac-converter.h"
+#include "libgnac-media-item.h"
+#include "libgnac-profile.h"
G_BEGIN_DECLS
void
libgnac_gst_run(LibgnacMediaItem *item,
- GError **error);
+ GError **error);
void
libgnac_gst_stop(LibgnacMediaItem *item,
- GError **error);
+ GError **error);
void
libgnac_gst_pause(LibgnacMediaItem *item,
- GError **error);
+ GError **error);
void
libgnac_gst_build_pipeline(LibgnacMediaItem *item,
LibgnacProfile *profile,
gboolean has_video,
- GError **error);
+ GError **error);
void
libgnac_gst_clean_pipeline(LibgnacMediaItem *item);
diff --git a/libgnac/libgnac-marshallers.c b/libgnac/libgnac-marshallers.c
index f2dc927..3b5652d 100644
--- a/libgnac/libgnac-marshallers.c
+++ b/libgnac/libgnac-marshallers.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -24,6 +24,7 @@
*/
#include <glib-object.h>
+
#include "libgnac-marshallers.h"
#ifdef G_ENABLE_DEBUG
diff --git a/libgnac/libgnac-marshallers.h b/libgnac/libgnac-marshallers.h
index c462d1b..2f03b8f 100644
--- a/libgnac/libgnac-marshallers.h
+++ b/libgnac/libgnac-marshallers.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -31,28 +31,31 @@
G_BEGIN_DECLS
/* VOID:STRING,STRING,POINTER */
-extern void g_cclosure_user_marshal_VOID__STRING_STRING_POINTER (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+extern void g_cclosure_user_marshal_VOID__STRING_STRING_POINTER(
+ GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* VOID:UINT,FLOAT,UINT64 */
-extern void g_cclosure_user_marshal_VOID__UINT_FLOAT_UINT64 (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+extern void g_cclosure_user_marshal_VOID__UINT_FLOAT_UINT64(
+ GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
/* BOOLEAN:POINTER */
-extern void g_cclosure_user_marshal_BOOLEAN__POINTER (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data);
+extern void g_cclosure_user_marshal_BOOLEAN__POINTER(
+ GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
G_END_DECLS
diff --git a/libgnac/libgnac-media-item.c b/libgnac/libgnac-media-item.c
index 05c0ebd..13c692c 100644
--- a/libgnac/libgnac-media-item.c
+++ b/libgnac/libgnac-media-item.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -31,8 +31,8 @@
#include "libgnac-debug.h"
#include "libgnac-error.h"
-#include "libgnac-gst-utils.h"
#include "libgnac-gst.h"
+#include "libgnac-gst-utils.h"
#include "libgnac-metadata.h"
#include "libgnac-output.h"
diff --git a/libgnac/libgnac-media-item.h b/libgnac/libgnac-media-item.h
index 6aa1ac3..4769612 100644
--- a/libgnac/libgnac-media-item.h
+++ b/libgnac/libgnac-media-item.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -36,27 +36,26 @@ G_BEGIN_DECLS
/* Encoder item that handle a file conversion */
-
typedef struct
{
- gpointer parent;
- GFile *source;
- GFile *destination;
- LibgnacProfile *profile;
- GstElement *pipeline;
- GstElement *audio_encoder;
- GstElement *muxer;
- GstElement *video_encoder;
- GstBus *bus;
- guint timeout_id;
- gint64 pos;
+ gpointer parent;
+ GFile *source;
+ GFile *destination;
+ LibgnacProfile *profile;
+ GstElement *pipeline;
+ GstElement *audio_encoder;
+ GstElement *muxer;
+ GstElement *video_encoder;
+ GstBus *bus;
+ guint timeout_id;
+ gint64 pos;
} LibgnacMediaItem;
LibgnacMediaItem *
-libgnac_item_new(GFile *source,
- LibgnacProfile *profile,
- gpointer parent);
+libgnac_item_new(GFile *source,
+ LibgnacProfile *profile,
+ gpointer parent);
void
libgnac_item_build(LibgnacMediaItem *item,
@@ -90,17 +89,15 @@ libgnac_item_clear_event_src(LibgnacMediaItem *item);
/* Callbacks */
void
-libgnac_item_eos_cb(GstBus *bus,
+libgnac_item_eos_cb(GstBus *bus,
GstMessage *message,
gpointer data);
void
-libgnac_item_error_cb(GstBus *bus,
+libgnac_item_error_cb(GstBus *bus,
GstMessage *message,
gpointer data);
G_END_DECLS
#endif /* __LIBGNAC_MEDIA_ITEM_H__ */
-
-
diff --git a/libgnac/libgnac-metadata-tags.h b/libgnac/libgnac-metadata-tags.h
index e0732a1..944539d 100644
--- a/libgnac/libgnac-metadata-tags.h
+++ b/libgnac/libgnac-metadata-tags.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-metadata.c b/libgnac/libgnac-metadata.c
index 5bc94e8..5c6a773 100644
--- a/libgnac/libgnac-metadata.c
+++ b/libgnac/libgnac-metadata.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-metadata.h b/libgnac/libgnac-metadata.h
index 630b362..39d5a5c 100644
--- a/libgnac/libgnac-metadata.h
+++ b/libgnac/libgnac-metadata.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-output.c b/libgnac/libgnac-output.c
index f5a98e2..6001436 100644
--- a/libgnac/libgnac-output.c
+++ b/libgnac/libgnac-output.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/libgnac/libgnac-output.h b/libgnac/libgnac-output.h
index a3b52be..615a227 100644
--- a/libgnac/libgnac-output.h
+++ b/libgnac/libgnac-output.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,8 +29,6 @@
#include <gio/gio.h>
#include <glib.h>
-G_BEGIN_DECLS
-
#define RENAME_PATTERN_SEPARATOR '%'
#define RENAME_PATTERN_ARTIST 'a'
@@ -65,6 +63,8 @@ G_BEGIN_DECLS
#define LIBGNAC_RENAME_PATTERN_GET_REGEX(o) \
(((LibgnacRenamePattern*)(o))->regex)
+G_BEGIN_DECLS
+
typedef struct {
const GRegex *regex;
gchar *replace;
@@ -80,12 +80,12 @@ typedef enum
} GnacFolderId;
typedef struct {
- gchar *extension;
- gboolean strip_special;
- gchar *folder_hierarchy;
- gchar *folder_path;
- gchar *rename_pattern;
- GnacFolderId folder_type;
+ gchar *extension;
+ gboolean strip_special;
+ gchar *folder_hierarchy;
+ gchar *folder_path;
+ gchar *rename_pattern;
+ GnacFolderId folder_type;
} LibgnacOutputConfig;
@@ -93,9 +93,9 @@ void
libgnac_output_finalize(void);
GFile *
-libgnac_output_build_output(GFile *source,
- LibgnacOutputConfig *config,
- GError **error);
+libgnac_output_build_output(GFile *source,
+ LibgnacOutputConfig *config,
+ GError **error);
gchar *
libgnac_output_get_preview_from_pattern(const gchar *pattern,
diff --git a/libgnac/libgnac-profile.h b/libgnac/libgnac-profile.h
index 54aa290..3fac559 100644
--- a/libgnac/libgnac-profile.h
+++ b/libgnac/libgnac-profile.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -40,5 +40,3 @@ typedef struct
G_END_DECLS
#endif /* __LIBGNAC_PROFILE_H__ */
-
-
diff --git a/src/Makefile.am b/src/Makefile.am
index 3227b53..1d1b127 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,6 @@ SUBDIRS = profiles
bin_PROGRAMS = gnac
gnac_SOURCES = \
- gnac.h \
gnac-bars.h \
gnac-bars.c \
gnac-main.h \
diff --git a/src/gnac-bars.c b/src/gnac-bars.c
index f9618a9..23d155b 100644
--- a/src/gnac-bars.c
+++ b/src/gnac-bars.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-bars.h b/src/gnac-bars.h
index 37e0e47..e76ec2e 100644
--- a/src/gnac-bars.h
+++ b/src/gnac-bars.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,6 +28,8 @@
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
void
gnac_bars_new(GtkWidget *window,
GtkWidget **menubar,
@@ -76,4 +78,6 @@ gnac_bars_activate_clear(gboolean activate);
void
gnac_bars_activate_preferences(gboolean activate);
+G_END_DECLS
+
#endif /* GNAC_BARS_H */
diff --git a/src/gnac-file-list.c b/src/gnac-file-list.c
index 5e936b2..2432304 100644
--- a/src/gnac-file-list.c
+++ b/src/gnac-file-list.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -26,7 +26,6 @@
#include <gdk/gdkkeysyms.h>
#include <glib-object.h>
-#include "gnac.h"
#include "gnac-bars.h"
#include "gnac-file-list.h"
#include "gnac-main.h"
@@ -227,13 +226,13 @@ gnac_file_list_new(void)
/* Connect signals */
g_signal_connect(G_OBJECT(model), "row-inserted",
- (GCallback) gnac_file_list_on_row_inserted_cb, NULL);
+ G_CALLBACK(gnac_file_list_on_row_inserted_cb), NULL);
/* configure selection */
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
g_signal_connect(G_OBJECT(selection), "changed",
- (GCallback) gnac_file_list_selection_changed_cb, NULL);
+ G_CALLBACK(gnac_file_list_selection_changed_cb), NULL);
g_object_unref(model);
@@ -702,7 +701,7 @@ gnac_file_list_on_button_pressed(GtkWidget *treeview,
{
/* left click on an empty line */
if (event->button == 1 && !expanded) {
- gnac_on_ui_add_cb(treeview, NULL);
+ gnac_on_ui_add_cb(NULL, NULL);
ret = TRUE;
}
}
diff --git a/src/gnac-file-list.h b/src/gnac-file-list.h
index 5ba20a3..19f029b 100644
--- a/src/gnac-file-list.h
+++ b/src/gnac-file-list.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,14 +29,15 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
enum {
COL_STOCK,
COL_URI,
COL_DISPLAY,
COL_TOOLTIP,
NUM_COLS
- };
-
+};
GtkWidget *
gnac_file_list_new(void);
@@ -97,7 +98,6 @@ gnac_file_list_select_row_and_follow(GtkTreeRowReference *reference);
void
gnac_file_list_select_uri_and_follow(const gchar *uri);
-
void
gnac_file_list_hide_visual_bar(void);
@@ -142,4 +142,6 @@ gnac_file_list_display_uri(GtkTreeViewColumn *tree_column,
void
gnac_file_list_destroy(void);
+G_END_DECLS
+
#endif /* GNAC_FILE_LIST_H */
diff --git a/src/gnac-gconf.c b/src/gnac-gconf.c
index 1426fdc..e084222 100644
--- a/src/gnac-gconf.c
+++ b/src/gnac-gconf.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -31,7 +31,6 @@
#include <glib/gi18n.h>
#include <stdlib.h>
-#include "gnac.h"
#include "gnac-gconf.h"
static const gchar *gnac_gconf_paths[] = {
@@ -180,7 +179,7 @@ gconf_key_changed_cb(GConfClient* client,
GConfEntry* entry,
gpointer user_data)
{
- const char *key = NULL;
+ const gchar *key = NULL;
GConfValue *value = NULL;
if (entry != NULL)
diff --git a/src/gnac-gconf.h b/src/gnac-gconf.h
index a3ab9d4..6fa17ca 100644
--- a/src/gnac-gconf.h
+++ b/src/gnac-gconf.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -32,6 +32,8 @@
#define GCONF_PATH "/apps/gnac"
+G_BEGIN_DECLS
+
typedef enum {
GNAC_GCONF_TRAY_ICON,
GNAC_GCONF_CLEAR_SOURCE,
@@ -55,24 +57,29 @@ gboolean
gnac_gconf_get_boolean(GnacGConfParam param);
void
-gnac_gconf_set_boolean(GnacGConfParam param, gboolean value);
+gnac_gconf_set_boolean(GnacGConfParam param,
+ gboolean value);
gint
gnac_gconf_get_int(GnacGConfParam param);
void
-gnac_gconf_set_int(GnacGConfParam param, gint value);
+gnac_gconf_set_int(GnacGConfParam param,
+ gint value);
gchar *
gnac_gconf_get_string(GnacGConfParam param);
void
-gnac_gconf_set_string(GnacGConfParam param, const gchar *value);
+gnac_gconf_set_string(GnacGConfParam param,
+ const gchar *value);
/*void
-gconf_key_changed_cb(GConfClient* client,
- guint cnxn_id,
- GConfEntry* entry,
- gpointer user_data);*/
+gconf_key_changed_cb(GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data);*/
+
+G_END_DECLS
#endif /* GNAC_GCONF_H */
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 73d09fe..ce0d211 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -35,7 +35,6 @@
#include <gst/pbutils/pbutils.h>
#include <stdlib.h>
-#include "gnac.h"
#include "gnac-bars.h"
#include "gnac-file-list.h"
#include "gnac-gconf.h"
@@ -245,6 +244,33 @@ gnac_add(GFile *file)
static void
+gnac_remove_track(gpointer data,
+ gpointer user_data)
+{
+ GError *error = NULL;
+ GFile *file;
+ GtkTreeRowReference *ref;
+ gchar *uri = NULL;
+
+ ref = (GtkTreeRowReference*) data;
+
+ gnac_file_list_get(ref, &uri);
+ file = g_file_new_for_uri(uri);
+
+ libgnac_converter_remove(converter, file, &error);
+ if (error)
+ {
+ g_printerr("%s: %s\n", _("Error"), error->message);
+ g_clear_error(&error);
+ }
+
+ g_object_unref(file);
+ gtk_tree_row_reference_free(ref);
+ g_free(uri);
+}
+
+
+static void
gnac_files_names_list_foreach(gpointer data,
gpointer user_data)
{
@@ -516,33 +542,6 @@ gnac_add_file(GFile *file)
}
-static void
-gnac_about_url_hook(GtkAboutDialog *dialog,
- const gchar *url,
- gpointer user_data)
-{
- GError *error = NULL;
- if (!gtk_show_uri(gtk_widget_get_screen(GTK_WIDGET(dialog)),
- url, gtk_get_current_event_time(), &error))
- {
- g_printerr(_("Could not open link %s: %s\n"), url, error->message);
- g_error_free(error);
- }
-}
-
-
-static void
-gnac_about_email_hook(GtkAboutDialog *dialog,
- const gchar *email_address,
- gpointer user_data)
-{
- gchar *uri;
- uri = g_strdup_printf("mailto:%s", email_address);
- gnac_about_url_hook(dialog, uri, user_data);
- g_free(uri);
-}
-
-
static gboolean
gnac_confirm_exit(void)
{
@@ -558,7 +557,7 @@ gnac_confirm_exit(void)
_("A conversion is currently running..."),
_("Are you sure you want to quit?"));
- gtk_window_set_title(GTK_WINDOW(dialog), APPNAME);
+ gtk_window_set_title(GTK_WINDOW(dialog), PACKAGE_NAME);
response = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -703,7 +702,7 @@ gnac_on_converter_overwrite_cb(LibgnacConverter *converter,
_("File %s already exists...\nOverwrite?"),
g_file_info_get_display_name(info));
- gtk_window_set_title(GTK_WINDOW(dialog), APPNAME);
+ gtk_window_set_title(GTK_WINDOW(dialog), PACKAGE_NAME);
checkbox = gtk_check_button_new_with_label(_("Remember my decision"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbox), FALSE);
@@ -1036,7 +1035,7 @@ gnac_on_ui_profile_changed_cb(GtkComboBox *box,
void
-gnac_on_ui_add_cb(GtkWidget *widget,
+gnac_on_ui_add_cb(GtkAction *action,
gpointer data)
{
GtkWidget *close_on_add_button;
@@ -1073,35 +1072,8 @@ gnac_on_ui_add_cb(GtkWidget *widget,
}
-static void
-gnac_remove_track(gpointer data,
- gpointer user_data)
-{
- GError *error = NULL;
- GFile *file;
- GtkTreeRowReference *ref;
- gchar *uri = NULL;
-
- ref = (GtkTreeRowReference*) data;
-
- gnac_file_list_get(ref, &uri);
- file = g_file_new_for_uri(uri);
-
- libgnac_converter_remove(converter, file, &error);
- if (error)
- {
- g_printerr("%s: %s\n", _("Error"), error->message);
- g_clear_error(&error);
- }
-
- g_object_unref(file);
- gtk_tree_row_reference_free(ref);
- g_free(uri);
-}
-
-
void
-gnac_on_ui_remove_cb(GtkWidget *widget,
+gnac_on_ui_remove_cb(GtkAction *action,
gpointer data)
{
GList *rows;
@@ -1114,7 +1086,7 @@ gnac_on_ui_remove_cb(GtkWidget *widget,
void
-gnac_on_ui_clear_cb(GtkWidget *widget,
+gnac_on_ui_clear_cb(GtkAction *action,
gpointer data)
{
GError *error = NULL;
@@ -1146,7 +1118,7 @@ gnac_on_ui_help_cb(GtkAction *action,
void
-gnac_on_ui_properties_cb(GtkWidget *widget,
+gnac_on_ui_properties_cb(GtkAction *action,
gpointer user_data)
{
gnac_properties_window_show();
@@ -1219,17 +1191,6 @@ gnac_on_file_monitor_changed_cb(GFileMonitor *monitor,
}*/
-G_GNUC_NORETURN static gboolean
-gnac_option_version_cb(const gchar *option_name,
- const gchar *value,
- gpointer data,
- GError **error)
-{
- g_print("%s %s\n", APPNAME, VERSION);
- exit(EXIT_SUCCESS);
-}
-
-
gint
main(gint argc,
gchar **argv)
@@ -1246,13 +1207,8 @@ main(gint argc,
/* Parse command line arguments */
gnac_options_init(argc, argv);
- /* make sure every window has its name and icon */
- g_set_application_name(APPNAME);
- gtk_window_set_default_icon_name("gnac");
-
- /* make the links clickable */
- gtk_about_dialog_set_url_hook(gnac_about_url_hook, NULL, NULL);
- gtk_about_dialog_set_email_hook(gnac_about_email_hook, NULL, NULL);
+ /* Set a name for the application */
+ g_set_application_name(PACKAGE_NAME);
/* Initialisation of libraries */
gdk_threads_init();
@@ -1274,6 +1230,7 @@ main(gint argc,
/* Initialise converter and connect signals */
metadata = LIBGNAC_METADATA(libgnac_metadata_new());
converter = LIBGNAC_CONVERTER(libgnac_converter_new(metadata));
+
g_signal_connect(converter, "allow-overwrite",
G_CALLBACK(gnac_on_converter_overwrite_cb), converter);
g_signal_connect(converter, "progress",
@@ -1296,6 +1253,7 @@ main(gint argc,
G_CALLBACK(gnac_on_converter_started_cb), converter);
g_signal_connect(converter, "stopped",
G_CALLBACK(gnac_on_converter_stopped_cb), converter);
+
gnac_ui_show();
/* Check if arguments have been passed through the command line */
diff --git a/src/gnac-main.h b/src/gnac-main.h
index 1b55170..3cf0792 100644
--- a/src/gnac-main.h
+++ b/src/gnac-main.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -31,6 +31,8 @@
#include "libgnac-converter.h"
+G_BEGIN_DECLS
+
typedef enum {
GNAC_AUDIO_EMPTY_STATE,
GNAC_AUDIO_FILE_ACTION_STATE,
@@ -54,23 +56,22 @@ gnac_on_ui_convert_cb(GtkWidget *widget,
void
gnac_on_ui_profile_changed_cb(GtkComboBox *box,
- gpointer data);
-
+ gpointer data);
void
gnac_on_ui_pause_cb(GtkWidget *widget,
gpointer data);
void
-gnac_on_ui_add_cb(GtkWidget *widget,
+gnac_on_ui_add_cb(GtkAction *action,
gpointer data);
void
-gnac_on_ui_remove_cb(GtkWidget *widget,
+gnac_on_ui_remove_cb(GtkAction *action,
gpointer data);
void
-gnac_on_ui_clear_cb(GtkWidget *widget,
+gnac_on_ui_clear_cb(GtkAction *action,
gpointer data);
void
@@ -82,7 +83,7 @@ gnac_on_ui_destroy_cb(GtkWidget *widget,
gpointer data);
void
-gnac_on_ui_properties_cb(GtkWidget *widget,
+gnac_on_ui_properties_cb(GtkAction *action,
gpointer user_data);
void
@@ -107,4 +108,6 @@ gnac_file_chooser_response_cb(GtkDialog *dialog,
gint response,
gpointer user_data);
+G_END_DECLS
+
#endif /* GNAC_MAIN_H */
diff --git a/src/gnac-options.c b/src/gnac-options.c
index 49101a9..334d2fd 100644
--- a/src/gnac-options.c
+++ b/src/gnac-options.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,7 +29,6 @@
#include <glib/gi18n.h>
-#include "gnac.h"
#include "gnac-main.h"
#include "gnac-options.h"
#include "libgnac-debug.h"
@@ -108,7 +107,7 @@ gnac_options_version_cb(const gchar *option_name,
gpointer data,
GError **error)
{
- g_print("%s %s\n", APPNAME, VERSION);
+ g_print("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
exit(EXIT_SUCCESS);
}
diff --git a/src/gnac-options.h b/src/gnac-options.h
index 93be034..0fc99f3 100644
--- a/src/gnac-options.h
+++ b/src/gnac-options.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -39,7 +39,8 @@ typedef struct {
extern GnacCmdLineOptions options;
void
-gnac_options_init(gint argc, gchar **argv);
+gnac_options_init(gint argc,
+ gchar **argv);
//void
//gnac_options_process_early(void);
diff --git a/src/gnac-playlist.c b/src/gnac-playlist.c
index 87bef3f..165f370 100755
--- a/src/gnac-playlist.c
+++ b/src/gnac-playlist.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-playlist.h b/src/gnac-playlist.h
index 9921e8d..bf8801a 100755
--- a/src/gnac-playlist.h
+++ b/src/gnac-playlist.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,6 +28,8 @@
#include <glib.h>
+G_BEGIN_DECLS
+
void
gnac_playlist_parse_m3u(GFile *file);
@@ -37,4 +39,6 @@ gnac_playlist_parse_pls(GFile *file);
void
gnac_playlist_parse_xspf(GFile *file);
+G_END_DECLS
+
#endif /* GNAC_PLAYLIST_H */
diff --git a/src/gnac-prefs.c b/src/gnac-prefs.c
index 93ede22..b1a0703 100644
--- a/src/gnac-prefs.c
+++ b/src/gnac-prefs.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-prefs.h b/src/gnac-prefs.h
index c3942f0..8146685 100644
--- a/src/gnac-prefs.h
+++ b/src/gnac-prefs.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,6 +28,8 @@
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
GtkWidget *
gnac_prefs_window_new(void);
@@ -100,4 +102,6 @@ gnac_on_close_prefs(GtkWidget *widget,
void
gnac_prefs_destroy(void);
+G_END_DECLS
+
#endif /* GNAC_PREFS_H */
diff --git a/src/gnac-properties.c b/src/gnac-properties.c
index b85044f..98d0d34 100644
--- a/src/gnac-properties.c
+++ b/src/gnac-properties.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-properties.h b/src/gnac-properties.h
index f7a9493..93de18e 100644
--- a/src/gnac-properties.h
+++ b/src/gnac-properties.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -34,12 +34,14 @@
#define GNAC_PROPERTIES_HEIGHT 380
#define GNAC_PROPERTIES_WIDTH 300
+G_BEGIN_DECLS
+
enum {
- PROPERTY_NAME,
- PROPERTY_VALUE,
- PROPERTY_TOOLTIP,
- PROPERTY_VISIBLE,
- PROPERTY_COLS
+ PROPERTY_NAME,
+ PROPERTY_VALUE,
+ PROPERTY_TOOLTIP,
+ PROPERTY_VISIBLE,
+ PROPERTY_COLS
};
/**
@@ -84,4 +86,6 @@ gnac_properties_on_delete_event(GtkWidget *widget,
void
gnac_properties_destroy(void);
+G_END_DECLS
+
#endif /* GNAC_PROPERTIES_H */
diff --git a/src/gnac-stock-items.c b/src/gnac-stock-items.c
index 8477137..222b361 100644
--- a/src/gnac-stock-items.c
+++ b/src/gnac-stock-items.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-stock-items.h b/src/gnac-stock-items.h
index 567b3c6..a16e71a 100644
--- a/src/gnac-stock-items.h
+++ b/src/gnac-stock-items.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,7 +28,11 @@
#define GNAC_STOCK_RESUME "gnac-resume"
+G_BEGIN_DECLS
+
void
gnac_stock_items_init(void);
+G_END_DECLS
+
#endif /* GNAC_STOCK_ITEMS_H */
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 0edb86b..7e17ee2 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -30,7 +30,6 @@
#include <glib/gi18n.h>
#include <glib/gprintf.h>
-#include "gnac.h"
#include "gnac-bars.h"
#include "gnac-file-list.h"
#include "gnac-main.h"
@@ -64,6 +63,33 @@ static guint n_targets = G_N_ELEMENTS(target_list);
extern GnacState state;
+static void
+gnac_about_url_hook(GtkAboutDialog *dialog,
+ const gchar *url,
+ gpointer user_data)
+{
+ GError *error = NULL;
+ if (!gtk_show_uri(gtk_widget_get_screen(GTK_WIDGET(dialog)),
+ url, gtk_get_current_event_time(), &error))
+ {
+ g_printerr(_("Could not open link %s: %s\n"), url, error->message);
+ g_error_free(error);
+ }
+}
+
+
+static void
+gnac_about_email_hook(GtkAboutDialog *dialog,
+ const gchar *email_address,
+ gpointer user_data)
+{
+ gchar *uri;
+ uri = g_strdup_printf("mailto:%s", email_address);
+ gnac_about_url_hook(dialog, uri, user_data);
+ g_free(uri);
+}
+
+
void
gnac_ui_new(void)
{
@@ -84,6 +110,13 @@ gnac_ui_new(void)
}
g_assert (err == NULL && gnac_main_builder != NULL);
+ /* make sure every window has an icon */
+ gtk_window_set_default_icon_name(PACKAGE);
+
+ /* make the links clickable */
+ gtk_about_dialog_set_url_hook(gnac_about_url_hook, NULL, NULL);
+ gtk_about_dialog_set_email_hook(gnac_about_email_hook, NULL, NULL);
+
file_list = gnac_file_list_new();
audio_profile_hbox = GTK_WIDGET(gtk_builder_get_object(gnac_main_builder, "audio_profile_hbox"));
@@ -267,7 +300,7 @@ gnac_ui_show_about_dialog(void)
about_dialog = GTK_WIDGET(gtk_builder_get_object(gnac_main_builder,
"aboutdialog"));
- gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), VERSION);
+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), PACKAGE_VERSION);
gtk_widget_show_all(about_dialog);
}
@@ -305,7 +338,6 @@ gnac_ui_show(void)
gnac_ui_show_progress(FALSE);
gnac_ui_show_pause(FALSE);
gnac_bars_activate_pause(FALSE);
-
}
diff --git a/src/gnac-ui.h b/src/gnac-ui.h
index 2bcd2de..fa0831a 100644
--- a/src/gnac-ui.h
+++ b/src/gnac-ui.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -30,6 +30,8 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
enum {
TARGET_STRING
};
@@ -49,7 +51,6 @@ gnac_ui_pulse_progress(void);
void
gnac_ui_show_pause(gboolean show);
-
void
gnac_ui_push_status(const gchar *message);
@@ -130,4 +131,6 @@ gnac_ui_trayicon_menu_quit(GtkWidget *widget,
gint
gnac_ui_show_error_trash(const gchar *filename);
+G_END_DECLS
+
#endif /* GNAC_UI_H */
diff --git a/src/gnac-utils.c b/src/gnac-utils.c
index e70a6b0..f0887b4 100644
--- a/src/gnac-utils.c
+++ b/src/gnac-utils.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
diff --git a/src/gnac-utils.h b/src/gnac-utils.h
index a4a1870..1a1ed29 100644
--- a/src/gnac-utils.h
+++ b/src/gnac-utils.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,6 +28,8 @@
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
gchar *
gnac_utils_get_display_name(const gchar *uri,
GError **error);
@@ -57,4 +59,6 @@ gnac_utils_scale_pixbuf(GdkPixbuf *pixbuf,
GdkPixbuf *
gnac_utils_add_border_to_pixbuf(GdkPixbuf *pixbuf);
+G_END_DECLS
+
#endif /* GNAC_UTILS_H */
diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c
index 62076d0..1ef1d81 100755
--- a/src/profiles/formats/gnac-profiles-aac.c
+++ b/src/profiles/formats/gnac-profiles-aac.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-aac.h"
-BasicFormatInfo aac_bfi =
-{
+
+BasicFormatInfo aac_bfi = {
PKGDATADIR "/profiles/gnac-profiles-aac.xml",
NULL,
PKGDATADIR "/profiles/aac.xml",
@@ -46,6 +46,7 @@ BasicFormatInfo aac_bfi =
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_aac_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -66,47 +67,52 @@ gnac_profiles_aac_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_aac_init(UpdateTextBufferFunc call_back)
{
- update_text_buffer_call_back = call_back;
GtkWidget *widget;
GtkWidget *widget2;
- gnac_profiles_default_init(&aac_bfi,
- G_CALLBACK(gnac_profiles_aac_generate_pipeline));
+ update_text_buffer_call_back = call_back;
+
+ gnac_profiles_default_init(&aac_bfi,
+ G_CALLBACK(gnac_profiles_aac_generate_pipeline));
- //Bitrate
+ // Bitrate
gnac_profiles_utils_all_in_one_for_combo(&aac_bfi,
- G_CALLBACK(gnac_profiles_aac_generate_pipeline), "combo-bitrate",
- "//variable[ id='bitrate']/*");
+ G_CALLBACK(gnac_profiles_aac_generate_pipeline),
+ "combo-bitrate", "//variable[ id='bitrate']/*");
- //Profile
+ // Profile
widget = gnac_profiles_utils_all_in_one_for_combo(&aac_bfi,
- G_CALLBACK(gnac_profiles_aac_generate_pipeline), "combo-profile",
- "//variable[ id='profile']/*");
- widget2 = GTK_WIDGET(gtk_builder_get_object(aac_bfi.builder, "label-profile")),
+ G_CALLBACK(gnac_profiles_aac_generate_pipeline),
+ "combo-profile", "//variable[ id='profile']/*");
+ widget2 = GTK_WIDGET(gtk_builder_get_object(aac_bfi.builder,
+ "label-profile")),
gnac_profiles_utils_add_description_tooltip(&aac_bfi,
- "//variable[ id='profile']/description", widget, widget2, NULL);
+ "//variable[ id='profile']/description", widget, widget2, NULL);
- //Tns
+ // Tns
widget = gnac_profiles_utils_all_in_one_for_check(&aac_bfi,
- G_CALLBACK(gnac_profiles_aac_generate_pipeline), "checkbutton-tns",
- "//variable[ id='tns']/*");
+ G_CALLBACK(gnac_profiles_aac_generate_pipeline),
+ "checkbutton-tns", "//variable[ id='tns']/*");
gnac_profiles_utils_add_description_tooltip(&aac_bfi,
- "//variable[ id='tns']/description", widget, NULL);
+ "//variable[ id='tns']/description", widget, NULL);
- //Outputformat
+ // Outputformat
widget = gnac_profiles_utils_all_in_one_for_combo(&aac_bfi,
- G_CALLBACK(gnac_profiles_aac_generate_pipeline), "combo-outputformat",
- "//variable[ id='outputformat']/*");
+ G_CALLBACK(gnac_profiles_aac_generate_pipeline),
+ "combo-outputformat", "//variable[ id='outputformat']/*");
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(aac_bfi.doc);
aac_bfi.doc = NULL;
return aac_bfi.format_id;
}
+
void
gnac_profiles_aac_generate_pipeline(GtkWidget *w)
{
@@ -115,45 +121,48 @@ gnac_profiles_aac_generate_pipeline(GtkWidget *w)
pipeline = gnac_profiles_default_generate_pipeline(&aac_bfi);
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &aac_bfi,
- "combo-bitrate","combo-outputformat", "combo-profile", NULL);
+ "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &aac_bfi,
- "checkbutton-tns", NULL);
+ "checkbutton-tns", NULL);
update_text_buffer_call_back(pipeline);
if (aac_bfi.pipeline != NULL) g_free(aac_bfi.pipeline);
+
aac_bfi.pipeline = pipeline;
}
+
void
gnac_profiles_aac_fullfill_fields(AudioProfileAAC *profile)
{
if (profile == NULL) {
gnac_profiles_default_fullfill_fields(NULL, &aac_bfi);
gnac_profiles_utils_reinit_values_combo(&aac_bfi,
- "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
+ "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
gnac_profiles_utils_reinit_values_check(&aac_bfi,
- "checkbutton-tns", NULL);
+ "checkbutton-tns", NULL);
} else {
gnac_profiles_utils_set_values_combo(&aac_bfi,
- "combo-bitrate", profile->bitrate,
- "combo-outputformat", profile->outputformat,
- "combo-profile", profile->profile,
- NULL);
+ "combo-bitrate", profile->bitrate,
+ "combo-outputformat", profile->outputformat,
+ "combo-profile", profile->profile,
+ NULL);
gnac_profiles_utils_set_values_check(&aac_bfi,
- "checkbutton-tns", profile->tns,
- NULL);
+ "checkbutton-tns", profile->tns,
+ NULL);
}
}
gchar *
-gnac_profiles_aac_get_combo_format_name()
+gnac_profiles_aac_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&aac_bfi);
}
+
void
gnac_profiles_aac_free_audio_profile(AudioProfileAAC *profile)
{
@@ -166,6 +175,7 @@ gnac_profiles_aac_free_audio_profile(AudioProfileAAC *profile)
g_free(profile);
}
+
AudioProfileAAC *
gnac_profiles_aac_generate_audio_profile(GError **error)
{
@@ -177,14 +187,14 @@ gnac_profiles_aac_generate_audio_profile(GError **error)
profile->generic = generic;
gnac_profiles_utils_get_values_combo_and_set(&aac_bfi,
- "combo-bitrate", &profile->bitrate,
- "combo-outputformat", &profile->outputformat,
- "combo-profile", &profile->profile,
- NULL);
+ "combo-bitrate", &profile->bitrate,
+ "combo-outputformat", &profile->outputformat,
+ "combo-profile", &profile->profile,
+ NULL);
gnac_profiles_utils_get_values_check_and_set(&aac_bfi,
- "checkbutton-tns", &profile->tns,
- NULL);
+ "checkbutton-tns", &profile->tns,
+ NULL);
return profile;
}
@@ -196,9 +206,10 @@ gnac_profiles_aac_get_widget(AudioProfileAAC *profile)
if (profile != NULL) {
gnac_profiles_aac_fullfill_fields(profile);
}
- return gnac_profiles_default_get_widget(profile,&aac_bfi);
+ return gnac_profiles_default_get_widget(profile, &aac_bfi);
}
+
void
gnac_profiles_aac_save_profile(AudioProfileAAC *profile)
{
@@ -206,11 +217,11 @@ gnac_profiles_aac_save_profile(AudioProfileAAC *profile)
doc = gnac_profiles_default_save_profile(profile->generic, &aac_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "bitrate", profile->bitrate,
- "outputformat", profile->outputformat,
- "profile", profile->profile,
- "tns", profile->tns,
- NULL);
+ "bitrate", profile->bitrate,
+ "outputformat", profile->outputformat,
+ "profile", profile->profile,
+ "tns", profile->tns,
+ NULL);
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
gnac_profiles_xml_engine_free_doc_xpath(doc);
@@ -218,39 +229,44 @@ gnac_profiles_aac_save_profile(AudioProfileAAC *profile)
AudioProfileAAC*
-gnac_profiles_aac_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_aac_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileAAC *profile;
profile = g_malloc(sizeof(AudioProfileAAC));
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "bitrate", &profile->bitrate,
- "outputformat", &profile->outputformat,
- "profile", &profile->profile,
- "tns", &profile->tns,
- NULL);
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "bitrate", &profile->bitrate,
+ "outputformat", &profile->outputformat,
+ "profile", &profile->profile,
+ "tns", &profile->tns,
+ NULL);
return profile;
}
+
void
gnac_profiles_aac_clean_up(void)
{
gnac_profiles_default_clean_up(&aac_bfi);
gnac_profiles_utils_free_combo_values(&aac_bfi,
- "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
+ "combo-bitrate", "combo-outputformat", "combo-profile", NULL);
gnac_profiles_utils_free_check_values(&aac_bfi,
- "checkbutton-tns", NULL);
+ "checkbutton-tns", NULL);
gnac_profiles_utils_free_basic_format_info_content(&aac_bfi);
}
+
const gchar *
gnac_profiles_aac_get_plugin_name(void)
{
return aac_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_aac_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-aac.h b/src/profiles/formats/gnac-profiles-aac.h
index 67474af..8e3472f 100644
--- a/src/profiles/formats/gnac-profiles-aac.h
+++ b/src/profiles/formats/gnac-profiles-aac.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,14 +23,17 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_AAC_H
-#define GNAC_PROFILES_FORMAT_AAC_H
+#ifndef GNAC_PROFILES_AAC_H
+#define GNAC_PROFILES_AAC_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
+
gchar *bitrate;
gchar *outputformat;
gchar *profile;
@@ -72,9 +75,12 @@ void
gnac_profiles_aac_save_profile(AudioProfileAAC *profile);
AudioProfileAAC *
-gnac_profiles_aac_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_aac_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_aac_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_AAC_H */
diff --git a/src/profiles/formats/gnac-profiles-flac.c b/src/profiles/formats/gnac-profiles-flac.c
index a225f22..e3c939d 100755
--- a/src/profiles/formats/gnac-profiles-flac.c
+++ b/src/profiles/formats/gnac-profiles-flac.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-flac.h"
-BasicFormatInfo flac_bfi =
-{
+
+BasicFormatInfo flac_bfi = {
PKGDATADIR "/profiles/gnac-profiles-flac.xml",
NULL,
PKGDATADIR "/profiles/flac.xml",
@@ -46,6 +46,7 @@ BasicFormatInfo flac_bfi =
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_flac_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -66,18 +67,20 @@ gnac_profiles_flac_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_flac_init(UpdateTextBufferFunc call_back)
{
update_text_buffer_call_back = call_back;
gnac_profiles_default_init(&flac_bfi,
- G_CALLBACK(gnac_profiles_flac_generate_pipeline));
+ G_CALLBACK(gnac_profiles_flac_generate_pipeline));
gnac_profiles_utils_all_in_one_for_slider(&flac_bfi,
- G_CALLBACK(gnac_profiles_flac_generate_pipeline), "slider-compression",
- "//variable[ id='compression']/*");
+ G_CALLBACK(gnac_profiles_flac_generate_pipeline),
+ "slider-compression", "//variable[ id='compression']/*");
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(flac_bfi.doc);
flac_bfi.doc = NULL;
@@ -92,35 +95,38 @@ gnac_profiles_flac_generate_pipeline(GtkWidget *w)
pipeline = gnac_profiles_default_generate_pipeline(&flac_bfi);
- pipeline = gnac_profiles_utils_add_properties_slider(pipeline,&flac_bfi,
- "slider-compression", NULL);
+ pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &flac_bfi,
+ "slider-compression", NULL);
update_text_buffer_call_back(pipeline);
if (flac_bfi.pipeline != NULL) g_free(flac_bfi.pipeline);
+
flac_bfi.pipeline = pipeline;
}
+
void
gnac_profiles_flac_fullfill_fields(AudioProfileFlac *profile)
{
if (profile == NULL) {
gnac_profiles_default_fullfill_fields(NULL, &flac_bfi);
- gnac_profiles_utils_reinit_values_slider(&flac_bfi,"slider-compression",
- NULL);
+ gnac_profiles_utils_reinit_values_slider(&flac_bfi,
+ "slider-compression", NULL);
} else {
- gnac_profiles_utils_set_values_slider(&flac_bfi,"slider-compression",
- profile->quality, NULL);
+ gnac_profiles_utils_set_values_slider(&flac_bfi,
+ "slider-compression", profile->quality, NULL);
}
}
gchar *
-gnac_profiles_flac_get_combo_format_name()
+gnac_profiles_flac_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&flac_bfi);
}
+
void
gnac_profiles_flac_free_audio_profile(AudioProfileFlac *profile)
{
@@ -128,6 +134,7 @@ gnac_profiles_flac_free_audio_profile(AudioProfileFlac *profile)
g_free(profile);
}
+
AudioProfileFlac *
gnac_profiles_flac_generate_audio_profile(GError **error)
{
@@ -139,7 +146,7 @@ gnac_profiles_flac_generate_audio_profile(GError **error)
profile->generic = generic;
gnac_profiles_utils_get_values_slider_and_set(&flac_bfi,
- "slider-compression", &profile->quality,NULL);
+ "slider-compression", &profile->quality, NULL);
return profile;
}
@@ -154,16 +161,17 @@ gnac_profiles_flac_get_widget(AudioProfileFlac *profile)
return gnac_profiles_default_get_widget(profile,&flac_bfi);
}
+
void
gnac_profiles_flac_save_profile(AudioProfileFlac *profile)
{
XMLDoc *doc;
- gchar *quality_str;
+ gchar *quality_str;
quality_str = gnac_profiles_utils_gdouble_to_gchararray(profile->quality);
doc = gnac_profiles_default_save_profile(profile->generic, &flac_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "quality", quality_str, NULL);
+ "quality", quality_str, NULL);
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
gnac_profiles_xml_engine_free_doc_xpath(doc);
@@ -172,15 +180,17 @@ gnac_profiles_flac_save_profile(AudioProfileFlac *profile)
AudioProfileFlac*
-gnac_profiles_flac_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_flac_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileFlac *profile;
gchar *quality_str;
profile = g_malloc(sizeof(AudioProfileFlac));
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "quality", &quality_str, NULL);
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "quality", &quality_str, NULL);
if (quality_str != NULL) {
profile->quality = gnac_profiles_utils_gchararray_to_gdouble(quality_str);
@@ -190,21 +200,23 @@ gnac_profiles_flac_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *ge
return profile;
}
+
void
gnac_profiles_flac_clean_up(void)
{
gnac_profiles_default_clean_up(&flac_bfi);
- gnac_profiles_utils_free_slider_values(&flac_bfi, "slider-compression",
- NULL);
+ gnac_profiles_utils_free_slider_values(&flac_bfi, "slider-compression", NULL);
gnac_profiles_utils_free_basic_format_info_content(&flac_bfi);
}
+
const gchar *
gnac_profiles_flac_get_plugin_name(void)
{
return flac_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_flac_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-flac.h b/src/profiles/formats/gnac-profiles-flac.h
index e36cbe9..cebea4e 100644
--- a/src/profiles/formats/gnac-profiles-flac.h
+++ b/src/profiles/formats/gnac-profiles-flac.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,14 +23,17 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_FLAC_H
-#define GNAC_PROFILES_FORMAT_FLAC_H
+#ifndef GNAC_PROFILES_FLAC_H
+#define GNAC_PROFILES_FLAC_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
+
gdouble quality;
}
AudioProfileFlac;
@@ -69,9 +72,12 @@ void
gnac_profiles_flac_save_profile(AudioProfileFlac *profile);
AudioProfileFlac *
-gnac_profiles_flac_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_flac_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_flac_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_FLAC_H */
diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c
index 51cb87a..62a1983 100755
--- a/src/profiles/formats/gnac-profiles-lame.c
+++ b/src/profiles/formats/gnac-profiles-lame.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-lame.h"
-BasicFormatInfo lame_bfi =
-{
+
+BasicFormatInfo lame_bfi = {
PKGDATADIR "/profiles/gnac-profiles-lame.xml",
NULL,
PKGDATADIR "/profiles/mp3-lame.xml",
@@ -49,13 +49,14 @@ gnac_profiles_lame_vbr_on_changed(GtkComboBox *widget);
static void
gnac_profiles_lame_advanced_bitrate_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static AudioProfileLame *
gnac_profiles_lame_allocate_audio_profile(void);
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_lame_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -76,90 +77,100 @@ gnac_profiles_lame_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_lame_init(UpdateTextBufferFunc call_back)
{
-
GtkWidget *widget;
GtkWidget *widget2;
gnac_profiles_default_init(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline));
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline));
update_text_buffer_call_back = call_back;
- //Bitrate
+ // Bitrate
gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-bitrate",
- "//variable[ id='bitrate']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-bitrate", "//variable[ id='bitrate']/*");
- //Quality
+ // Quality
gnac_profiles_utils_all_in_one_for_slider(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "slider-vbr-quality",
- "//variable[ id='quality']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "slider-vbr-quality", "//variable[ id='quality']/*");
- //compression ratio
+ // Compression ratio
widget = gnac_profiles_utils_all_in_one_for_slider(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "slider-compression-ratio",
- "//variable[ id='compression-ratio']/*");
- widget2 = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder, "label-compression-ratio")),
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "slider-compression-ratio", "//variable[ id='compression-ratio']/*");
+ widget2 = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder,
+ "label-compression-ratio")),
gnac_profiles_utils_add_description_tooltip(&lame_bfi,
- "//variable[ id='compression-ratio']/description", widget, widget2, NULL);
+ "//variable[ id='compression-ratio']/description",
+ widget, widget2, NULL);
- //Preset
+ // Preset
gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-preset",
- "//variable[ id='preset']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-preset", "//variable[ id='preset']/*");
- //Abr bitrate
+ // Abr bitrate
widget = gnac_profiles_utils_all_in_one_for_slider(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "slider-mean-abr",
- "//variable[ id='mean-bitrate']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "slider-mean-abr", "//variable[ id='mean-bitrate']/*");
- //Mode
+ // Mode
gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-mode",
- "//variable[ id='mode']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-mode", "//variable[ id='mode']/*");
- //Mean bitrate
+ // Mean bitrate
widget = gnac_profiles_utils_all_in_one_for_slider(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "slider-mean-vbr",
- "//variable[ id='mean-bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&lame_bfi, "checkbutton-mean-bitrate",
- G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle), widget);
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "slider-mean-vbr", "//variable[ id='mean-bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&lame_bfi,
+ "checkbutton-mean-bitrate",
+ G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle),
+ widget);
- //Min bitrate
+ // Min bitrate
widget = gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-min-vbr",
- "//variable[ id='min-bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&lame_bfi, "checkbutton-min-bitrate",
- G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle), widget);
-
- //Max bitrate
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-min-vbr", "//variable[ id='min-bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&lame_bfi,
+ "checkbutton-min-bitrate",
+ G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle),
+ widget);
+
+ // Max bitrate
widget = gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-max-vbr",
- "//variable[ id='max-bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&lame_bfi, "checkbutton-max-bitrate",
- G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle), widget);
-
- //Encoding mode
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-max-vbr", "//variable[ id='max-bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&lame_bfi,
+ "checkbutton-max-bitrate",
+ G_CALLBACK(gnac_profiles_lame_advanced_bitrate_on_toggle),
+ widget);
+
+ // Encoding mode
widget = gnac_profiles_utils_all_in_one_for_combo(&lame_bfi,
- G_CALLBACK(gnac_profiles_lame_generate_pipeline), "combo-encoding-mode",
- "//variable[ id='encoding-mode']/*");
+ G_CALLBACK(gnac_profiles_lame_generate_pipeline),
+ "combo-encoding-mode", "//variable[ id='encoding-mode']/*");
gnac_profiles_lame_vbr_on_changed(GTK_COMBO_BOX(widget));
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(lame_bfi.doc);
lame_bfi.doc = NULL;
return lame_bfi.format_id;
}
+
static void
gnac_profiles_lame_vbr_on_changed(GtkComboBox *widget)
{
- gint index;
gint i;
+ gint index;
GtkWidget *widgets_tab[16] = {
GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder, "label-vbr")),
@@ -182,12 +193,13 @@ gnac_profiles_lame_vbr_on_changed(GtkComboBox *widget)
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- for (i = 0; i<16; ++i) {
- if ( ((index == 2) && ((i >= 10) || (i <= 1)))
- || ((index == 0) && ((i == 2) || (i == 3)))
- || ((index == 1) && (((i > 11) || (i == 8) || (i == 9))))
- || ((index == 3) && ((i == 4) || (i == 5)))
- || ((index == 4) && ((i == 6) || (i == 7)))) {
+ for (i = 0; i < 16; ++i) {
+ if (((index == 2) && ((i >= 10) || (i <= 1)))
+ || ((index == 0) && ((i == 2) || (i == 3)))
+ || ((index == 1) && (((i > 11) || (i == 8) || (i == 9))))
+ || ((index == 3) && ((i == 4) || (i == 5)))
+ || ((index == 4) && ((i == 6) || (i == 7))))
+ {
gtk_widget_show(widgets_tab[i]);
} else {
gtk_widget_hide(widgets_tab[i]);
@@ -195,6 +207,7 @@ gnac_profiles_lame_vbr_on_changed(GtkComboBox *widget)
}
}
+
void
gnac_profiles_lame_generate_pipeline(GtkWidget *w)
{
@@ -204,7 +217,8 @@ gnac_profiles_lame_generate_pipeline(GtkWidget *w)
pipeline = gnac_profiles_default_generate_pipeline(&lame_bfi);
- widget = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder, "combo-encoding-mode"));
+ widget = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder,
+ "combo-encoding-mode"));
if (w == widget) {
gnac_profiles_lame_vbr_on_changed(GTK_COMBO_BOX(w));
@@ -212,136 +226,159 @@ gnac_profiles_lame_generate_pipeline(GtkWidget *w)
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- //Mode
+ // Mode
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &lame_bfi,
- "combo-mode", NULL);
+ "combo-mode", NULL);
- switch (index) {
+ switch (index)
+ {
case 0:
- //CBR
+ // CBR
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &lame_bfi,
- "combo-encoding-mode", "combo-bitrate", NULL);
+ "combo-encoding-mode", "combo-bitrate", NULL);
break;
+
case 1:
- //abr
+ // abr
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &lame_bfi,
- "combo-encoding-mode", NULL);
+ "combo-encoding-mode", NULL);
pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi,
- "slider-mean-abr", NULL);
+ "slider-mean-abr", NULL);
- //min bitrate max bitrate
- pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, &lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate",
- "combo-max-vbr", "checkbutton-max-bitrate",
- NULL );
+ // min bitrate max bitrate
+ pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline,
+ &lame_bfi,
+ "combo-min-vbr", "checkbutton-min-bitrate",
+ "combo-max-vbr", "checkbutton-max-bitrate",
+ NULL);
break;
+
case 2:
- //VBR
+ // VBR
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &lame_bfi,
- "combo-encoding-mode", NULL);
+ "combo-encoding-mode", NULL);
pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi,
- "slider-vbr-quality", NULL);
-
- //mean bitrate
- pipeline = gnac_profiles_utils_add_properties_checked_slider(pipeline, &lame_bfi,
- "slider-mean-vbr", "checkbutton-mean-bitrate", NULL);
-
- //min bitrate max bitrate
- pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, &lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate",
- "combo-max-vbr", "checkbutton-max-bitrate",
- NULL );
+ "slider-vbr-quality", NULL);
+
+ // mean bitrate
+ pipeline = gnac_profiles_utils_add_properties_checked_slider(pipeline,
+ &lame_bfi, "slider-mean-vbr", "checkbutton-mean-bitrate", NULL);
+
+ // min bitrate max bitrate
+ pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline,
+ &lame_bfi,
+ "combo-min-vbr", "checkbutton-min-bitrate",
+ "combo-max-vbr", "checkbutton-max-bitrate",
+ NULL);
break;
+
case 3:
- //Presets
+ // Presets
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &lame_bfi,
- "combo-preset", NULL);
+ "combo-preset", NULL);
break;
+
case 4:
- //compression ratio
+ // compression ratio
pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &lame_bfi,
- "slider-compression-ratio", NULL);
+ "slider-compression-ratio", NULL);
break;
+
default:
break;
}
-
- pipeline = gnac_profiles_utils_add_pipe(pipeline,lame_bfi.pipeline_multiplexers);
+ pipeline = gnac_profiles_utils_add_pipe(pipeline,
+ lame_bfi.pipeline_multiplexers);
update_text_buffer_call_back(pipeline);
if (lame_bfi.pipeline != NULL) g_free(lame_bfi.pipeline);
+
lame_bfi.pipeline = pipeline;
}
+
static void
gnac_profiles_lame_advanced_bitrate_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
- gnac_profiles_utils_on_toggle_optionnal_property(togglebutton,user_data);
+ gnac_profiles_utils_on_toggle_optionnal_property(togglebutton, user_data);
gnac_profiles_lame_generate_pipeline(GTK_WIDGET(togglebutton));
}
+
void
gnac_profiles_lame_fullfill_fields(AudioProfileLame *profile)
{
if (profile == NULL) {
gnac_profiles_utils_reinit_values_combo(&lame_bfi,
- "combo-mode","combo-bitrate", "combo-min-vbr", "combo-max-vbr",
- "combo-preset", "combo-encoding-mode", NULL);
+ "combo-mode",
+ "combo-bitrate",
+ "combo-min-vbr",
+ "combo-max-vbr",
+ "combo-preset",
+ "combo-encoding-mode",
+ NULL);
gnac_profiles_utils_reinit_values_slider(&lame_bfi,
- "slider-vbr-quality", "slider-compression-ratio", "slider-mean-vbr",
- "slider-mean-abr", NULL);
+ "slider-vbr-quality",
+ "slider-compression-ratio",
+ "slider-mean-vbr",
+ "slider-mean-abr",
+ NULL);
gnac_profiles_utils_set_active_toggle_button(&lame_bfi, FALSE,
- "checkbutton-mean-bitrate", "checkbutton-min-bitrate",
- "checkbutton-max-bitrate", NULL);
+ "checkbutton-mean-bitrate",
+ "checkbutton-min-bitrate",
+ "checkbutton-max-bitrate",
+ NULL);
} else {
gnac_profiles_utils_set_values_combo(&lame_bfi,
- "combo-encoding-mode", profile->encoding_mode,
- "combo-mode", profile->mode,
- NULL);
+ "combo-encoding-mode", profile->encoding_mode,
+ "combo-mode", profile->mode,
+ NULL);
if (profile->bitrate != NULL) {
gnac_profiles_utils_set_values_combo(&lame_bfi,
- "combo-bitrate", profile->bitrate, NULL);
+ "combo-bitrate", profile->bitrate, NULL);
} else if (profile->preset != NULL) {
gnac_profiles_utils_set_values_combo(&lame_bfi,
- "combo-preset", profile->preset, NULL);
+ "combo-preset", profile->preset, NULL);
} else if (profile->mean_abr != -1) {
- gnac_profiles_utils_set_values_slider(&lame_bfi,"slider-mean-abr",
- profile->mean_abr, NULL);
+ gnac_profiles_utils_set_values_slider(&lame_bfi,
+ "slider-mean-abr", profile->mean_abr, NULL);
gnac_profiles_utils_set_values_checked_combo(&lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate,
- NULL );
+ "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate,
+ NULL );
} else if (profile->quality != -1) {
- gnac_profiles_utils_set_values_slider(&lame_bfi,"slider-vbr-quality",
- profile->quality, NULL);
+ gnac_profiles_utils_set_values_slider(&lame_bfi,
+ "slider-vbr-quality", profile->quality, NULL);
gnac_profiles_utils_set_values_checked_combo(&lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate,
- NULL );
+ "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate,
+ NULL );
gnac_profiles_utils_set_values_checked_slider(&lame_bfi,
- "slider-mean-vbr", "checkbutton-mean-bitrate", profile->mean_bitrate,
- NULL);
+ "slider-mean-vbr", "checkbutton-mean-bitrate", profile->mean_bitrate,
+ NULL);
} else if (profile->compression_ratio != -1) {
- gnac_profiles_utils_set_values_slider(&lame_bfi,"slider-compression-ratio",
- profile->compression_ratio, NULL);
+ gnac_profiles_utils_set_values_slider(&lame_bfi,
+ "slider-compression-ratio", profile->compression_ratio, NULL);
}
}
}
+
gchar *
-gnac_profiles_lame_get_combo_format_name()
+gnac_profiles_lame_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&lame_bfi);
}
+
AudioProfileLame *
gnac_profiles_lame_allocate_audio_profile(void)
{
@@ -385,7 +422,6 @@ gnac_profiles_lame_generate_audio_profile(GError **error)
AudioProfileGeneric *generic;
AudioProfileLame *profile;
GtkWidget *widget;
- gint index;
generic = gnac_profiles_default_generate_audio_profile(&lame_bfi);
@@ -393,67 +429,78 @@ gnac_profiles_lame_generate_audio_profile(GError **error)
profile->generic = generic;
gnac_profiles_utils_get_values_combo_and_set(&lame_bfi,
- "combo-encoding-mode", &profile->encoding_mode,
- "combo-mode", &profile->mode, NULL);
+ "combo-encoding-mode", &profile->encoding_mode,
+ "combo-mode", &profile->mode,
+ NULL);
- widget = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder, "combo-encoding-mode"));
- index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- switch (index) {
+ widget = GTK_WIDGET(gtk_builder_get_object(lame_bfi.builder,
+ "combo-encoding-mode"));
+
+ switch (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)))
+ {
case 0:
gnac_profiles_utils_get_values_combo_and_set(&lame_bfi,
- "combo-bitrate", &profile->bitrate, NULL);
+ "combo-bitrate", &profile->bitrate, NULL);
break;
+
case 1:
gnac_profiles_utils_get_values_slider_and_set(&lame_bfi,
- "slider-mean-abr", &profile->mean_abr, NULL);
+ "slider-mean-abr", &profile->mean_abr, NULL);
- //min bitrate max bitrate
+ // min bitrate max bitrate
gnac_profiles_utils_get_values_checked_combo_and_set(&lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate,
- NULL );
+ "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate,
+ NULL );
break;
+
case 2:
- //VBR
+ // VBR
gnac_profiles_utils_get_values_slider_and_set(&lame_bfi,
- "slider-vbr-quality", &profile->quality, NULL);
+ "slider-vbr-quality", &profile->quality, NULL);
- //mean bitrate
+ // mean bitrate
gnac_profiles_utils_get_values_checked_slider_and_set(&lame_bfi,
- "slider-mean-vbr", "checkbutton-mean-bitrate", &profile->mean_bitrate,
- NULL);
+ "slider-mean-vbr", "checkbutton-mean-bitrate", &profile->mean_bitrate,
+ NULL);
- //min bitrate max bitrate
+ // min bitrate max bitrate
gnac_profiles_utils_get_values_checked_combo_and_set(&lame_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate,
- NULL );
+ "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate,
+ NULL );
break;
+
case 3:
- //Presets
+ // Presets
gnac_profiles_utils_get_values_combo_and_set(&lame_bfi,
- "combo-preset", &profile->preset, NULL);
+ "combo-preset", &profile->preset, NULL);
break;
+
case 4:
- //Compression ratio
+ // Compression ratio
gnac_profiles_utils_get_values_slider_and_set(&lame_bfi,
- "slider-compression-ratio", &profile->compression_ratio, NULL);
+ "slider-compression-ratio", &profile->compression_ratio, NULL);
break;
+
default:
break;
}
+
return profile;
}
+
GtkWidget *
gnac_profiles_lame_get_widget(AudioProfileLame *profile)
{
if (profile != NULL) {
gnac_profiles_lame_fullfill_fields(profile);
}
- return gnac_profiles_default_get_widget(profile,&lame_bfi);
+ return gnac_profiles_default_get_widget(profile, &lame_bfi);
}
+
void
gnac_profiles_lame_save_profile(AudioProfileLame *profile)
{
@@ -464,37 +511,37 @@ gnac_profiles_lame_save_profile(AudioProfileLame *profile)
gchar *compression_ratio_str = NULL;
if (profile->quality != -1) {
- quality_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->quality);
+ quality_str = gnac_profiles_utils_gdouble_to_gchararray(profile->quality);
if (profile->mean_bitrate != -1) {
mean_bitrate_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->mean_bitrate);
+ profile->mean_bitrate);
}
} else if (profile->mean_abr != -1) {
- mean_abr_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->mean_abr);
+ mean_abr_str = gnac_profiles_utils_gdouble_to_gchararray(profile->mean_abr);
} else if (profile->compression_ratio != -1) {
compression_ratio_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->compression_ratio);
+ profile->compression_ratio);
}
-
doc = gnac_profiles_default_save_profile(profile->generic, &lame_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "encoding-mode", profile->encoding_mode,
- "bitrate", (profile->bitrate == NULL) ? "" : profile->bitrate,
- "quality", (quality_str == NULL) ? "" : quality_str,
- "compression-ratio", (compression_ratio_str == NULL) ? "" : compression_ratio_str,
- "preset", (profile->preset == NULL) ? "" : profile->preset,
- "mean-abr", (mean_abr_str == NULL) ? "" : mean_abr_str,
- "mean-bitrate", (mean_bitrate_str == NULL) ? "" : mean_bitrate_str,
- "min-bitrate", (profile->min_bitrate == NULL) ? "" : profile->min_bitrate,
- "max-bitrate", (profile->max_bitrate == NULL) ? "" : profile->max_bitrate,
- "mode", profile->mode,
- NULL
- );
+ "encoding-mode", profile->encoding_mode,
+ "bitrate", (profile->bitrate == NULL) ? "" : profile->bitrate,
+ "quality", (quality_str == NULL) ? "" : quality_str,
+ "compression-ratio",
+ (compression_ratio_str == NULL) ? "" : compression_ratio_str,
+ "preset", (profile->preset == NULL) ? "" : profile->preset,
+ "mean-abr", (mean_abr_str == NULL) ? "" : mean_abr_str,
+ "mean-bitrate", (mean_bitrate_str == NULL) ? "" : mean_bitrate_str,
+ "min-bitrate", (profile->min_bitrate == NULL) ? "" : profile->min_bitrate,
+ "max-bitrate", (profile->max_bitrate == NULL) ? "" : profile->max_bitrate,
+ "mode", profile->mode,
+ NULL);
+
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
+
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(doc);
if (quality_str != NULL) g_free(quality_str);
if (mean_bitrate_str != NULL) g_free(mean_bitrate_str);
@@ -503,7 +550,8 @@ gnac_profiles_lame_save_profile(AudioProfileLame *profile)
AudioProfileLame *
-gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_lame_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileLame *profile;
gchar *quality_str = NULL;
@@ -513,19 +561,19 @@ gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *ge
profile = gnac_profiles_lame_allocate_audio_profile();
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "encoding-mode", &profile->encoding_mode,
- "bitrate", &profile->bitrate,
- "quality", &quality_str,
- "compression-ratio", &compression_ratio_str,
- "preset", &profile->preset,
- "mean-abr", &mean_abr_str,
- "mean-bitrate", &mean_bitrate_str,
- "min-bitrate", &profile->min_bitrate,
- "max-bitrate", &profile->max_bitrate,
- "mode", &profile->mode,
- NULL
- );
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "encoding-mode", &profile->encoding_mode,
+ "bitrate", &profile->bitrate,
+ "quality", &quality_str,
+ "compression-ratio", &compression_ratio_str,
+ "preset", &profile->preset,
+ "mean-abr", &mean_abr_str,
+ "mean-bitrate", &mean_bitrate_str,
+ "min-bitrate", &profile->min_bitrate,
+ "max-bitrate", &profile->max_bitrate,
+ "mode", &profile->mode,
+ NULL);
if (quality_str != NULL) {
profile->quality = gnac_profiles_utils_gchararray_to_gdouble(quality_str);
@@ -533,7 +581,7 @@ gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *ge
if (mean_bitrate_str != NULL) {
profile->mean_bitrate = gnac_profiles_utils_gchararray_to_gdouble(
- mean_bitrate_str);
+ mean_bitrate_str);
g_free(mean_bitrate_str);
}
} else if (mean_abr_str != NULL){
@@ -541,31 +589,42 @@ gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *ge
g_free(mean_abr_str);
} else if (compression_ratio_str != NULL) {
profile->compression_ratio = gnac_profiles_utils_gchararray_to_gdouble(
- compression_ratio_str);
+ compression_ratio_str);
g_free(compression_ratio_str);
}
return profile;
}
+
void
gnac_profiles_lame_clean_up(void) {
gnac_profiles_default_clean_up(&lame_bfi);
gnac_profiles_utils_free_combo_values(&lame_bfi,
- "combo-mode","combo-bitrate", "combo-min-vbr", "combo-max-vbr",
- "combo-preset", "combo-encoding-mode", NULL);
+ "combo-mode",
+ "combo-bitrate",
+ "combo-min-vbr",
+ "combo-max-vbr",
+ "combo-preset",
+ "combo-encoding-mode",
+ NULL);
gnac_profiles_utils_free_slider_values(&lame_bfi,
- "slider-vbr-quality", "slider-compression-ratio",
- "slider-mean-vbr", "slider-mean-abr", NULL);
+ "slider-vbr-quality",
+ "slider-compression-ratio",
+ "slider-mean-vbr",
+ "slider-mean-abr",
+ NULL);
gnac_profiles_utils_free_basic_format_info_content(&lame_bfi);
}
+
const gchar *
gnac_profiles_lame_get_plugin_name(void)
{
return lame_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_lame_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-lame.h b/src/profiles/formats/gnac-profiles-lame.h
index ebc35f9..fd84d44 100644
--- a/src/profiles/formats/gnac-profiles-lame.h
+++ b/src/profiles/formats/gnac-profiles-lame.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,24 +23,27 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_LAME_H
-#define GNAC_PROFILES_FORMAT_LAME_H
+#ifndef GNAC_PROFILES_LAME_H
+#define GNAC_PROFILES_LAME_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
- gchar *encoding_mode;
- gdouble quality;
- gdouble compression_ratio;
- gchar *bitrate;
- gchar *preset;
- gdouble mean_abr;
- gdouble mean_bitrate;
- gchar *min_bitrate;
- gchar *max_bitrate;
- gchar *mode;
+
+ gchar *encoding_mode;
+ gdouble quality;
+ gdouble compression_ratio;
+ gchar *bitrate;
+ gchar *preset;
+ gdouble mean_abr;
+ gdouble mean_bitrate;
+ gchar *min_bitrate;
+ gchar *max_bitrate;
+ gchar *mode;
}
AudioProfileLame;
@@ -78,9 +81,12 @@ void
gnac_profiles_lame_save_profile(AudioProfileLame *profile);
AudioProfileLame *
-gnac_profiles_lame_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_lame_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_lame_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_LAME_H */
diff --git a/src/profiles/formats/gnac-profiles-speex.c b/src/profiles/formats/gnac-profiles-speex.c
index 779650b..d887e03 100644
--- a/src/profiles/formats/gnac-profiles-speex.c
+++ b/src/profiles/formats/gnac-profiles-speex.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,7 @@
#include "gnac-profiles-speex.h"
-BasicFormatInfo speex_bfi =
-{
+BasicFormatInfo speex_bfi = {
PKGDATADIR "/profiles/gnac-profiles-speex.xml",
NULL,
PKGDATADIR "/profiles/speex.xml",
@@ -49,17 +48,18 @@ gnac_profiles_speex_bitrate_on_changed(GtkComboBox *widget);
static void
gnac_profiles_speex_advanced_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static void
gnac_profiles_speex_vad_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static AudioProfileSpeex *
gnac_profiles_speex_allocate_audio_profile(void);
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_speex_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -80,6 +80,7 @@ gnac_profiles_speex_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_speex_init(UpdateTextBufferFunc call_back)
{
@@ -89,92 +90,96 @@ gnac_profiles_speex_init(UpdateTextBufferFunc call_back)
update_text_buffer_call_back = call_back;
gnac_profiles_default_init(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline));
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline));
- //Bitrate
+ // Bitrate
widget = gnac_profiles_utils_all_in_one_for_slider(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "slider-bitrate-cbr",
- "//variable[ id='bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&speex_bfi, "checkbutton-bitrate-cbr",
- G_CALLBACK(gnac_profiles_speex_advanced_on_toggle), widget);
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "slider-bitrate-cbr", "//variable[ id='bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&speex_bfi,
+ "checkbutton-bitrate-cbr",
+ G_CALLBACK(gnac_profiles_speex_advanced_on_toggle), widget);
- //Bitrate-abr
+ // Bitrate-abr
gnac_profiles_utils_all_in_one_for_slider(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "slider-bitrate-abr",
- "//variable[ id='abr']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "slider-bitrate-abr", "//variable[ id='abr']/*");
- //Quality-cbr
+ // Quality-cbr
widget = gnac_profiles_utils_all_in_one_for_slider(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "slider-quality-cbr",
- "//variable[ id='quality-cbr']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "slider-quality-cbr", "//variable[ id='quality-cbr']/*");
- //Quality-vbr
+ // Quality-vbr
widget = gnac_profiles_utils_all_in_one_for_slider(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "slider-quality-vbr",
- "//variable[ id='quality-vbr']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "slider-quality-vbr", "//variable[ id='quality-vbr']/*");
gtk_scale_set_digits(GTK_SCALE(widget), 2);
- //vbr
+ // vbr
widget = gnac_profiles_utils_all_in_one_for_check(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "checkbutton-vbr",
- "//variable[ id='vbr']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "checkbutton-vbr", "//variable[ id='vbr']/*");
- //Complexity
+ // Complexity
widget2 = gnac_profiles_utils_all_in_one_for_slider(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "slider-complexity",
- "//variable[ id='complexity']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "slider-complexity", "//variable[ id='complexity']/*");
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "hbox-complexity"));
+ "hbox-complexity"));
gnac_profiles_utils_add_toggle_signal(&speex_bfi, "checkbutton-complexity",
- G_CALLBACK(gnac_profiles_speex_advanced_on_toggle), widget);
+ G_CALLBACK(gnac_profiles_speex_advanced_on_toggle), widget);
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-complexity"));
+ "checkbutton-complexity"));
gnac_profiles_utils_add_description_tooltip(&speex_bfi,
- "//variable[ id='complexity']/description", widget, widget2, NULL);
+ "//variable[ id='complexity']/description",
+ widget, widget2, NULL);
- //vad
+ // vad
widget = gnac_profiles_utils_all_in_one_for_check(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "checkbutton-vad",
- "//variable[ id='vad']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "checkbutton-vad", "//variable[ id='vad']/*");
gnac_profiles_utils_add_toggle_signal(&speex_bfi, "checkbutton-vad",
- G_CALLBACK(gnac_profiles_speex_vad_on_toggle), widget);
+ G_CALLBACK(gnac_profiles_speex_vad_on_toggle), widget);
gnac_profiles_utils_add_description_tooltip(&speex_bfi,
- "//variable[ id='vad']/description", widget, NULL);
+ "//variable[ id='vad']/description", widget, NULL);
- //dtx
+ // dtx
widget = gnac_profiles_utils_all_in_one_for_check(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "checkbutton-dtx",
- "//variable[ id='dtx']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "checkbutton-dtx", "//variable[ id='dtx']/*");
gnac_profiles_utils_add_description_tooltip(&speex_bfi,
- "//variable[ id='dtx']/description", widget, NULL);
+ "//variable[ id='dtx']/description", widget, NULL);
- //mode
+ // mode
widget = gnac_profiles_utils_all_in_one_for_combo(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "combo-mode",
- "//variable[ id='mode']/*");
- widget2 = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "hbox-mode"));
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "combo-mode", "//variable[ id='mode']/*");
+ widget2 = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder, "hbox-mode"));
gnac_profiles_utils_add_description_tooltip(&speex_bfi,
- "//variable[ id='mode']/description", widget, widget2, NULL);
+ "//variable[ id='mode']/description",
+ widget, widget2, NULL);
- //Bitrate mode
+ // Bitrate mode
widget = gnac_profiles_utils_all_in_one_for_combo(&speex_bfi,
- G_CALLBACK(gnac_profiles_speex_generate_pipeline), "combo-bitrate-mode",
- "//variable[ id='bitrate-mode']/*");
+ G_CALLBACK(gnac_profiles_speex_generate_pipeline),
+ "combo-bitrate-mode", "//variable[ id='bitrate-mode']/*");
gnac_profiles_speex_bitrate_on_changed(GTK_COMBO_BOX(widget));
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(speex_bfi.doc);
speex_bfi.doc = NULL;
return speex_bfi.format_id;
}
+
void
gnac_profiles_speex_bitrate_on_changed(GtkComboBox *widget)
{
- gint index;
gint i;
+ gint index;
GtkWidget *widgets_tab[8] = {
GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder, "checkbutton-bitrate-cbr")),
@@ -189,10 +194,11 @@ gnac_profiles_speex_bitrate_on_changed(GtkComboBox *widget)
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- for (i = 0; i<8; ++i) {
- if ( ((index == 0) && (i < 4))
- || ((index == 1) && ((i == 4) || (i == 5)))
- || ((index == 2) && ((i == 6) || (i == 7)))) {
+ for (i = 0; i < 8; ++i) {
+ if (((index == 0) && (i < 4))
+ || ((index == 1) && ((i == 4) || (i == 5)))
+ || ((index == 2) && ((i == 6) || (i == 7))))
+ {
gtk_widget_show(widgets_tab[i]);
} else {
gtk_widget_hide(widgets_tab[i]);
@@ -203,9 +209,10 @@ gnac_profiles_speex_bitrate_on_changed(GtkComboBox *widget)
GtkWidget *dtx;
vad = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-vad"));
+ "checkbutton-vad"));
dtx = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-dtx"));
+ "checkbutton-dtx"));
+
if (index == 0) {
gtk_widget_show(vad);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(vad))) {
@@ -218,9 +225,8 @@ gnac_profiles_speex_bitrate_on_changed(GtkComboBox *widget)
gtk_widget_show(dtx);
}
- gnac_profiles_utils_set_active_toggle_button(&speex_bfi, (index == 2),
- "checkbutton-vbr", NULL);
-
+ gnac_profiles_utils_set_active_toggle_button(&speex_bfi,
+ (index == 2), "checkbutton-vbr", NULL);
}
@@ -229,88 +235,95 @@ gnac_profiles_speex_generate_pipeline(GtkWidget *w)
{
GtkWidget *widget;
gchar *pipeline;
- gint index;
pipeline = gnac_profiles_default_generate_pipeline(&speex_bfi);
- widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder, "combo-bitrate-mode"));
+ widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
+ "combo-bitrate-mode"));
if (w == widget) {
gnac_profiles_speex_bitrate_on_changed(GTK_COMBO_BOX(w));
}
- index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
-
- switch (index) {
+ switch (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)))
+ {
case 0:
- pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &speex_bfi,
- "slider-quality-cbr", NULL);
+ pipeline = gnac_profiles_utils_add_properties_slider(pipeline,
+ &speex_bfi, "slider-quality-cbr", NULL);
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-bitrate-cbr"));
+ "checkbutton-bitrate-cbr"));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "slider-bitrate-cbr"));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1024,
- widget);
+ "slider-bitrate-cbr"));
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline,
+ "%.0f", 1024, widget);
}
+
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &speex_bfi,
- "checkbutton-vad", NULL);
+ "checkbutton-vad", NULL);
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-vad"));
+ "checkbutton-vad"));
+
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
- pipeline = gnac_profiles_utils_add_properties_check(pipeline, &speex_bfi,
- "checkbutton-dtx", NULL);
+ pipeline = gnac_profiles_utils_add_properties_check(pipeline,
+ &speex_bfi, "checkbutton-dtx", NULL);
}
break;
+
case 1:
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "slider-bitrate-abr"));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1024,
- widget);
+ "slider-bitrate-abr"));
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline,
+ "%.0f", 1024, widget);
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &speex_bfi,
- "checkbutton-dtx", NULL);
+ "checkbutton-dtx", NULL);
break;
+
case 2:
- pipeline = gnac_profiles_utils_add_properties_slider_format(pipeline, &speex_bfi,
- "%.2f", "slider-quality-vbr", NULL);
+ pipeline = gnac_profiles_utils_add_properties_slider_format(pipeline,
+ &speex_bfi, "%.2f", "slider-quality-vbr", NULL);
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &speex_bfi,
- "checkbutton-vbr", NULL);
+ "checkbutton-vbr", NULL);
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &speex_bfi,
- "checkbutton-dtx", NULL);
+ "checkbutton-dtx", NULL);
break;
}
- pipeline = gnac_profiles_utils_add_properties_checked_slider(pipeline, &speex_bfi,
- "slider-complexity", "checkbutton-complexity", NULL);
+ pipeline = gnac_profiles_utils_add_properties_checked_slider(pipeline,
+ &speex_bfi, "slider-complexity", "checkbutton-complexity", NULL);
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &speex_bfi,
- "combo-mode", NULL);
+ "combo-mode", NULL);
+ pipeline = gnac_profiles_utils_add_pipe(pipeline,
+ speex_bfi.pipeline_multiplexers);
- pipeline = gnac_profiles_utils_add_pipe(pipeline,speex_bfi.pipeline_multiplexers);
update_text_buffer_call_back(pipeline);
if (speex_bfi.pipeline != NULL) g_free(speex_bfi.pipeline);
- speex_bfi.pipeline = pipeline;
+ speex_bfi.pipeline = pipeline;
}
+
void
gnac_profiles_speex_advanced_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
- gnac_profiles_utils_on_toggle_optionnal_property(togglebutton,user_data);
+ gnac_profiles_utils_on_toggle_optionnal_property(togglebutton, user_data);
gnac_profiles_speex_generate_pipeline(GTK_WIDGET(togglebutton));
}
+
void
gnac_profiles_speex_vad_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
GtkWidget *dtx;
dtx = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "checkbutton-dtx"));
+ "checkbutton-dtx"));
+
if (gtk_toggle_button_get_active(togglebutton)) {
gtk_widget_show(dtx);
} else {
@@ -318,6 +331,7 @@ gnac_profiles_speex_vad_on_toggle(GtkToggleButton *togglebutton,
}
}
+
void
gnac_profiles_speex_fullfill_fields(AudioProfileSpeex *profile)
{
@@ -325,59 +339,72 @@ gnac_profiles_speex_fullfill_fields(AudioProfileSpeex *profile)
if (profile == NULL) {
gnac_profiles_default_fullfill_fields(NULL, &speex_bfi);
- gnac_profiles_utils_reinit_values_combo(&speex_bfi,"combo-bitrate-mode",
- "combo-mode", NULL);
- gnac_profiles_utils_reinit_values_slider(&speex_bfi,"slider-quality-cbr",
- "slider-quality-vbr", "slider-bitrate-cbr", "slider-bitrate-abr",
- "slider-complexity", NULL);
- gnac_profiles_utils_reinit_values_check(&speex_bfi, "checkbutton-vad",
- "checkbutton-dtx", NULL);
+ gnac_profiles_utils_reinit_values_combo(&speex_bfi,
+ "combo-bitrate-mode",
+ "combo-mode",
+ NULL);
+ gnac_profiles_utils_reinit_values_slider(&speex_bfi,
+ "slider-quality-cbr",
+ "slider-quality-vbr",
+ "slider-bitrate-cbr",
+ "slider-bitrate-abr",
+ "slider-complexity",
+ NULL);
+ gnac_profiles_utils_reinit_values_check(&speex_bfi,
+ "checkbutton-vad",
+ "checkbutton-dtx",
+ NULL);
gnac_profiles_utils_set_active_toggle_button(&speex_bfi, FALSE,
- "checkbutton-complexity", "checkbutton-bitrate-cbr", NULL);
+ "checkbutton-complexity", "checkbutton-bitrate-cbr", NULL);
} else {
- gnac_profiles_default_fullfill_fields(profile->generic,&speex_bfi);
+ gnac_profiles_default_fullfill_fields(profile->generic, &speex_bfi);
gnac_profiles_utils_set_values_checked_slider(&speex_bfi,
- "slider-complexity", "checkbutton-complexity", profile->complexity, NULL);
+ "slider-complexity", "checkbutton-complexity", profile->complexity,
+ NULL);
gnac_profiles_utils_set_values_combo(&speex_bfi,
- "combo-mode", profile->mode, NULL);
+ "combo-mode", profile->mode, NULL);
gnac_profiles_utils_set_values_check(&speex_bfi,
- "checkbutton-vad", profile->vad, "checkbutton-dtx", profile->dtx, NULL);
+ "checkbutton-vad", profile->vad, "checkbutton-dtx", profile->dtx, NULL);
+
+ widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
+ "combo-bitrate-mode"));
- widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder, "combo-bitrate-mode"));
if (profile->quality_cbr != -1) {
gnac_profiles_utils_set_values_slider(&speex_bfi, "slider-bitrate-cbr",
- profile->bitrate_cbr, NULL);
+ profile->bitrate_cbr, NULL);
if (profile->bitrate_cbr != 1) {
gnac_profiles_utils_set_values_checked_slider(&speex_bfi,
- "slider-bitrate-cbr", "checkbutton-bitrate-cbr", profile->bitrate_cbr,
- NULL);
+ "slider-bitrate-cbr", "checkbutton-bitrate-cbr",
+ profile->bitrate_cbr,
+ NULL);
}
- gtk_combo_box_set_active(GTK_COMBO_BOX(widget),0);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
} else if (profile->quality_vbr != -1) {
gnac_profiles_utils_set_active_toggle_button(&speex_bfi, TRUE,
- "checkbutton-vbr", NULL);
- gnac_profiles_utils_set_values_slider(&speex_bfi, "slider-quality-vbr",
- profile->quality_vbr, NULL);
- gtk_combo_box_set_active(GTK_COMBO_BOX(widget),2);
+ "checkbutton-vbr", NULL);
+ gnac_profiles_utils_set_values_slider(&speex_bfi,
+ "slider-quality-vbr", profile->quality_vbr, NULL);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 2);
} else {
- gnac_profiles_utils_set_values_slider(&speex_bfi, "slider-bitrate-abr",
- profile->bitrate_abr, NULL);
- gtk_combo_box_set_active(GTK_COMBO_BOX(widget),1);
+ gnac_profiles_utils_set_values_slider(&speex_bfi,
+ "slider-bitrate-abr", profile->bitrate_abr, NULL);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
}
}
}
gchar *
-gnac_profiles_speex_get_combo_format_name()
+gnac_profiles_speex_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&speex_bfi);
}
+
static AudioProfileSpeex *
gnac_profiles_speex_allocate_audio_profile(void)
{
@@ -397,6 +424,7 @@ gnac_profiles_speex_allocate_audio_profile(void)
return profile;
}
+
void
gnac_profiles_speex_free_audio_profile(AudioProfileSpeex *profile)
{
@@ -423,38 +451,42 @@ gnac_profiles_speex_generate_audio_profile(GError **error)
profile->generic = generic;
widget = GTK_WIDGET(gtk_builder_get_object(speex_bfi.builder,
- "combo-bitrate-mode"));
+ "combo-bitrate-mode"));
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
gnac_profiles_utils_get_values_combo_and_set(&speex_bfi,
- "combo-mode", &profile->mode, NULL);
+ "combo-mode", &profile->mode, NULL);
gnac_profiles_utils_get_values_checked_slider_and_set(&speex_bfi,
- "slider-complexity", "checkbutton-complexity", &profile->complexity,
- NULL);
+ "slider-complexity", "checkbutton-complexity", &profile->complexity,
+ NULL);
gnac_profiles_utils_get_values_check_and_set(&speex_bfi,
- "checkbutton-dtx", &profile->dtx, NULL);
+ "checkbutton-dtx", &profile->dtx, NULL);
- switch (index) {
+ switch (index)
+ {
case 0:
gnac_profiles_utils_get_values_slider_and_set(&speex_bfi,
- "slider-quality-cbr", &profile->quality_cbr,
- NULL);
+ "slider-quality-cbr", &profile->quality_cbr,
+ NULL);
gnac_profiles_utils_get_values_checked_slider_and_set(&speex_bfi,
- "slider-bitrate-cbr", "checkbutton-bitrate-cbr", &profile->bitrate_cbr,
- NULL);
+ "slider-bitrate-cbr", "checkbutton-bitrate-cbr",
+ &profile->bitrate_cbr,
+ NULL);
gnac_profiles_utils_get_values_check_and_set(&speex_bfi,
- "checkbutton-vad", &profile->vad, NULL);
+ "checkbutton-vad", &profile->vad, NULL);
break;
+
case 1:
gnac_profiles_utils_get_values_slider_and_set(&speex_bfi,
- "slider-bitrate-abr", &profile->bitrate_abr,
- NULL);
+ "slider-bitrate-abr", &profile->bitrate_abr,
+ NULL);
break;
+
case 2:
gnac_profiles_utils_get_values_slider_and_set(&speex_bfi,
- "slider-quality-vbr", &profile->quality_vbr,
- NULL);
+ "slider-quality-vbr", &profile->quality_vbr,
+ NULL);
break;
}
@@ -471,6 +503,7 @@ gnac_profiles_speex_get_widget(AudioProfileSpeex *profile)
return gnac_profiles_default_get_widget(profile,&speex_bfi);
}
+
void
gnac_profiles_speex_save_profile(AudioProfileSpeex *profile)
{
@@ -482,35 +515,40 @@ gnac_profiles_speex_save_profile(AudioProfileSpeex *profile)
gchar *complexity_str = NULL;
if (profile->quality_cbr != -1) {
- quality_cbr_str = gnac_profiles_utils_gdouble_to_gchararray(profile->quality_cbr);
+ quality_cbr_str = gnac_profiles_utils_gdouble_to_gchararray(
+ profile->quality_cbr);
if (profile->bitrate_cbr != -1) {
bitrate_cbr_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->bitrate_cbr);
+ profile->bitrate_cbr);
}
} else if (profile->quality_vbr != -1) {
- quality_vbr_str = gnac_profiles_utils_gdouble_to_gchararray_format(profile->quality_vbr,
- "%.2f");
+ quality_vbr_str = gnac_profiles_utils_gdouble_to_gchararray_format(
+ profile->quality_vbr, "%.2f");
} else {
- bitrate_abr_str = gnac_profiles_utils_gdouble_to_gchararray(profile->bitrate_abr);
+ bitrate_abr_str = gnac_profiles_utils_gdouble_to_gchararray(
+ profile->bitrate_abr);
}
if (profile->complexity != -1) {
- complexity_str = gnac_profiles_utils_gdouble_to_gchararray(profile->complexity);
+ complexity_str = gnac_profiles_utils_gdouble_to_gchararray(
+ profile->complexity);
}
doc = gnac_profiles_default_save_profile(profile->generic, &speex_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "bitrate-cbr", (bitrate_cbr_str == NULL) ? "" : bitrate_cbr_str,
- "quality-cbr", (quality_cbr_str == NULL) ? "" : quality_cbr_str,
- "bitrate-abr", (bitrate_abr_str == NULL) ? "" : bitrate_abr_str,
- "quality-vbr", (quality_vbr_str == NULL) ? "" : quality_vbr_str,
- "mode", profile->mode,
- "complexity", (complexity_str == NULL) ? "" : complexity_str,
- "vad", profile->vad,
- "dtx", profile->dtx,
- NULL
- );
+ "bitrate-cbr", (bitrate_cbr_str == NULL) ? "" : bitrate_cbr_str,
+ "quality-cbr", (quality_cbr_str == NULL) ? "" : quality_cbr_str,
+ "bitrate-abr", (bitrate_abr_str == NULL) ? "" : bitrate_abr_str,
+ "quality-vbr", (quality_vbr_str == NULL) ? "" : quality_vbr_str,
+ "mode", profile->mode,
+ "complexity", (complexity_str == NULL) ? "" : complexity_str,
+ "vad", profile->vad,
+ "dtx", profile->dtx,
+ NULL);
+
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
+
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(doc);
g_free(quality_cbr_str);
g_free(quality_vbr_str);
@@ -521,7 +559,8 @@ gnac_profiles_speex_save_profile(AudioProfileSpeex *profile)
AudioProfileSpeex *
-gnac_profiles_speex_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_speex_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileSpeex *profile;
gchar *quality_cbr_str;
@@ -532,60 +571,79 @@ gnac_profiles_speex_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *g
profile = gnac_profiles_speex_allocate_audio_profile();
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "bitrate-cbr", &bitrate_cbr_str,
- "quality-cbr", &quality_cbr_str,
- "bitrate-abr", &bitrate_abr_str,
- "quality-vbr", &quality_vbr_str,
- "mode", &profile->mode,
- "complexity", &complexity_str,
- "vad", &profile->vad,
- "dtx", &profile->dtx,
- NULL
- );
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "bitrate-cbr", &bitrate_cbr_str,
+ "quality-cbr", &quality_cbr_str,
+ "bitrate-abr", &bitrate_abr_str,
+ "quality-vbr", &quality_vbr_str,
+ "mode", &profile->mode,
+ "complexity", &complexity_str,
+ "vad", &profile->vad,
+ "dtx", &profile->dtx,
+ NULL);
if (complexity_str != NULL) {
- profile->complexity = gnac_profiles_utils_gchararray_to_gdouble(complexity_str);
+ profile->complexity = gnac_profiles_utils_gchararray_to_gdouble(
+ complexity_str);
g_free(complexity_str);
}
if (quality_cbr_str != NULL) {
- profile->quality_cbr = gnac_profiles_utils_gchararray_to_gdouble(quality_cbr_str);
+ profile->quality_cbr = gnac_profiles_utils_gchararray_to_gdouble(
+ quality_cbr_str);
+
if (bitrate_cbr_str != NULL) {
- profile->bitrate_cbr = gnac_profiles_utils_gchararray_to_gdouble(bitrate_cbr_str);
+ profile->bitrate_cbr = gnac_profiles_utils_gchararray_to_gdouble(
+ bitrate_cbr_str);
g_free(bitrate_cbr_str);
}
+
g_free(quality_cbr_str);
} else if (quality_vbr_str != NULL) {
- profile->quality_vbr = gnac_profiles_utils_gchararray_to_gdouble(quality_vbr_str);
+ profile->quality_vbr = gnac_profiles_utils_gchararray_to_gdouble(
+ quality_vbr_str);
g_free(quality_vbr_str);
} else {
- profile->bitrate_abr = gnac_profiles_utils_gchararray_to_gdouble(bitrate_abr_str);
+ profile->bitrate_abr = gnac_profiles_utils_gchararray_to_gdouble(
+ bitrate_abr_str);
g_free(bitrate_abr_str);
}
return profile;
}
+
void
gnac_profiles_speex_clean_up(void) {
gnac_profiles_default_clean_up(&speex_bfi);
gnac_profiles_utils_free_combo_values(&speex_bfi,
- "combo-mode", "combo-bitrate-mode", NULL);
+ "combo-mode",
+ "combo-bitrate-mode",
+ NULL);
gnac_profiles_utils_free_slider_values(&speex_bfi,
- "slider-quality-cbr", "slider-quality-vbr", "slider-bitrate-cbr",
- "slider-bitrate-abr", "slider-complexity", NULL);
+ "slider-quality-cbr",
+ "slider-quality-vbr",
+ "slider-bitrate-cbr",
+ "slider-bitrate-abr",
+ "slider-complexity",
+ NULL);
gnac_profiles_utils_free_check_values(&speex_bfi,
- "checkbutton-vad", "checkbutton-dtx","checkbutton-vbr", NULL);
+ "checkbutton-vad",
+ "checkbutton-dtx",
+ "checkbutton-vbr",
+ NULL);
gnac_profiles_utils_free_basic_format_info_content(&speex_bfi);
}
+
const gchar *
gnac_profiles_speex_get_plugin_name(void)
{
return speex_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_speex_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-speex.h b/src/profiles/formats/gnac-profiles-speex.h
index 96d5752..02a534e 100644
--- a/src/profiles/formats/gnac-profiles-speex.h
+++ b/src/profiles/formats/gnac-profiles-speex.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,22 +23,25 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_SPEEX_H
-#define GNAC_PROFILES_FORMAT_SPEEX_H
+#ifndef GNAC_PROFILES_SPEEX_H
+#define GNAC_PROFILES_SPEEX_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
- gdouble quality_cbr;
- gdouble quality_vbr;
- gdouble bitrate_cbr;
- gdouble bitrate_abr;
- gchar *mode;
- gdouble complexity;
- gchar *vad;
- gchar *dtx;
+
+ gdouble quality_cbr;
+ gdouble quality_vbr;
+ gdouble bitrate_cbr;
+ gdouble bitrate_abr;
+ gchar *mode;
+ gdouble complexity;
+ gchar *vad;
+ gchar *dtx;
}
AudioProfileSpeex;
@@ -76,9 +79,12 @@ void
gnac_profiles_speex_save_profile(AudioProfileSpeex *profile);
AudioProfileSpeex *
-gnac_profiles_speex_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_speex_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_speex_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_SPEEX_H */
diff --git a/src/profiles/formats/gnac-profiles-unknown.c b/src/profiles/formats/gnac-profiles-unknown.c
index 2f18366..d06b4c1 100644
--- a/src/profiles/formats/gnac-profiles-unknown.c
+++ b/src/profiles/formats/gnac-profiles-unknown.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,8 +29,8 @@
#include "gnac-profiles-unknown.h"
-BasicFormatInfo unknown_bfi =
-{
+
+BasicFormatInfo unknown_bfi = {
PKGDATADIR "/profiles/gnac-profiles-unknown.xml",
NULL,
NULL,
@@ -46,17 +46,20 @@ BasicFormatInfo unknown_bfi =
};
const gchar *base_pipeline =
- "audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert !";
+ "audioconvert ! audio/x-raw-float, rate=44100, channels=2 ! audioconvert !";
static GtkTextView *pipeline_text_view;
static GtkWidget *pipeline_box;
static gulong text_view_handler_id = 0;
static gboolean
-gnac_profiles_unknown_text_view_handler(GtkWidget *widget, gpointer data);
+gnac_profiles_unknown_text_view_handler(GtkWidget *widget,
+ gpointer data);
static void
-gnac_profiles_unknown_on_hide(GtkWidget *widget, gpointer data);
+gnac_profiles_unknown_on_hide(GtkWidget *widget,
+ gpointer data);
+
FormatModuleFuncs
gnac_profiles_unknown_get_funcs(void) {
@@ -78,6 +81,7 @@ gnac_profiles_unknown_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_unknown_init(UpdateTextBufferFunc call_back)
{
@@ -86,35 +90,40 @@ gnac_profiles_unknown_init(UpdateTextBufferFunc call_back)
unknown_bfi.builder = gtk_builder_new();
if (!gtk_builder_add_from_file(unknown_bfi.builder,
- unknown_bfi.gtkbuilder_xml_file, &error)) {
- g_printerr("%s\n",error->message);
+ unknown_bfi.gtkbuilder_xml_file, &error))
+ {
+ g_printerr("%s\n", error->message);
g_error_free(error);
exit(EXIT_FAILURE);
}
- widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder, "properties-alignment"));
+ widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder,
+ "properties-alignment"));
//g_object_ref (widget);
//gtk_widget_unparent(widget);
- g_signal_connect (G_OBJECT (widget), "hide",
+ g_signal_connect(G_OBJECT(widget), "hide",
G_CALLBACK(gnac_profiles_unknown_on_hide), NULL);
-
-
return unknown_bfi.format_id;
}
void
-gnac_profiles_unknown_set_pipeline_text_view(GtkTextView *text_view, GtkWidget *box)
+gnac_profiles_unknown_set_pipeline_text_view(GtkTextView *text_view,
+ GtkWidget *box)
{
pipeline_text_view = text_view;
pipeline_box = box;
}
+
void
gnac_profiles_unknown_generate_pipeline(GtkWidget *w)
-{}
+{
+
+}
+
void
gnac_profiles_unknown_fullfill_fields(AudioProfileGeneric *profile)
@@ -123,7 +132,8 @@ gnac_profiles_unknown_fullfill_fields(AudioProfileGeneric *profile)
GtkTextBuffer *text_buffer;
widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder,
- "entry-extension"));
+ "entry-extension"));
+
if (profile == NULL) {
gtk_entry_set_text(GTK_ENTRY(widget), "");
if (unknown_bfi.pipeline != NULL) {
@@ -135,18 +145,19 @@ gnac_profiles_unknown_fullfill_fields(AudioProfileGeneric *profile)
text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pipeline_text_view));
gtk_text_buffer_set_text(text_buffer, profile->pipeline,
- strlen(profile->pipeline));
+ strlen(profile->pipeline));
unknown_bfi.pipeline = g_strdup(profile->pipeline);
}
-
}
+
gchar *
-gnac_profiles_unknown_get_combo_format_name()
+gnac_profiles_unknown_get_combo_format_name(void)
{
return g_strdup(unknown_bfi.format_name);
}
+
void
gnac_profiles_unknown_free_audio_profile(AudioProfileGeneric *profile)
{
@@ -162,7 +173,7 @@ gnac_profiles_unknown_generate_audio_profile(GError **error)
const gchar *extension;
widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder,
- "entry-extension"));
+ "entry-extension"));
extension = gtk_entry_get_text(GTK_ENTRY(widget));
if (!g_strcmp0(extension, "")) {
if ((error) && (*error == NULL)) {
@@ -193,74 +204,86 @@ gnac_profiles_unknown_get_widget(AudioProfileGeneric *profile)
gnac_profiles_unknown_fullfill_fields(profile);
}
- if (!g_signal_handler_is_connected(G_OBJECT(pipeline_text_view), text_view_handler_id)) {
+ if (!g_signal_handler_is_connected(G_OBJECT(pipeline_text_view),
+ text_view_handler_id))
+ {
GtkTextBuffer *text_buffer;
#ifndef GNOME_ENABLE_DEBUG
- gtk_widget_show(GTK_WIDGET(pipeline_box));
+ gtk_widget_show(GTK_WIDGET(pipeline_box));
#endif /* GNOME_ENABLE_DEBUG */
- text_view_handler_id = g_signal_connect(G_OBJECT(pipeline_text_view), "focus-out-event",
- G_CALLBACK(gnac_profiles_unknown_text_view_handler), NULL);
+ text_view_handler_id = g_signal_connect(G_OBJECT(pipeline_text_view),
+ "focus-out-event",
+ G_CALLBACK(gnac_profiles_unknown_text_view_handler),
+ NULL);
text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pipeline_text_view));
- if (unknown_bfi.pipeline != NULL) {
+ if (unknown_bfi.pipeline != NULL) {
gtk_text_buffer_set_text(text_buffer, unknown_bfi.pipeline,
- strlen(unknown_bfi.pipeline));
+ strlen(unknown_bfi.pipeline));
} else {
gtk_text_buffer_set_text(text_buffer, base_pipeline,
- strlen(base_pipeline));
+ strlen(base_pipeline));
}
}
- return gnac_profiles_default_get_widget(profile,&unknown_bfi);
+ return gnac_profiles_default_get_widget(profile, &unknown_bfi);
}
+
void
gnac_profiles_unknown_save_profile(AudioProfileGeneric *profile)
{
XMLDoc *doc;
- doc = gnac_profiles_default_save_profile((AudioProfileGeneric*) profile, &unknown_bfi);
+ doc = gnac_profiles_default_save_profile((AudioProfileGeneric*) profile,
+ &unknown_bfi);
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
gnac_profiles_xml_engine_free_doc_xpath(doc);
}
AudioProfileGeneric *
-gnac_profiles_unknown_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_unknown_load_specific_properties(
+ XMLDoc *doc G_GNUC_UNUSED,
+ AudioProfileGeneric *generic)
{
- DISCARD_PARAMETER(doc);
-
return generic;
}
+
void
gnac_profiles_unknown_clean_up(void) {
GtkWidget *widget;
- widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder, "properties-alignment"));
+ widget = GTK_WIDGET(gtk_builder_get_object(unknown_bfi.builder,
+ "properties-alignment"));
//gtk_widget_unref(widget);
if (unknown_bfi.pipeline != NULL) g_free(unknown_bfi.pipeline);
g_object_unref(unknown_bfi.builder);
gtk_widget_destroy(widget);
}
+
const gchar *
gnac_profiles_unknown_get_plugin_name(void)
{
return unknown_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_unknown_get_description(void)
{
return unknown_bfi.description;
}
+
static gboolean
-gnac_profiles_unknown_text_view_handler(GtkWidget *widget, gpointer data)
+gnac_profiles_unknown_text_view_handler(GtkWidget *widget,
+ gpointer data)
{
GtkTextBuffer *text_buffer;
GtkTextIter start;
@@ -269,18 +292,23 @@ gnac_profiles_unknown_text_view_handler(GtkWidget *widget, gpointer data)
if (unknown_bfi.pipeline != NULL) g_free(unknown_bfi.pipeline);
text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(pipeline_text_view));
- gtk_text_buffer_get_start_iter(text_buffer,&start);
- gtk_text_buffer_get_end_iter(text_buffer,&end);
- unknown_bfi.pipeline = gtk_text_buffer_get_text(text_buffer,&start,&end,FALSE);
+ gtk_text_buffer_get_start_iter(text_buffer, &start);
+ gtk_text_buffer_get_end_iter(text_buffer, &end);
+ unknown_bfi.pipeline = gtk_text_buffer_get_text(text_buffer,
+ &start, &end, FALSE);
return FALSE;
}
+
static void
-gnac_profiles_unknown_on_hide(GtkWidget *widget, gpointer data)
+gnac_profiles_unknown_on_hide(GtkWidget *widget,
+ gpointer data)
{
- if (g_signal_handler_is_connected(G_OBJECT(pipeline_text_view), text_view_handler_id)) {
- g_signal_handler_disconnect(G_OBJECT(pipeline_text_view), text_view_handler_id);
+ if (g_signal_handler_is_connected(G_OBJECT(pipeline_text_view),
+ text_view_handler_id))
+ {
+ g_signal_handler_disconnect(G_OBJECT(pipeline_text_view),
+ text_view_handler_id);
}
-
}
diff --git a/src/profiles/formats/gnac-profiles-unknown.h b/src/profiles/formats/gnac-profiles-unknown.h
index d8c0ed4..16d55bf 100644
--- a/src/profiles/formats/gnac-profiles-unknown.h
+++ b/src/profiles/formats/gnac-profiles-unknown.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,11 +23,13 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_UNKNOWN_H
-#define GNAC_PROFILES_FORMAT_UNKNOWN_H
+#ifndef GNAC_PROFILES_UNKNOWN_H
+#define GNAC_PROFILES_UNKNOWN_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
FormatModuleFuncs
gnac_profiles_unknown_get_funcs(void);
@@ -62,12 +64,16 @@ void
gnac_profiles_unknown_save_profile(AudioProfileGeneric *profile);
AudioProfileGeneric *
-gnac_profiles_unknown_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_unknown_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_unknown_clean_up(void);
void
-gnac_profiles_unknown_set_pipeline_text_view(GtkTextView *text_view, GtkWidget *box);
+gnac_profiles_unknown_set_pipeline_text_view(GtkTextView *text_view,
+ GtkWidget *box);
+
+G_END_DECLS
-#endif
+#endif /* GNAC_PROFILES_UNKNOWN_H */
diff --git a/src/profiles/formats/gnac-profiles-vorbis.c b/src/profiles/formats/gnac-profiles-vorbis.c
index dd71b1e..0879631 100755
--- a/src/profiles/formats/gnac-profiles-vorbis.c
+++ b/src/profiles/formats/gnac-profiles-vorbis.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-vorbis.h"
-BasicFormatInfo vorbis_bfi =
-{
+
+BasicFormatInfo vorbis_bfi = {
PKGDATADIR "/profiles/gnac-profiles-vorbis.xml",
NULL,
PKGDATADIR "/profiles/vorbis.xml",
@@ -49,13 +49,14 @@ gnac_profiles_vorbis_vbr_on_changed(GtkComboBox *widget);
static void
gnac_profiles_vorbis_advanced_bitrate_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static AudioProfileVorbis *
gnac_profiles_vorbis_allocate_audio_profile(void);
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_vorbis_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -76,6 +77,7 @@ gnac_profiles_vorbis_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_vorbis_init(UpdateTextBufferFunc call_back)
{
@@ -84,46 +86,52 @@ gnac_profiles_vorbis_init(UpdateTextBufferFunc call_back)
update_text_buffer_call_back = call_back;
gnac_profiles_default_init(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline));
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline));
- //Bitrate
+ // Bitrate
gnac_profiles_utils_all_in_one_for_combo(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline), "combo-bitrate",
- "//variable[ id='bitrate']/*");
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline),
+ "combo-bitrate", "//variable[ id='bitrate']/*");
- //Quality
+ // Quality
widget = gnac_profiles_utils_all_in_one_for_slider(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline), "slider-quality",
- "//variable[ id='quality']/*");
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline),
+ "slider-quality", "//variable[ id='quality']/*");
gtk_scale_set_digits(GTK_SCALE(widget), 1);
- //Min bitrate
+ // Min bitrate
widget = gnac_profiles_utils_all_in_one_for_combo(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline), "combo-min-vbr",
- "//variable[ id='vbr-min-bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&vorbis_bfi, "checkbutton-min-bitrate",
- G_CALLBACK(gnac_profiles_vorbis_advanced_bitrate_on_toggle), widget);
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline),
+ "combo-min-vbr", "//variable[ id='vbr-min-bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&vorbis_bfi,
+ "checkbutton-min-bitrate",
+ G_CALLBACK(gnac_profiles_vorbis_advanced_bitrate_on_toggle),
+ widget);
- //Max bitrate
+ // Max bitrate
widget = gnac_profiles_utils_all_in_one_for_combo(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline), "combo-max-vbr",
- "//variable[ id='vbr-max-bitrate']/*");
- gnac_profiles_utils_add_toggle_signal(&vorbis_bfi, "checkbutton-max-bitrate",
- G_CALLBACK(gnac_profiles_vorbis_advanced_bitrate_on_toggle), widget);
-
- //Encoding mode
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline),
+ "combo-max-vbr", "//variable[ id='vbr-max-bitrate']/*");
+ gnac_profiles_utils_add_toggle_signal(&vorbis_bfi,
+ "checkbutton-max-bitrate",
+ G_CALLBACK(gnac_profiles_vorbis_advanced_bitrate_on_toggle),
+ widget);
+
+ // Encoding mode
widget = gnac_profiles_utils_all_in_one_for_combo(&vorbis_bfi,
- G_CALLBACK(gnac_profiles_vorbis_generate_pipeline), "combo-encoding-mode",
- "//variable[ id='vbr']/*");
+ G_CALLBACK(gnac_profiles_vorbis_generate_pipeline),
+ "combo-encoding-mode", "//variable[ id='vbr']/*");
gnac_profiles_vorbis_vbr_on_changed(GTK_COMBO_BOX(widget));
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(vorbis_bfi.doc);
vorbis_bfi.doc = NULL;
return vorbis_bfi.format_id;
}
+
static void
gnac_profiles_vorbis_vbr_on_changed(GtkComboBox *widget)
{
@@ -143,9 +151,10 @@ gnac_profiles_vorbis_vbr_on_changed(GtkComboBox *widget)
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- for (i = 0; i<8; ++i) {
- if ( ((index == 0) && ((i >= 4) || (i <= 1)))
- || ((index == 1) && ((i == 2) || (i == 3)))) {
+ for (i = 0; i < 8; ++i) {
+ if (((index == 0) && ((i >= 4) || (i <= 1)))
+ || ((index == 1) && ((i == 2) || (i == 3))))
+ {
gtk_widget_show(widgets_tab[i]);
} else {
gtk_widget_hide(widgets_tab[i]);
@@ -163,7 +172,8 @@ gnac_profiles_vorbis_generate_pipeline(GtkWidget *w)
pipeline = gnac_profiles_default_generate_pipeline(&vorbis_bfi);
- widget = GTK_WIDGET(gtk_builder_get_object(vorbis_bfi.builder, "combo-encoding-mode"));
+ widget = GTK_WIDGET(gtk_builder_get_object(vorbis_bfi.builder,
+ "combo-encoding-mode"));
if (w == widget) {
gnac_profiles_vorbis_vbr_on_changed(GTK_COMBO_BOX(w));
@@ -172,35 +182,38 @@ gnac_profiles_vorbis_generate_pipeline(GtkWidget *w)
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
if (index == 1) {
- pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &vorbis_bfi,
- "combo-bitrate", NULL);
+ pipeline = gnac_profiles_utils_add_properties_combo(pipeline,
+ &vorbis_bfi, "combo-bitrate", NULL);
} else if (index == 0) {
- pipeline = gnac_profiles_utils_add_properties_slider_format(pipeline, &vorbis_bfi,
- "%.1f", "slider-quality", NULL);
+ pipeline = gnac_profiles_utils_add_properties_slider_format(pipeline,
+ &vorbis_bfi, "%.1f", "slider-quality", NULL);
- pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, &vorbis_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate",
- "combo-max-vbr", "checkbutton-max-bitrate",
- NULL);
+ pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline,
+ &vorbis_bfi,
+ "combo-min-vbr", "checkbutton-min-bitrate",
+ "combo-max-vbr", "checkbutton-max-bitrate",
+ NULL);
}
- pipeline = gnac_profiles_utils_add_pipe(pipeline,vorbis_bfi.pipeline_multiplexers);
+ pipeline = gnac_profiles_utils_add_pipe(pipeline,
+ vorbis_bfi.pipeline_multiplexers);
update_text_buffer_call_back(pipeline);
-
if (vorbis_bfi.pipeline != NULL) g_free(vorbis_bfi.pipeline);
- vorbis_bfi.pipeline = pipeline;
+ vorbis_bfi.pipeline = pipeline;
}
+
static void
gnac_profiles_vorbis_advanced_bitrate_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
- gnac_profiles_utils_on_toggle_optionnal_property(togglebutton,user_data);
+ gnac_profiles_utils_on_toggle_optionnal_property(togglebutton, user_data);
gnac_profiles_vorbis_generate_pipeline(GTK_WIDGET(togglebutton));
}
+
void
gnac_profiles_vorbis_fullfill_fields(AudioProfileVorbis *profile)
{
@@ -208,38 +221,49 @@ gnac_profiles_vorbis_fullfill_fields(AudioProfileVorbis *profile)
if (profile == NULL) {
gnac_profiles_default_fullfill_fields(NULL, &vorbis_bfi);
- gnac_profiles_utils_reinit_values_combo(&vorbis_bfi,"combo-encoding-mode",
- "combo-bitrate","combo-min-vbr", "combo-max-vbr", NULL);
- gnac_profiles_utils_reinit_values_slider(&vorbis_bfi,"slider-quality", NULL);
+ gnac_profiles_utils_reinit_values_combo(&vorbis_bfi,
+ "combo-encoding-mode",
+ "combo-bitrate",
+ "combo-min-vbr",
+ "combo-max-vbr",
+ NULL);
+ gnac_profiles_utils_reinit_values_slider(&vorbis_bfi,
+ "slider-quality",
+ NULL);
gnac_profiles_utils_set_active_toggle_button(&vorbis_bfi, FALSE,
- "checkbutton-min-bitrate", "checkbutton-max-bitrate", NULL);
+ "checkbutton-min-bitrate",
+ "checkbutton-max-bitrate",
+ NULL);
} else {
- widget = GTK_WIDGET(gtk_builder_get_object(vorbis_bfi.builder, "combo-encoding-mode"));
- gnac_profiles_default_fullfill_fields(profile->generic,&vorbis_bfi);
+ widget = GTK_WIDGET(gtk_builder_get_object(vorbis_bfi.builder,
+ "combo-encoding-mode"));
+ gnac_profiles_default_fullfill_fields(profile->generic, &vorbis_bfi);
if (profile->quality == -1) {
- gnac_profiles_utils_set_values_combo(&vorbis_bfi, "combo-bitrate",
- profile->bitrate, NULL);
- gtk_combo_box_set_active(GTK_COMBO_BOX(widget),1);
+ gnac_profiles_utils_set_values_combo(&vorbis_bfi,
+ "combo-bitrate", profile->bitrate, NULL);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
} else {
- gnac_profiles_utils_set_values_slider(&vorbis_bfi,"slider-quality",
- profile->quality, NULL);
+ gnac_profiles_utils_set_values_slider(&vorbis_bfi,
+ "slider-quality", profile->quality, NULL);
gnac_profiles_utils_set_values_checked_combo(&vorbis_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate, NULL);
- gtk_combo_box_set_active(GTK_COMBO_BOX(widget),0);
+ "combo-min-vbr", "checkbutton-min-bitrate", profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", profile->max_bitrate,
+ NULL);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
}
}
}
gchar *
-gnac_profiles_vorbis_get_combo_format_name()
+gnac_profiles_vorbis_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&vorbis_bfi);
}
+
static AudioProfileVorbis *
gnac_profiles_vorbis_allocate_audio_profile(void)
{
@@ -255,6 +279,7 @@ gnac_profiles_vorbis_allocate_audio_profile(void)
return profile;
}
+
void
gnac_profiles_vorbis_free_audio_profile(AudioProfileVorbis *profile)
{
@@ -281,19 +306,20 @@ gnac_profiles_vorbis_generate_audio_profile(GError **error)
profile->generic = generic;
widget = GTK_WIDGET(gtk_builder_get_object(vorbis_bfi.builder,
- "combo-encoding-mode"));
+ "combo-encoding-mode"));
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
if (index == 1) {
gnac_profiles_utils_get_values_combo_and_set(&vorbis_bfi,
- "combo-bitrate", &profile->bitrate,NULL);
+ "combo-bitrate", &profile->bitrate, NULL);
} else {
gnac_profiles_utils_get_values_slider_and_set(&vorbis_bfi,
- "slider-quality", &profile->quality,NULL);
+ "slider-quality", &profile->quality, NULL);
gnac_profiles_utils_get_values_checked_combo_and_set(&vorbis_bfi,
- "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
- "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate, NULL);
+ "combo-min-vbr", "checkbutton-min-bitrate", &profile->min_bitrate,
+ "combo-max-vbr", "checkbutton-max-bitrate", &profile->max_bitrate,
+ NULL);
}
return profile;
@@ -306,25 +332,27 @@ gnac_profiles_vorbis_get_widget(AudioProfileVorbis *profile)
if (profile != NULL) {
gnac_profiles_vorbis_fullfill_fields(profile);
}
- return gnac_profiles_default_get_widget(profile,&vorbis_bfi);
+ return gnac_profiles_default_get_widget(profile, &vorbis_bfi);
}
+
void
gnac_profiles_vorbis_save_profile(AudioProfileVorbis *profile)
{
XMLDoc *doc;
gchar *quality_str;
- quality_str = gnac_profiles_utils_gdouble_to_gchararray_format(profile->quality,
- "%.1f");
+ quality_str = gnac_profiles_utils_gdouble_to_gchararray_format(
+ profile->quality, "%.1f");
doc = gnac_profiles_default_save_profile(profile->generic, &vorbis_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "quality", quality_str,
- "bitrate", (profile->bitrate == NULL) ? "" : profile->bitrate,
- "min-bitrate", (profile->min_bitrate == NULL) ? "" : profile->min_bitrate,
- "max-bitrate", (profile->max_bitrate == NULL) ? "" : profile->max_bitrate,
- NULL
- );
+ "quality", quality_str,
+ "bitrate", (profile->bitrate == NULL) ? "" : profile->bitrate,
+ "min-bitrate", (profile->min_bitrate == NULL) ? "" : profile->min_bitrate,
+ "max-bitrate", (profile->max_bitrate == NULL) ? "" : profile->max_bitrate,
+ NULL);
+
+ /* Cleanup */
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
gnac_profiles_xml_engine_free_doc_xpath(doc);
g_free(quality_str);
@@ -332,20 +360,21 @@ gnac_profiles_vorbis_save_profile(AudioProfileVorbis *profile)
AudioProfileVorbis *
-gnac_profiles_vorbis_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_vorbis_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileVorbis *profile;
gchar *quality_str;
profile = gnac_profiles_vorbis_allocate_audio_profile();
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "quality", &quality_str,
- "bitrate", &profile->bitrate,
- "min-bitrate", &profile->min_bitrate,
- "max-bitrate", &profile->max_bitrate,
- NULL
- );
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "quality", &quality_str,
+ "bitrate", &profile->bitrate,
+ "min-bitrate", &profile->min_bitrate,
+ "max-bitrate", &profile->max_bitrate,
+ NULL);
if (quality_str != NULL) {
profile->quality = gnac_profiles_utils_gchararray_to_gdouble(quality_str);
@@ -355,22 +384,28 @@ gnac_profiles_vorbis_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *
return profile;
}
+
void
gnac_profiles_vorbis_clean_up(void) {
gnac_profiles_default_clean_up(&vorbis_bfi);
- gnac_profiles_utils_free_combo_values(&vorbis_bfi, "combo-bitrate",
- "combo-min-vbr", "combo-max-vbr", "combo-encoding-mode", NULL);
- gnac_profiles_utils_free_slider_values(&vorbis_bfi, "slider-quality",
- NULL);
+ gnac_profiles_utils_free_combo_values(&vorbis_bfi,
+ "combo-bitrate",
+ "combo-min-vbr",
+ "combo-max-vbr",
+ "combo-encoding-mode",
+ NULL);
+ gnac_profiles_utils_free_slider_values(&vorbis_bfi, "slider-quality", NULL);
gnac_profiles_utils_free_basic_format_info_content(&vorbis_bfi);
}
+
const gchar *
gnac_profiles_vorbis_get_plugin_name(void)
{
return vorbis_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_vorbis_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-vorbis.h b/src/profiles/formats/gnac-profiles-vorbis.h
index 1a36a82..44fb982 100644
--- a/src/profiles/formats/gnac-profiles-vorbis.h
+++ b/src/profiles/formats/gnac-profiles-vorbis.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,18 +23,21 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_VORBIS_H
-#define GNAC_PROFILES_FORMAT_VORBIS_H
+#ifndef GNAC_PROFILES_VORBIS_H
+#define GNAC_PROFILES_VORBIS_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
- gdouble quality;
- gchar *bitrate;
- gchar *min_bitrate;
- gchar *max_bitrate;
+
+ gdouble quality;
+ gchar *bitrate;
+ gchar *min_bitrate;
+ gchar *max_bitrate;
}
AudioProfileVorbis;
@@ -72,9 +75,12 @@ void
gnac_profiles_vorbis_save_profile(AudioProfileVorbis *profile);
AudioProfileVorbis *
-gnac_profiles_vorbis_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_vorbis_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_vorbis_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_VORBIS_H */
diff --git a/src/profiles/formats/gnac-profiles-wav.c b/src/profiles/formats/gnac-profiles-wav.c
index 32d7b9b..bb2460a 100755
--- a/src/profiles/formats/gnac-profiles-wav.c
+++ b/src/profiles/formats/gnac-profiles-wav.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-wav.h"
-BasicFormatInfo wav_bfi =
-{
+
+BasicFormatInfo wav_bfi = {
PKGDATADIR "/profiles/gnac-profiles-wav.xml",
NULL,
PKGDATADIR "/profiles/wav.xml",
@@ -46,6 +46,7 @@ BasicFormatInfo wav_bfi =
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_wav_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -66,20 +67,23 @@ gnac_profiles_wav_get_funcs(void) {
return funcs;
}
+
const gchar *
gnac_profiles_wav_init(UpdateTextBufferFunc call_back)
{
update_text_buffer_call_back = call_back;
gnac_profiles_default_init(&wav_bfi,
- G_CALLBACK(gnac_profiles_wav_generate_pipeline));
+ G_CALLBACK(gnac_profiles_wav_generate_pipeline));
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(wav_bfi.doc);
wav_bfi.doc = NULL;
return wav_bfi.format_id;
}
+
void
gnac_profiles_wav_generate_pipeline(GtkWidget *w)
{
@@ -90,27 +94,32 @@ gnac_profiles_wav_generate_pipeline(GtkWidget *w)
update_text_buffer_call_back(pipeline);
if (wav_bfi.pipeline != NULL) g_free(wav_bfi.pipeline);
+
wav_bfi.pipeline = pipeline;
}
+
void
gnac_profiles_wav_fullfill_fields(AudioProfileGeneric *profile)
{
+
}
gchar *
-gnac_profiles_wav_get_combo_format_name()
+gnac_profiles_wav_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&wav_bfi);
}
+
void
gnac_profiles_wav_free_audio_profile(AudioProfileGeneric *profile)
{
gnac_profiles_utils_free_audio_profile_generic(profile->generic);
}
+
AudioProfileGeneric *
gnac_profiles_wav_generate_audio_profile(GError **error)
{
@@ -121,9 +130,10 @@ gnac_profiles_wav_generate_audio_profile(GError **error)
GtkWidget *
gnac_profiles_wav_get_widget(AudioProfileGeneric *profile)
{
- return gnac_profiles_default_get_widget(profile,&wav_bfi);
+ return gnac_profiles_default_get_widget(profile, &wav_bfi);
}
+
void
gnac_profiles_wav_save_profile(AudioProfileGeneric *profile)
{
@@ -131,16 +141,19 @@ gnac_profiles_wav_save_profile(AudioProfileGeneric *profile)
doc = gnac_profiles_default_save_profile(profile, &wav_bfi);
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
+
gnac_profiles_xml_engine_free_doc_xpath(doc);
}
AudioProfileGeneric *
-gnac_profiles_wav_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_wav_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
return generic;
}
+
void
gnac_profiles_wav_clean_up(void)
{
@@ -148,12 +161,14 @@ gnac_profiles_wav_clean_up(void)
gnac_profiles_utils_free_basic_format_info_content(&wav_bfi);
}
+
const gchar *
gnac_profiles_wav_get_plugin_name(void)
{
return wav_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_wav_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-wav.h b/src/profiles/formats/gnac-profiles-wav.h
index 8512cd1..c732987 100644
--- a/src/profiles/formats/gnac-profiles-wav.h
+++ b/src/profiles/formats/gnac-profiles-wav.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,11 +23,13 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_WAV_H
-#define GNAC_PROFILES_FORMAT_WAV_H
+#ifndef GNAC_PROFILES_WAV_H
+#define GNAC_PROFILES_WAV_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
FormatModuleFuncs
gnac_profiles_wav_get_funcs(void);
@@ -62,9 +64,12 @@ void
gnac_profiles_wav_save_profile(AudioProfileGeneric *profile);
AudioProfileGeneric *
-gnac_profiles_wav_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_wav_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_wav_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_WAV_H */
diff --git a/src/profiles/formats/gnac-profiles-wavpack.c b/src/profiles/formats/gnac-profiles-wavpack.c
index 6ba46fa..5f38a68 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.c
+++ b/src/profiles/formats/gnac-profiles-wavpack.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,8 +28,8 @@
#include "gnac-profiles-wavpack.h"
-BasicFormatInfo wavpack_bfi =
-{
+
+BasicFormatInfo wavpack_bfi = {
PKGDATADIR "/profiles/gnac-profiles-wavpack.xml",
NULL,
PKGDATADIR "/profiles/wavpack.xml",
@@ -49,17 +49,18 @@ gnac_profiles_wavpack_bitrate_control_on_changed(GtkComboBox *widget);
static void
gnac_profiles_wavpack_bitrate_control_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static void
gnac_profiles_wavpack_joint_stereo_mode_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
static AudioProfileWavpack *
gnac_profiles_wavpack_allocate_audio_profile(void);
static UpdateTextBufferFunc update_text_buffer_call_back;
+
FormatModuleFuncs
gnac_profiles_wavpack_get_funcs(void) {
FormatModuleFuncs funcs = {
@@ -90,59 +91,68 @@ gnac_profiles_wavpack_init(UpdateTextBufferFunc call_back)
update_text_buffer_call_back = call_back;
gnac_profiles_default_init(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline));
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline));
- //Encoding mode
+ // Encoding mode
gnac_profiles_utils_all_in_one_for_combo(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "combo-mode",
- "//variable[ id='mode']/*");
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "combo-mode", "//variable[ id='mode']/*");
- //Bitrate
+ // Bitrate
gnac_profiles_utils_all_in_one_for_slider(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "slider-bitrate",
- "//variable[ id='bitrate']/*");
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "slider-bitrate", "//variable[ id='bitrate']/*");
- //Bits per sample
+ // Bits per sample
gnac_profiles_utils_all_in_one_for_slider(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "slider-bits-per-sample",
- "//variable[ id='bits-per-sample']/*");
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "slider-bits-per-sample", "//variable[ id='bits-per-sample']/*");
- //Extra processing
+ // Extra processing
widget = gnac_profiles_utils_all_in_one_for_slider(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "slider-extra-processing",
- "//variable[ id='extra-processing']/*");
- widget2 = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder, "label-extra-processing")),
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "slider-extra-processing", "//variable[ id='extra-processing']/*");
+ widget2 = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
+ "label-extra-processing")),
gnac_profiles_utils_add_description_tooltip(&wavpack_bfi,
- "//variable[ id='extra-processing']/description", widget, widget2, NULL);
+ "//variable[ id='extra-processing']/description",
+ widget, widget2, NULL);
- //Joint stereo mode
+ // Joint stereo mode
widget = gnac_profiles_utils_all_in_one_for_combo(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "combo-joint-stereo-mode",
- "//variable[ id='joint-stereo-mode']/*");
- gnac_profiles_utils_add_toggle_signal(&wavpack_bfi, "checkbutton-joint-stereo-mode",
- G_CALLBACK(gnac_profiles_wavpack_joint_stereo_mode_on_toggle), widget);
-
- //MD5
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "combo-joint-stereo-mode", "//variable[ id='joint-stereo-mode']/*");
+ gnac_profiles_utils_add_toggle_signal(&wavpack_bfi,
+ "checkbutton-joint-stereo-mode",
+ G_CALLBACK(gnac_profiles_wavpack_joint_stereo_mode_on_toggle),
+ widget);
+
+ // MD5
widget = gnac_profiles_utils_all_in_one_for_check(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "checkbutton-md5",
- "//variable[ id='md5']/*");
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "checkbutton-md5", "//variable[ id='md5']/*");
gnac_profiles_utils_add_description_tooltip(&wavpack_bfi,
- "//variable[ id='md5']/description", widget, NULL);
+ "//variable[ id='md5']/description", widget, NULL);
- //Bitrate control
+ // Bitrate control
widget = gnac_profiles_utils_all_in_one_for_combo(&wavpack_bfi,
- G_CALLBACK(gnac_profiles_wavpack_generate_pipeline), "combo-bitrate-control",
- "//variable[ id='bitrate-control']/*");
- widget2 = gnac_profiles_utils_add_toggle_signal(&wavpack_bfi, "checkbutton-bitrate-control",
- G_CALLBACK(gnac_profiles_wavpack_bitrate_control_on_toggle), widget);
- gnac_profiles_wavpack_bitrate_control_on_toggle(GTK_TOGGLE_BUTTON(widget2), widget);
-
+ G_CALLBACK(gnac_profiles_wavpack_generate_pipeline),
+ "combo-bitrate-control", "//variable[ id='bitrate-control']/*");
+ widget2 = gnac_profiles_utils_add_toggle_signal(&wavpack_bfi,
+ "checkbutton-bitrate-control",
+ G_CALLBACK(gnac_profiles_wavpack_bitrate_control_on_toggle),
+ widget);
+ gnac_profiles_wavpack_bitrate_control_on_toggle(GTK_TOGGLE_BUTTON(widget2),
+ widget);
+
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(wavpack_bfi.doc);
wavpack_bfi.doc = NULL;
return wavpack_bfi.format_id;
}
+
static void
gnac_profiles_wavpack_bitrate_control_on_changed(GtkComboBox *widget)
{
@@ -158,14 +168,14 @@ gnac_profiles_wavpack_bitrate_control_on_changed(GtkComboBox *widget)
};
check = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "checkbutton-bitrate-control"));
+ "checkbutton-bitrate-control"));
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
- for (i = 0; i<4; ++i) {
+ for (i = 0; i < 4; ++i) {
if (((gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))))
- &&
- ( ((index == 0) && (i < 2))
- || ((index == 1) && (i >= 2)))) {
+ && (((index == 0) && (i < 2))
+ || ((index == 1) && (i >= 2))))
+ {
gtk_widget_show(widgets_tab[i]);
} else {
gtk_widget_hide(widgets_tab[i]);
@@ -184,52 +194,60 @@ gnac_profiles_wavpack_generate_pipeline(GtkWidget *w)
pipeline = gnac_profiles_default_generate_pipeline(&wavpack_bfi);
- widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder, "combo-bitrate-control"));
+ widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
+ "combo-bitrate-control"));
if (w == widget) {
gnac_profiles_wavpack_bitrate_control_on_changed(GTK_COMBO_BOX(w));
}
pipeline = gnac_profiles_utils_add_properties_combo(pipeline, &wavpack_bfi,
- "combo-mode", NULL);
+ "combo-mode", NULL);
pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &wavpack_bfi,
- "slider-extra-processing", NULL);
- pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline, &wavpack_bfi,
- "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode", NULL);
+ "slider-extra-processing", NULL);
+ pipeline = gnac_profiles_utils_add_properties_checked_combo(pipeline,
+ &wavpack_bfi,
+ "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode",
+ NULL);
pipeline = gnac_profiles_utils_add_properties_check(pipeline, &wavpack_bfi,
- "checkbutton-md5", NULL);
+ "checkbutton-md5", NULL);
+
+ check = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
+ "checkbutton-bitrate-control"));
- check = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder, "checkbutton-bitrate-control"));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) {
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
if (index == 0) {
- widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder, "slider-bitrate"));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f",
- 1000, widget);
+ widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
+ "slider-bitrate"));
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline,
+ "%.0f", 1000, widget);
} else {
- pipeline = gnac_profiles_utils_add_properties_slider(pipeline, &wavpack_bfi,
- "slider-bits-per-sample", NULL);
+ pipeline = gnac_profiles_utils_add_properties_slider(pipeline,
+ &wavpack_bfi, "slider-bits-per-sample", NULL);
}
}
update_text_buffer_call_back(pipeline);
if (wavpack_bfi.pipeline != NULL) g_free(wavpack_bfi.pipeline);
- wavpack_bfi.pipeline = pipeline;
+ wavpack_bfi.pipeline = pipeline;
}
+
static void
gnac_profiles_wavpack_bitrate_control_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
GtkWidget *label;
GtkWidget *hbox;
label = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "label-control-method"));
+ "label-control-method"));
hbox = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "hbox-control-method"));
+ "hbox-control-method"));
+
if (gtk_toggle_button_get_active(togglebutton)) {
gtk_widget_show(hbox);
gtk_widget_show(label);
@@ -237,18 +255,21 @@ gnac_profiles_wavpack_bitrate_control_on_toggle(GtkToggleButton *togglebutton,
gtk_widget_hide(hbox);
gtk_widget_hide(label);
}
+
gnac_profiles_wavpack_bitrate_control_on_changed(GTK_COMBO_BOX(user_data));
gnac_profiles_wavpack_generate_pipeline(GTK_WIDGET(togglebutton));
}
+
static void
gnac_profiles_wavpack_joint_stereo_mode_on_toggle(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
- gnac_profiles_utils_on_toggle_optionnal_property(togglebutton,user_data);
+ gnac_profiles_utils_on_toggle_optionnal_property(togglebutton, user_data);
gnac_profiles_wavpack_generate_pipeline(GTK_WIDGET(togglebutton));
}
+
void
gnac_profiles_wavpack_fullfill_fields(AudioProfileWavpack *profile)
{
@@ -258,39 +279,48 @@ gnac_profiles_wavpack_fullfill_fields(AudioProfileWavpack *profile)
if (profile == NULL) {
gnac_profiles_default_fullfill_fields(NULL, &wavpack_bfi);
gnac_profiles_utils_reinit_values_combo(&wavpack_bfi,
- "combo-mode","combo-bitrate-control", "combo-joint-stereo-mode", NULL);
+ "combo-mode",
+ "combo-bitrate-control",
+ "combo-joint-stereo-mode",
+ NULL);
gnac_profiles_utils_reinit_values_check(&wavpack_bfi,
- "checkbutton-md5", NULL);
+ "checkbutton-md5",
+ NULL);
gnac_profiles_utils_reinit_values_slider(&wavpack_bfi,
- "slider-bitrate", "slider-bits-per-sample", "slider-extra-processing", NULL);
+ "slider-bitrate",
+ "slider-bits-per-sample",
+ "slider-extra-processing",
+ NULL);
gnac_profiles_utils_set_active_toggle_button(&wavpack_bfi, FALSE,
- "checkbutton-bitrate-control", NULL);
+ "checkbutton-bitrate-control", NULL);
} else {
gnac_profiles_utils_set_values_combo(&wavpack_bfi,
- "combo-mode", profile->mode,
- NULL);
+ "combo-mode", profile->mode,
+ NULL);
gnac_profiles_utils_set_values_checked_combo(&wavpack_bfi,
- "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode", profile->joint_stereo_mode,
- NULL);
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,"slider-extra-processing",
- profile->extra_processing, NULL);
- gnac_profiles_utils_set_values_check(&wavpack_bfi, "checkbutton-md5",
- profile->md5, NULL);
+ "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode",
+ profile->joint_stereo_mode,
+ NULL);
+ gnac_profiles_utils_set_values_slider(&wavpack_bfi,
+ "slider-extra-processing", profile->extra_processing, NULL);
+ gnac_profiles_utils_set_values_check(&wavpack_bfi,
+ "checkbutton-md5", profile->md5, NULL);
widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "combo-bitrate-control"));
+ "combo-bitrate-control"));
check = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "checkbutton-bitrate-control"));
+ "checkbutton-bitrate-control"));
+
if (profile->bitrate != -1.0) {
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,"slider-bitrate",
- profile->bitrate, NULL);
+ gnac_profiles_utils_set_values_slider(&wavpack_bfi,
+ "slider-bitrate", profile->bitrate, NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0);
} else if (profile->bits_per_sample != -1) {
- gnac_profiles_utils_set_values_slider(&wavpack_bfi,"slider-bits-per-sample",
- profile->bits_per_sample, NULL);
+ gnac_profiles_utils_set_values_slider(&wavpack_bfi,
+ "slider-bits-per-sample", profile->bits_per_sample, NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), TRUE);
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 1);
}
@@ -299,11 +329,12 @@ gnac_profiles_wavpack_fullfill_fields(AudioProfileWavpack *profile)
gchar *
-gnac_profiles_wavpack_get_combo_format_name()
+gnac_profiles_wavpack_get_combo_format_name(void)
{
return gnac_profiles_default_get_combo_format_name(&wavpack_bfi);
}
+
static AudioProfileWavpack *
gnac_profiles_wavpack_allocate_audio_profile(void)
{
@@ -321,6 +352,7 @@ gnac_profiles_wavpack_allocate_audio_profile(void)
return profile;
}
+
void
gnac_profiles_wavpack_free_audio_profile(AudioProfileWavpack *profile)
{
@@ -347,34 +379,36 @@ gnac_profiles_wavpack_generate_audio_profile(GError **error)
profile = gnac_profiles_wavpack_allocate_audio_profile();
profile->generic = generic;
-
gnac_profiles_utils_get_values_combo_and_set(&wavpack_bfi,
- "combo-mode", &profile->mode,
- NULL);
+ "combo-mode", &profile->mode,
+ NULL);
gnac_profiles_utils_get_values_checked_combo_and_set(&wavpack_bfi,
- "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode", &profile->joint_stereo_mode,
- NULL);
+ "combo-joint-stereo-mode", "checkbutton-joint-stereo-mode",
+ &profile->joint_stereo_mode,
+ NULL);
gnac_profiles_utils_get_values_slider_and_set(&wavpack_bfi,
- "slider-extra-processing", &profile->extra_processing,NULL);
+ "slider-extra-processing", &profile->extra_processing,
+ NULL);
gnac_profiles_utils_get_values_check_and_set(&wavpack_bfi,
- "checkbutton-md5", &profile->md5, NULL);
+ "checkbutton-md5", &profile->md5, NULL);
widget = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "combo-bitrate-control"));
+ "combo-bitrate-control"));
check = GTK_WIDGET(gtk_builder_get_object(wavpack_bfi.builder,
- "checkbutton-bitrate-control"));
+ "checkbutton-bitrate-control"));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) {
index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
if (index == 0) {
gnac_profiles_utils_get_values_slider_and_set(&wavpack_bfi,
- "slider-bitrate", &profile->bitrate, NULL);
+ "slider-bitrate", &profile->bitrate, NULL);
} else {
gnac_profiles_utils_get_values_slider_and_set(&wavpack_bfi,
- "slider-bits-per-sample", &profile->bits_per_sample, NULL);
+ "slider-bits-per-sample", &profile->bits_per_sample, NULL);
}
}
+
return profile;
}
@@ -385,9 +419,10 @@ gnac_profiles_wavpack_get_widget(AudioProfileWavpack *profile)
if (profile != NULL) {
gnac_profiles_wavpack_fullfill_fields(profile);
}
- return gnac_profiles_default_get_widget(profile,&wavpack_bfi);
+ return gnac_profiles_default_get_widget(profile, &wavpack_bfi);
}
+
void
gnac_profiles_wavpack_save_profile(AudioProfileWavpack *profile)
{
@@ -397,26 +432,28 @@ gnac_profiles_wavpack_save_profile(AudioProfileWavpack *profile)
gchar *extra_processing_str;
if (profile->bitrate != -1) {
- bitrate_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->bitrate);
+ bitrate_str = gnac_profiles_utils_gdouble_to_gchararray(profile->bitrate);
} else if (profile->bits_per_sample != -1) {
bits_per_sample_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->bits_per_sample);
+ profile->bits_per_sample);
}
extra_processing_str = gnac_profiles_utils_gdouble_to_gchararray(
- profile->extra_processing);
+ profile->extra_processing);
doc = gnac_profiles_default_save_profile(profile->generic, &wavpack_bfi);
gnac_profiles_utils_save_specific_properties_in_file(doc,
- "mode", profile->mode,
- "bitrate", (bitrate_str == NULL) ? "" : bitrate_str,
- "bits-per-sample", (bits_per_sample_str == NULL) ? "" : bits_per_sample_str,
- "extra-processing", extra_processing_str,
- "joint-stereo-mode", (profile->joint_stereo_mode == NULL) ? "" : profile->joint_stereo_mode ,
- "md5", profile->md5,
- NULL
- );
+ "mode", profile->mode,
+ "bitrate", (bitrate_str == NULL) ? "" : bitrate_str,
+ "bits-per-sample",
+ (bits_per_sample_str == NULL) ? "" : bits_per_sample_str,
+ "extra-processing", extra_processing_str,
+ "joint-stereo-mode",
+ (profile->joint_stereo_mode) ? "" : profile->joint_stereo_mode,
+ "md5", profile->md5,
+ NULL);
gnac_profiles_xml_engine_save_doc(doc, profile->generic->name);
+
+ /* Cleanup */
gnac_profiles_xml_engine_free_doc_xpath(doc);
if (bitrate_str != NULL) g_free(bitrate_str);
if (bits_per_sample_str != NULL) g_free(bits_per_sample_str);
@@ -425,7 +462,8 @@ gnac_profiles_wavpack_save_profile(AudioProfileWavpack *profile)
AudioProfileWavpack *
-gnac_profiles_wavpack_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic)
+gnac_profiles_wavpack_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic)
{
AudioProfileWavpack *profile;
gchar *bitrate_str;
@@ -434,49 +472,58 @@ gnac_profiles_wavpack_load_specific_properties(XMLDoc *doc, AudioProfileGeneric
profile = gnac_profiles_wavpack_allocate_audio_profile();
profile->generic = generic;
- gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/format-specific/",
- "mode", &profile->mode,
- "bitrate", &bitrate_str,
- "bits-per-sample", &bits_per_sample_str,
- "extra-processing", &extra_processing_str,
- "joint-stereo-mode", &profile->joint_stereo_mode,
- "md5", &profile->md5,
- NULL
- );
+ gnac_profiles_utils_load_saved_profile(doc,
+ "/audio-profile/format-specific/",
+ "mode", &profile->mode,
+ "bitrate", &bitrate_str,
+ "bits-per-sample", &bits_per_sample_str,
+ "extra-processing", &extra_processing_str,
+ "joint-stereo-mode", &profile->joint_stereo_mode,
+ "md5", &profile->md5,
+ NULL);
profile->extra_processing = gnac_profiles_utils_gchararray_to_gdouble(
- extra_processing_str);
+ extra_processing_str);
g_free(extra_processing_str);
+
if (bitrate_str != NULL) {
profile->bitrate = gnac_profiles_utils_gchararray_to_gdouble(bitrate_str);
g_free(bitrate_str);
} else if (bits_per_sample_str != NULL) {
profile->bits_per_sample = gnac_profiles_utils_gchararray_to_gdouble(
- bits_per_sample_str);
+ bits_per_sample_str);
g_free(bits_per_sample_str);
}
return profile;
}
+
void
gnac_profiles_wavpack_clean_up(void) {
gnac_profiles_default_clean_up(&wavpack_bfi);
- gnac_profiles_utils_free_combo_values(&wavpack_bfi, "combo-bitrate-control",
- "combo-mode", "combo-joint-stereo-mode", NULL);
- gnac_profiles_utils_free_check_values(&wavpack_bfi, "checkbutton-md5",
- NULL);
- gnac_profiles_utils_free_slider_values(&wavpack_bfi, "slider-bitrate",
- "slider-bits-per-sample", "slider-extra-processing", NULL);
+ gnac_profiles_utils_free_combo_values(&wavpack_bfi,
+ "combo-bitrate-control",
+ "combo-mode",
+ "combo-joint-stereo-mode",
+ NULL);
+ gnac_profiles_utils_free_check_values(&wavpack_bfi, "checkbutton-md5", NULL);
+ gnac_profiles_utils_free_slider_values(&wavpack_bfi,
+ "slider-bitrate",
+ "slider-bits-per-sample",
+ "slider-extra-processing",
+ NULL);
gnac_profiles_utils_free_basic_format_info_content(&wavpack_bfi);
}
+
const gchar *
gnac_profiles_wavpack_get_plugin_name(void)
{
return wavpack_bfi.format_plugin_name;
}
+
const gchar *
gnac_profiles_wavpack_get_description(void)
{
diff --git a/src/profiles/formats/gnac-profiles-wavpack.h b/src/profiles/formats/gnac-profiles-wavpack.h
index b8087c5..f63e408 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.h
+++ b/src/profiles/formats/gnac-profiles-wavpack.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,20 +23,23 @@
* Boston, MA 02110-1301 USA
*/
-#ifndef GNAC_PROFILES_FORMAT_WAVPACK_H
-#define GNAC_PROFILES_FORMAT_WAVPACK_H
+#ifndef GNAC_PROFILES_WAVPACK_H
+#define GNAC_PROFILES_WAVPACK_H
#include "../gnac-profiles-default.h"
+G_BEGIN_DECLS
+
typedef struct
{
AudioProfileGeneric *generic;
- gchar *mode;
- gdouble bitrate;
- gdouble bits_per_sample;
- gdouble extra_processing;
- gchar *joint_stereo_mode;
- gchar *md5;
+
+ gchar *mode;
+ gdouble bitrate;
+ gdouble bits_per_sample;
+ gdouble extra_processing;
+ gchar *joint_stereo_mode;
+ gchar *md5;
}
AudioProfileWavpack;
@@ -74,9 +77,12 @@ void
gnac_profiles_wavpack_save_profile(AudioProfileWavpack *profile);
AudioProfileWavpack *
-gnac_profiles_wavpack_load_specific_properties(XMLDoc *doc, AudioProfileGeneric *generic);
+gnac_profiles_wavpack_load_specific_properties(XMLDoc *doc,
+ AudioProfileGeneric *generic);
void
gnac_profiles_wavpack_clean_up(void);
-#endif
+G_END_DECLS
+
+#endif /* GNAC_PROFILES_WAVPACK_H */
diff --git a/src/profiles/gnac-profiles-default.c b/src/profiles/gnac-profiles-default.c
index 9e5b810..cfba66a 100755
--- a/src/profiles/gnac-profiles-default.c
+++ b/src/profiles/gnac-profiles-default.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,188 +23,220 @@
* Boston, MA 02110-1301 USA
*/
+#include <glib/gstdio.h>
+#include <stdlib.h>
+
#include "gnac-profiles-default.h"
#include "libgnac-debug.h"
-#include <glib/gstdio.h>
-#include <stdlib.h>
void
-gnac_profiles_default_init(BasicFormatInfo *bfi, GCallback pipeline_callback)
+gnac_profiles_default_init(BasicFormatInfo *bfi,
+ GCallback pipeline_callback)
{
GtkWidget *widget;
- XMLDoc *base_values_doc;
+ XMLDoc *base_values_doc;
GtkWidget *profile_advanced_base_widget;
- GError *error = NULL;
+ GError *error = NULL;
bfi->builder = gtk_builder_new();
- if (!gtk_builder_add_from_file(bfi->builder, bfi->gtkbuilder_xml_file, &error)) {
+ if (!gtk_builder_add_from_file(bfi->builder, bfi->gtkbuilder_xml_file,
+ &error))
+ {
libgnac_critical("%s\n", error->message);
g_clear_error(&error);
exit(EXIT_FAILURE);
}
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "properties-alignment"));
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
+ "properties-alignment"));
+
if (!gtk_builder_add_from_file(bfi->builder,
- PKGDATADIR "/profiles/gnac-profiles-base-advanced.xml", &error)) {
+ PKGDATADIR "/profiles/gnac-profiles-base-advanced.xml", &error))
+ {
libgnac_critical("%s\n", error->message);
g_error_free(error);
exit(EXIT_FAILURE);
}
- profile_advanced_base_widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
- "table-advanced-base"));
+ profile_advanced_base_widget = GTK_WIDGET(gtk_builder_get_object(
+ bfi->builder, "table-advanced-base"));
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "properties-table-advanced"));
- gtk_table_attach_defaults(GTK_TABLE(widget),profile_advanced_base_widget,0,2,0,1);
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
+ "properties-table-advanced"));
+ gtk_table_attach_defaults(GTK_TABLE(widget),
+ profile_advanced_base_widget, 0, 2, 0, 1);
- //Init values
+ // Init values
bfi->doc = gnac_profiles_xml_engine_load_doc_xpath(bfi->data_xml_file);
- base_values_doc = gnac_profiles_xml_engine_load_doc_xpath(PKGDATADIR "/profiles/base.xml");
+ base_values_doc = gnac_profiles_xml_engine_load_doc_xpath(
+ PKGDATADIR "/profiles/base.xml");
- //format id
+ // format id
bfi->format_id = gnac_profiles_xml_engine_get_format_id(bfi->doc);
- //name and extension
- gnac_profiles_utils_init_name_extension(bfi->doc,bfi->format_id,
- &(bfi->format_name), &(bfi->file_extension));
- //description text
- bfi->description = gnac_profiles_utils_init_description(bfi->doc, bfi->format_id);
+ // name and extension
+ gnac_profiles_utils_init_name_extension(bfi->doc, bfi->format_id,
+ &(bfi->format_name), &(bfi->file_extension));
+
+ // description text
+ bfi->description = gnac_profiles_utils_init_description(bfi->doc,
+ bfi->format_id);
- //format plugin name
+ // format plugin name
bfi->format_plugin_name = gnac_profiles_xml_engine_get_text_node(bfi->doc,
- "//gst-plugin-name");
+ "//gst-plugin-name");
- //Advanced
- //channels
+ // Advanced
+
+ // channels
widget = gnac_profiles_utils_register_advanced_channels(bfi->builder,
- base_values_doc, pipeline_callback, bfi);
+ base_values_doc, pipeline_callback, bfi);
- //sample rate
+ // sample rate
widget = gnac_profiles_utils_register_advanced_sample_rate(bfi->builder,
- base_values_doc, pipeline_callback, bfi);
+ base_values_doc, pipeline_callback, bfi);
gnac_profiles_utils_init_raw_audioconvert(base_values_doc);
- //pipeline
- //encoder
+ // pipeline
+
+ // encoder
bfi->pipeline_encoder = gnac_profiles_xml_engine_get_text_node(bfi->doc,
- "//process[ id='gstreamer-audio']");
+ "//process[ id='gstreamer-audio']");
- //multiplexers
- bfi->pipeline_multiplexers = g_strconcat("",NULL);
+ // multiplexers
+ bfi->pipeline_multiplexers = g_strconcat("", NULL);
GList *multiplexers_list = gnac_profiles_xml_engine_get_list_values(bfi->doc,
- "//process[ id='multiplexer']/value");
+ "//process[ id='multiplexer']/value");
if (multiplexers_list != NULL) {
bfi->pipeline_multiplexers= gnac_profiles_utils_add_pipes(
- bfi->pipeline_multiplexers, multiplexers_list);
-
+ bfi->pipeline_multiplexers, multiplexers_list);
g_list_free(multiplexers_list);
}
gnac_profiles_xml_engine_free_doc_xpath(base_values_doc);
}
+
GtkWidget *
-gnac_profiles_default_get_widget(void *profile, BasicFormatInfo *bfi)
+gnac_profiles_default_get_widget(gpointer profile,
+ BasicFormatInfo *bfi)
{
GtkWidget *widget;
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "properties-alignment"));
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
+ "properties-alignment"));
return widget;
}
+
gchar *
gnac_profiles_default_generate_pipeline(BasicFormatInfo *bfi)
{
GtkWidget *widget;
- gchar *channels;
- gchar *rate;
- gchar *pipeline;
+ gchar *channels;
+ gchar *rate;
+ gchar *pipeline;
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "combo-channels"));
channels = gnac_profiles_utils_get_value_combo(widget);
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "combo-sample-rate"));
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
+ "combo-sample-rate"));
rate = gnac_profiles_utils_get_value_combo(widget);
- pipeline = gnac_profiles_utils_get_basepipeline(channels,rate);
+ pipeline = gnac_profiles_utils_get_basepipeline(channels, rate);
+
+ /* Cleanup */
g_free(channels);
g_free(rate);
- pipeline = gnac_profiles_utils_add_pipe(pipeline,bfi->pipeline_encoder);
+ pipeline = gnac_profiles_utils_add_pipe(pipeline, bfi->pipeline_encoder);
return pipeline;
-
}
+
gchar *
gnac_profiles_default_get_combo_format_name(BasicFormatInfo *bfi)
{
- return gnac_profiles_utils_get_combo_format_name(bfi->format_name,bfi->file_extension);
+ return gnac_profiles_utils_get_combo_format_name(bfi->format_name,
+ bfi->file_extension);
}
void
gnac_profiles_default_fullfill_fields(AudioProfileGeneric *profile,
- BasicFormatInfo *bfi)
+ BasicFormatInfo *bfi)
{
GtkWidget *widget;
if (profile == NULL) {
- gnac_profiles_utils_reinit_values_combo(bfi,
- "combo-channels","combo-sample-rate", NULL);
+ gnac_profiles_utils_reinit_values_combo(bfi,
+ "combo-channels", "combo-sample-rate", NULL);
} else {
-
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "combo-channels"));
gnac_profiles_utils_set_value_combo(widget, profile->channels);
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, "combo-sample-rate"));
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
+ "combo-sample-rate"));
gnac_profiles_utils_set_value_combo(widget, profile->rate);
}
}
+
AudioProfileGeneric *
gnac_profiles_default_generate_audio_profile(BasicFormatInfo *bfi)
{
AudioProfileGeneric *profile;
profile = gnac_profiles_utils_allocate_audio_profile_generic();
+
profile->extension = g_strdup(bfi->file_extension);
profile->format_id = g_strdup(bfi->format_id);
profile->format_name = g_strdup(bfi->format_name);
profile->pipeline = g_strdup(bfi->pipeline);
profile->channels = gnac_profiles_utils_get_value_combo(
- GTK_WIDGET(gtk_builder_get_object(bfi->builder,"combo-channels")));
+ GTK_WIDGET(gtk_builder_get_object(bfi->builder, "combo-channels")));
profile->rate = gnac_profiles_utils_get_value_combo(
- GTK_WIDGET(gtk_builder_get_object(bfi->builder,"combo-sample-rate")));
+ GTK_WIDGET(gtk_builder_get_object(bfi->builder ,"combo-sample-rate")));
return profile;
}
+
XMLDoc *
gnac_profiles_default_save_profile(AudioProfileGeneric *profile,
-BasicFormatInfo *bfi)
+ BasicFormatInfo *bfi)
{
XMLDoc *doc;
AudioProfileGeneric *generic;
generic = profile->generic;
- doc = gnac_profiles_xml_engine_load_doc_xpath
- (PKGDATADIR "/profiles/profile-base-save.xml");
- gnac_profiles_xml_engine_modify_values(doc, "/audio-profile/base/*",
- generic->pipeline, generic->rate, generic->channels, generic->description,
- generic->name, generic->extension, generic->format_name, generic->format_id,
- NULL);
+ doc = gnac_profiles_xml_engine_load_doc_xpath(
+ PKGDATADIR "/profiles/profile-base-save.xml");
+ gnac_profiles_xml_engine_modify_values(doc, "/audio-profile/base/*",
+ generic->pipeline,
+ generic->rate,
+ generic->channels,
+ generic->description,
+ generic->name,
+ generic->extension,
+ generic->format_name,
+ generic->format_id,
+ NULL);
return doc;
}
+
XMLDoc *
-gnac_profiles_default_load_generic_audio_profile(const gchar *filename, AudioProfileGeneric **generic)
+gnac_profiles_default_load_generic_audio_profile(const gchar *filename,
+ AudioProfileGeneric **generic)
{
XMLDoc *doc;
AudioProfileGeneric *profile;
@@ -214,15 +246,15 @@ gnac_profiles_default_load_generic_audio_profile(const gchar *filename, AudioPro
profile = gnac_profiles_utils_allocate_audio_profile_generic();
*generic = profile;
gnac_profiles_utils_load_saved_profile(doc, "/audio-profile/base/",
- "format-id", &profile->format_id,
- "format-name", &profile->format_name,
- "format-extension", &profile->extension,
- "name", &profile->name,
- "description", &profile->description,
- "channels", &profile->channels,
- "sample-rate", &profile->rate,
- "pipeline", &profile->pipeline,
- NULL);
+ "format-id", &profile->format_id,
+ "format-name", &profile->format_name,
+ "format-extension", &profile->extension,
+ "name", &profile->name,
+ "description", &profile->description,
+ "channels", &profile->channels,
+ "sample-rate", &profile->rate,
+ "pipeline", &profile->pipeline,
+ NULL);
} else {
*generic = NULL;
}
@@ -230,6 +262,7 @@ gnac_profiles_default_load_generic_audio_profile(const gchar *filename, AudioPro
return doc;
}
+
void
gnac_profiles_default_clean_up(BasicFormatInfo *bfi)
{
@@ -237,11 +270,11 @@ gnac_profiles_default_clean_up(BasicFormatInfo *bfi)
GtkWidget *widget;
widget_advanced = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
- "table-advanced-base"));
+ "table-advanced-base"));
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
- "properties-alignment"));
+ "properties-alignment"));
gnac_profiles_utils_free_combo_values(bfi, "combo-channels",
- "combo-sample-rate", NULL);
+ "combo-sample-rate", NULL);
gtk_widget_destroy(widget_advanced);
gtk_widget_destroy(widget);
}
diff --git a/src/profiles/gnac-profiles-default.h b/src/profiles/gnac-profiles-default.h
index ed3ff98..4a07172 100755
--- a/src/profiles/gnac-profiles-default.h
+++ b/src/profiles/gnac-profiles-default.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,45 +28,49 @@
#include "gnac-profiles-utils.h"
+G_BEGIN_DECLS
+
typedef const gchar *(*FormatModuleInitFunc)(UpdateTextBufferFunc update_pipeline_text_buffer);
typedef void (*FormatModuleGeneratePipelineFunc) (GtkWidget*);
-typedef void *(*FormatModuleGenerateAudioProfileFunc) (GError **);
-typedef void (*FormatModuleFreeAudioProfileFunc) (void *);
-typedef void (*FormatModuleFullfillFieldsFunc) (void *);
+typedef gpointer (*FormatModuleGenerateAudioProfileFunc) (GError**);
+typedef void (*FormatModuleFreeAudioProfileFunc) (gpointer);
+typedef void (*FormatModuleFullfillFieldsFunc) (gpointer);
typedef gchar *(*FormatModuleGetComboFormatNameFunc) (void);
-typedef GtkWidget *(*FormatModuleGetWidgetFunc) (void *);
-typedef void (*FormatModuleSaveInFileFunc) (void *);
-typedef void *(*FormatModuleLoadSpecificPropertiesFunc) (XMLDoc *doc, AudioProfileGeneric *generic);
+typedef GtkWidget *(*FormatModuleGetWidgetFunc) (gpointer);
+typedef void (*FormatModuleSaveInFileFunc) (gpointer);
+typedef gpointer (*FormatModuleLoadSpecificPropertiesFunc) (XMLDoc *doc, AudioProfileGeneric *generic);
typedef const gchar *(*FormatModuleGetPluginName) (void);
typedef const gchar *(*FormatModuleGetDescription) (void);
typedef void (*FormatModuleCleanUp) (void);
//Should be used only by unknown module
-typedef void (*FormatModuleSetPipelineTextViewFunc) (GtkTextView*, GtkWidget *);
+typedef void (*FormatModuleSetPipelineTextViewFunc) (GtkTextView*, GtkWidget*);
typedef struct {
- FormatModuleInitFunc init;
- FormatModuleGetDescription get_description;
- FormatModuleGeneratePipelineFunc generate_pipeline;
- FormatModuleGenerateAudioProfileFunc generate_audio_profile;
- FormatModuleFreeAudioProfileFunc free_audio_profile;
- FormatModuleFullfillFieldsFunc fullfill_fields;
- FormatModuleGetWidgetFunc get_widget;
- FormatModuleSaveInFileFunc save_profile_in_file;
+ FormatModuleInitFunc init;
+ FormatModuleGetDescription get_description;
+ FormatModuleGeneratePipelineFunc generate_pipeline;
+ FormatModuleGenerateAudioProfileFunc generate_audio_profile;
+ FormatModuleFreeAudioProfileFunc free_audio_profile;
+ FormatModuleFullfillFieldsFunc fullfill_fields;
+ FormatModuleGetWidgetFunc get_widget;
+ FormatModuleSaveInFileFunc save_profile_in_file;
FormatModuleLoadSpecificPropertiesFunc load_specific_properties;
- FormatModuleCleanUp clean_up;
- FormatModuleSetPipelineTextViewFunc set_pipeline_func;
- FormatModuleGetComboFormatNameFunc get_combo_format_name;
- FormatModuleGetPluginName get_plugin_name;
+ FormatModuleCleanUp clean_up;
+ FormatModuleSetPipelineTextViewFunc set_pipeline_func;
+ FormatModuleGetComboFormatNameFunc get_combo_format_name;
+ FormatModuleGetPluginName get_plugin_name;
} FormatModuleFuncs;
typedef FormatModuleFuncs (*FormatModuleGetFuncs) (void);
void
-gnac_profiles_default_init(BasicFormatInfo *bfi, GCallback pipeline_callback);
+gnac_profiles_default_init(BasicFormatInfo *bfi,
+ GCallback pipeline_callback);
GtkWidget *
-gnac_profiles_default_get_widget(void *profile, BasicFormatInfo *bfi);
+gnac_profiles_default_get_widget(gpointer profile,
+ BasicFormatInfo *bfi);
gchar *
gnac_profiles_default_get_combo_format_name(BasicFormatInfo *bfi);
@@ -75,20 +79,23 @@ gchar *
gnac_profiles_default_generate_pipeline(BasicFormatInfo *bfi);
void
-gnac_profiles_default_fullfill_fields(AudioProfileGeneric *profile, BasicFormatInfo *bfi);
+gnac_profiles_default_fullfill_fields(AudioProfileGeneric *profile,
+ BasicFormatInfo *bfi);
AudioProfileGeneric *
gnac_profiles_default_generate_audio_profile(BasicFormatInfo *bfi);
XMLDoc *
gnac_profiles_default_save_profile(AudioProfileGeneric *profile,
-BasicFormatInfo *bfi);
+ BasicFormatInfo *bfi);
XMLDoc *
-gnac_profiles_default_load_generic_audio_profile(const gchar *filename,
- AudioProfileGeneric **generic);
+gnac_profiles_default_load_generic_audio_profile(const gchar *filename,
+ AudioProfileGeneric **generic);
void
gnac_profiles_default_clean_up(BasicFormatInfo *bfi);
+G_END_DECLS
+
#endif /* GNAC_PROFILES_DEFAULT_H */
diff --git a/src/profiles/gnac-profiles-manager.c b/src/profiles/gnac-profiles-manager.c
index c3b4872..0495b87 100644
--- a/src/profiles/gnac-profiles-manager.c
+++ b/src/profiles/gnac-profiles-manager.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -27,9 +27,10 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#include <gio/gio.h>
#include <gdk/gdkkeysyms.h>
+#include <gio/gio.h>
#include <glib/gi18n.h>
+#include <stdlib.h>
#include "gnac-profiles-manager.h"
#include "libgnac-debug.h"
@@ -49,11 +50,23 @@ enum {
TARGET_PLAIN,
} DRAG_AND_DROP_TARGETS;
+typedef struct {
+ gchar **uris;
+ guint info;
+} ThreadCopyData;
+
+typedef struct {
+ const gchar *path;
+ const gchar *name;
+ GError **error;
+ gboolean toggle;
+} CopyData;
+
GtkBuilder *profiles_mgr_builder = NULL;
static GtkTargetEntry target_list[] = {
- { "text/uri-list", 0, TARGET_URI },
- { "text/plain", 0, TARGET_PLAIN }
+ { "text/uri-list", 0, TARGET_URI },
+ { "text/plain" , 0, TARGET_PLAIN }
};
static guint n_targets = G_N_ELEMENTS(target_list);
@@ -70,7 +83,7 @@ static void
gnac_profiles_mgr_clear(void);
static void
-gnac_profiles_mgr_insert(void *profile);
+gnac_profiles_mgr_insert(gpointer profile);
static void
gnac_profiles_mgr_remove(GtkTreeRowReference *ref);
@@ -79,7 +92,9 @@ static void
gnac_profiles_mgr_delete_profile_file(const gchar *name);
static void
-gnac_profiles_mgr_get(GtkTreeRowReference *ref, int col_number, void **data);
+gnac_profiles_mgr_get(GtkTreeRowReference *ref,
+ gint col_number,
+ gpointer *data);
static void
gnac_profiles_mgr_set(GtkTreeRowReference *ref, ...);
@@ -100,7 +115,8 @@ static void
gnac_profiles_mgr_set_progress_bar_fraction(gdouble fraction);
static void
-gnac_profiles_mgr_display_status_message(const gchar *ok, const gchar *error);
+gnac_profiles_mgr_display_status_message(const gchar *ok,
+ const gchar *error);
static void
gnac_profiles_mgr_set_window_sensitive(gboolean sensitive);
@@ -112,34 +128,37 @@ static gchar **
gnac_profiles_mgr_get_selected_uris(void);
static void
-gnac_profiles_mgr_on_drag_profile_copied( goffset current_num_bytes,
- goffset total_num_bytes,
- gpointer user_data);
+gnac_profiles_mgr_on_drag_profile_copied(goffset current_num_bytes,
+ goffset total_num_bytes,
+ gpointer user_data);
static void
-gnac_profiles_mgr_on_edit_profile(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_edit_profile(GtkWidget *widget,
+ gpointer data);
static void
-gnac_profiles_mgr_on_new_profile(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_new_profile(GtkWidget *widget,
+ gpointer data);
static void
gnac_profiles_mgr_on_treeselection_changed(void);
+
void
gnac_profiles_mgr_init(StandardCallBack call_back)
{
GtkTreeSelection *selection;
- GtkCellRenderer *renderer;
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkWidget *widget;
- GError *error = NULL;
+ GtkCellRenderer *renderer;
+ GtkTreeView *view;
+ GtkTreeModel *model;
+ GtkWidget *widget;
+ GError *error = NULL;
close_callback = call_back;
profiles_mgr_builder = gtk_builder_new();
gtk_builder_add_from_file(profiles_mgr_builder,
- PKGDATADIR "/profiles/gnac-profiles-manager.xml", &error);
+ PKGDATADIR "/profiles/gnac-profiles-manager.xml", &error);
if (error) {
libgnac_critical("%s\n", error->message);
g_error_free(error);
@@ -147,105 +166,85 @@ gnac_profiles_mgr_init(StandardCallBack call_back)
}
view = GTK_TREE_VIEW(gtk_builder_get_object(profiles_mgr_builder,
- "profile_treeview"));
+ "profile_treeview"));
model = gtk_tree_view_get_model(view);
selection = gtk_tree_view_get_selection(view);
g_signal_connect(G_OBJECT(selection), "changed",
- (GCallback) gnac_profiles_mgr_on_treeselection_changed, NULL);
+ G_CALLBACK(gnac_profiles_mgr_on_treeselection_changed), NULL);
renderer = gtk_cell_renderer_text_new();
g_object_set(G_OBJECT(renderer), "ypad", 5, NULL);
- gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
- -1,
- _("Name"),
- renderer,
- "text",
- COL_NAME,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
- -1,
- _("Format"),
- renderer,
- "text",
- COL_FORMAT,
- NULL);
-
- gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
- -1,
- _("Extension"),
- renderer,
- "text",
- COL_EXTENSION,
- NULL);
-
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 0, GTK_SORT_ASCENDING);
-
- gtk_drag_dest_set(GTK_WIDGET(view),
- GTK_DEST_DEFAULT_ALL,
- target_list,
- n_targets,
- GDK_ACTION_COPY);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1,
+ _("Name"), renderer, "text", COL_NAME, NULL);
- gtk_drag_source_set(GTK_WIDGET(view),
- GDK_BUTTON1_MASK,
- target_list,
- n_targets,
- GDK_ACTION_COPY);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1,
+ _("Format"), renderer, "text", COL_FORMAT, NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), -1,
+ _("Extension"), renderer, "text", COL_EXTENSION, NULL);
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 0,
+ GTK_SORT_ASCENDING);
+
+ gtk_drag_dest_set(GTK_WIDGET(view), GTK_DEST_DEFAULT_ALL, target_list,
+ n_targets, GDK_ACTION_COPY);
+
+ gtk_drag_source_set(GTK_WIDGET(view), GDK_BUTTON1_MASK, target_list,
+ n_targets, GDK_ACTION_COPY);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "profile_manager_window"));
- gtk_window_set_modal(GTK_WINDOW(widget),TRUE);
+ "profile_manager_window"));
+ gtk_window_set_modal(GTK_WINDOW(widget), TRUE);
gtk_window_set_type_hint(GTK_WINDOW(widget), GDK_WINDOW_TYPE_HINT_DIALOG);
gnac_profiles_properties_init();
gnac_profiles_mgr_show_import_progressbar(FALSE);
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
gnac_profiles_mgr_populate();
gtk_builder_connect_signals(profiles_mgr_builder, NULL);
-
}
+
void
gnac_profiles_mgr_set_parent(GtkWidget *parent)
{
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "profile_manager_window"));
+ "profile_manager_window"));
gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(parent));
gtk_window_set_position(GTK_WINDOW(widget), GTK_WIN_POS_CENTER_ON_PARENT);
gnac_profiles_properties_set_parent(widget);
}
+
static void
-gnac_profiles_mgr_populate()
+gnac_profiles_mgr_populate(void)
{
- void *profile;
- GFile *dir;
- GFile *profile_file;
- gchar *profile_file_path;
- gchar *profile_file_full_path;
- const gchar *profile_file_name;
- GFileInfo *file_info;
+ gpointer profile;
+ GFile *dir;
+ GFile *profile_file;
+ gchar *profile_file_path;
+ gchar *profile_file_full_path;
+ const gchar *profile_file_name;
+ GFileInfo *file_info;
GFileEnumerator *files;
- GError *error = NULL;
+ GError *error = NULL;
gnac_profiles_mgr_clear();
dir = g_file_new_for_path(saved_profiles_dir);
- if (!g_file_query_exists(dir,NULL)) {
- if (!g_file_make_directory_with_parents(dir,NULL,&error)) {
+ if (!g_file_query_exists(dir, NULL)) {
+ if (!g_file_make_directory_with_parents(dir, NULL, &error)) {
const gchar *msg = N_("Unable to create directory for saved profiles.");
- libgnac_warning("%s %s: %s\n", msg,
+ libgnac_warning("%s %s: %s\n",
+ msg,
_("You may not be able to save your profiles"),
error->message);
gnac_profiles_mgr_display_status_message(NULL, msg);
@@ -262,30 +261,32 @@ gnac_profiles_mgr_populate()
files = g_file_enumerate_children(dir,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_TYPE,
- G_FILE_QUERY_INFO_NONE ,NULL,&error);
+ G_FILE_QUERY_INFO_NONE, NULL, &error);
if (files != NULL) {
- while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL) {
+ while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL)
+ {
if (g_file_info_get_file_type(file_info) == G_FILE_TYPE_REGULAR) {
profile_file = g_file_enumerator_get_container(files);
profile_file_path = g_file_get_path(profile_file);
profile_file_name = g_file_info_get_name(file_info);
profile_file_full_path = g_build_filename(profile_file_path,
- profile_file_name, NULL);
+ profile_file_name, NULL);
profile = gnac_profiles_properties_load_profile_from_file(
- profile_file_full_path, profile_file_name, &error);
+ profile_file_full_path, profile_file_name, &error);
if (profile != NULL) {
gnac_profiles_mgr_insert(profile);
} else if (error) {
libgnac_warning("%s\n",error->message);
g_clear_error(&error);
}
+ /* Cleanup */
g_free(profile_file_path);
g_free(profile_file_full_path);
}
g_object_unref(G_OBJECT(file_info));
}
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
} else {
const gchar *msg = N_("Unable to browse the profiles directory");
@@ -295,27 +296,30 @@ gnac_profiles_mgr_populate()
return;
}
+ /* Cleanup */
g_object_unref(dir);
g_file_enumerator_close(files, NULL, NULL);
g_object_unref(files);
}
+
static void
-gnac_profiles_mgr_import_default_profiles(void) {
- void *profile;
- GFile *dir;
- GFile *profile_file;
- gchar *profile_file_path;
- gchar *profile_file_full_path;
- const gchar *profile_file_name;
- GFileInfo *file_info;
+gnac_profiles_mgr_import_default_profiles(void)
+{
+ gpointer profile;
+ GFile *dir;
+ GFile *profile_file;
+ gchar *profile_file_path;
+ gchar *profile_file_full_path;
+ const gchar *profile_file_name;
+ GFileInfo *file_info;
GFileEnumerator *files;
- GError *error = NULL;
+ GError *error = NULL;
gnac_profiles_mgr_clear();
dir = g_file_new_for_path(PKGDATADIR "/profiles/default");
- if (!g_file_query_exists(dir,NULL)) {
+ if (!g_file_query_exists(dir, NULL)) {
libgnac_warning("%s: %s\n",
_("Unable to find directory containing default profiles"),
error->message);
@@ -326,24 +330,27 @@ gnac_profiles_mgr_import_default_profiles(void) {
files = g_file_enumerate_children(dir,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_TYPE,
- G_FILE_QUERY_INFO_NONE ,NULL,&error);
+ G_FILE_QUERY_INFO_NONE, NULL, &error);
if (files != NULL) {
- while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL) {
+ while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL)
+ {
if (g_file_info_get_file_type(file_info) == G_FILE_TYPE_REGULAR) {
profile_file = g_file_enumerator_get_container(files);
profile_file_path = g_file_get_path(profile_file);
profile_file_name = g_file_info_get_name(file_info);
profile_file_full_path = g_build_filename(profile_file_path,
- profile_file_name, NULL);
+ profile_file_name, NULL);
profile = gnac_profiles_properties_load_profile_from_file(
- profile_file_full_path, profile_file_name, &error);
+ profile_file_full_path, profile_file_name, &error);
if (profile != NULL) {
gnac_profiles_properties_save_profile(profile);
} else if (error) {
libgnac_warning("%s\n",error->message);
g_clear_error(&error);
}
+
+ /* Cleanup */
g_free(profile_file_path);
g_free(profile_file_full_path);
gnac_profiles_properties_free_audio_profile(profile);
@@ -352,37 +359,40 @@ gnac_profiles_mgr_import_default_profiles(void) {
}
} else {
libgnac_warning("%s: %s\n",
- _("Unable to browse the default profiles directory"),
- error->message);
+ _("Unable to browse the default profiles directory"),
+ error->message);
g_error_free(error);
return;
}
+ /* Cleanup */
g_object_unref(dir);
g_file_enumerator_close(files, NULL, NULL);
g_object_unref(files);
}
+
GList *
-gnac_profiles_mgr_get_profiles_list()
+gnac_profiles_mgr_get_profiles_list(void)
{
- GList *list = NULL;
+ GList *list = NULL;
GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
AudioProfileGeneric *profile;
model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder,
- "liststore"));
- if (gtk_tree_model_get_iter_first(model,&iter)) {
+ "liststore"));
+ if (gtk_tree_model_get_iter_first(model, &iter)) {
do {
- gtk_tree_model_get(model,&iter,COL_PROFILE,(void**)&profile,-1);
+ gtk_tree_model_get(model, &iter, COL_PROFILE, (gpointer*)&profile, -1);
list = g_list_append(list, (gpointer) profile);
} while (gtk_tree_model_iter_next(model, &iter));
}
return list;
}
+
void
-gnac_profiles_mgr_destroy()
+gnac_profiles_mgr_destroy(void)
{
GtkWidget *widget;
@@ -390,7 +400,7 @@ gnac_profiles_mgr_destroy()
if (profiles_mgr_builder) {
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "profile_manager_window"));
+ "profile_manager_window"));
g_object_unref(profiles_mgr_builder);
gtk_widget_destroy(widget);
}
@@ -398,11 +408,12 @@ gnac_profiles_mgr_destroy()
gnac_profiles_properties_destroy();
}
+
void
-gnac_profiles_mgr_show()
+gnac_profiles_mgr_show(void)
{
GtkWidget *window;
- GList *selected;
+ GList *selected;
if (!first_show) {
gnac_profiles_mgr_populate();
@@ -411,7 +422,7 @@ gnac_profiles_mgr_show()
}
window = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "profile_manager_window"));
+ "profile_manager_window"));
gtk_widget_show(window);
selected = gnac_profiles_mgr_get_selected_rows();
@@ -420,73 +431,74 @@ gnac_profiles_mgr_show()
gnac_profiles_mgr_activate_buttons(FALSE);
}
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
- g_mem_profile ();
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
+ g_mem_profile();
}
+
static void
gnac_profiles_mgr_clear(void)
{
GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
AudioProfileGeneric *profile;
model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder,
- "liststore"));
- if (gtk_tree_model_get_iter_first(model,&iter)) {
+ "liststore"));
+ if (gtk_tree_model_get_iter_first(model, &iter)) {
do {
- gtk_tree_model_get(model,&iter,COL_PROFILE,(void**)&profile,-1);
+ gtk_tree_model_get(model, &iter, COL_PROFILE, (gpointer*)&profile, -1);
gnac_profiles_properties_free_audio_profile(profile);
} while (gtk_tree_model_iter_next(model, &iter));
}
gtk_list_store_clear(GTK_LIST_STORE(model));
}
+
static void
-gnac_profiles_mgr_insert(void *profile)
+gnac_profiles_mgr_insert(gpointer profile)
{
GtkListStore *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
AudioProfileGeneric *generic;
- gchar *formated_name;
+ gchar *formatted_name;
generic = ((AudioProfileGeneric*) profile)->generic;
model = GTK_LIST_STORE(gtk_builder_get_object(profiles_mgr_builder,
- "liststore"));
+ "liststore"));
- formated_name = gnac_profiles_properties_filter_text_for_displaying(
- generic->name, MAX_NAME_DISPLAY_SIZE);
+ formatted_name = gnac_profiles_properties_filter_text_for_displaying(
+ generic->name, MAX_NAME_DISPLAY_SIZE);
gtk_list_store_append(model, &iter);
gtk_list_store_set(model, &iter,
- 0, formated_name,
+ 0, formatted_name,
1, generic->format_name,
2, generic->extension,
3, profile,
-1);
- g_free(formated_name);
-
+ g_free(formatted_name);
}
+
static void
gnac_profiles_mgr_remove(GtkTreeRowReference *ref)
{
GtkTreeModel *model;
- GtkTreePath *path;
- void *profile = NULL;
+ GtkTreePath *path;
+ gpointer profile = NULL;
g_return_if_fail(ref);
- model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder, "liststore"));
+ model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder,
+ "liststore"));
path = gtk_tree_row_reference_get_path(ref);
if (path) {
GtkTreeIter iter;
if (gtk_tree_model_get_iter(model, &iter, path)) {
- gtk_tree_model_get(model, &iter,
- COL_PROFILE, &profile,
- -1);
+ gtk_tree_model_get(model, &iter, COL_PROFILE, &profile, -1);
gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
}
}
@@ -496,18 +508,21 @@ gnac_profiles_mgr_remove(GtkTreeRowReference *ref)
if (profile) {
gnac_profiles_properties_free_audio_profile((AudioProfileGeneric*)profile);
}
-
}
+
static void
-gnac_profiles_mgr_get(GtkTreeRowReference *ref, int col_number, void **data)
+gnac_profiles_mgr_get(GtkTreeRowReference *ref,
+ gint col_number,
+ gpointer *data)
{
GtkTreeModel *model;
- GtkTreePath *path;
+ GtkTreePath *path;
g_return_if_fail(ref);
- model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder, "liststore"));
+ model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder,
+ "liststore"));
path = gtk_tree_row_reference_get_path(ref);
if (path) {
@@ -519,26 +534,27 @@ gnac_profiles_mgr_get(GtkTreeRowReference *ref, int col_number, void **data)
}
gtk_tree_path_free(path);
-
}
+
static void
gnac_profiles_mgr_set(GtkTreeRowReference *ref, ...)
{
GtkListStore *list_store;
- GtkTreePath *path;
- va_list ap;
+ GtkTreePath *path;
+ va_list ap;
g_return_if_fail(ref);
- list_store = GTK_LIST_STORE(gtk_builder_get_object(profiles_mgr_builder, "liststore"));
+ list_store = GTK_LIST_STORE(gtk_builder_get_object(profiles_mgr_builder,
+ "liststore"));
path = gtk_tree_row_reference_get_path(ref);
if (path) {
GtkTreeIter iter;
if (gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path)) {
- va_start(ap,ref);
+ va_start(ap, ref);
gtk_list_store_set_valist(list_store, &iter, ap);
}
}
@@ -550,70 +566,79 @@ gnac_profiles_mgr_set(GtkTreeRowReference *ref, ...)
static GList *
gnac_profiles_mgr_get_selected_rows(void)
{
- GtkTreeView *view;
- GtkTreeModel *model;
+ GtkTreeView *view;
+ GtkTreeModel *model;
GtkTreeSelection *selection;
- GList *row_references = NULL ;
+ GList *row_references = NULL;
GList *next;
GList *next_temp;
- model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder, "liststore"));
- view = GTK_TREE_VIEW(gtk_builder_get_object(profiles_mgr_builder, "profile_treeview"));
+ model = GTK_TREE_MODEL(gtk_builder_get_object(profiles_mgr_builder,
+ "liststore"));
+ view = GTK_TREE_VIEW(gtk_builder_get_object(profiles_mgr_builder,
+ "profile_treeview"));
selection = gtk_tree_view_get_selection(view);
/* Convert path to GtkTreeRowReference */
next = gtk_tree_selection_get_selected_rows(selection, &model);
next_temp = next;
while (next) {
- row_references = g_list_prepend(row_references,
+ row_references = g_list_prepend(row_references,
gtk_tree_row_reference_new(model, next->data));
next = next->next;
}
row_references = g_list_reverse(row_references);
- g_list_foreach (next_temp, (GFunc) gtk_tree_path_free, NULL);
- g_list_free (next_temp);
+ g_list_foreach(next_temp, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free(next_temp);
return row_references;
}
+
static void
gnac_profiles_mgr_activate_buttons(gboolean activate)
{
GtkWidget *widget;
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder, "copy_button"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
+ "copy_button"));
gtk_widget_set_sensitive(widget, activate);
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder, "edit_button"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
+ "edit_button"));
gtk_widget_set_sensitive(widget, activate);
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder, "delete_button"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
+ "delete_button"));
gtk_widget_set_sensitive(widget, activate);
}
+
static void
gnac_profiles_mgr_show_description_frame(gboolean show)
{
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-description"));
+ "frame-description"));
+
if (show) {
gtk_widget_show_all(widget);
} else {
gtk_widget_hide_all(widget);
}
-
}
+
static void
gnac_profiles_mgr_show_import_progressbar(gboolean show)
{
GtkWidget *widget;
+
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-import"));
+ "frame-import"));
if (show) {
gtk_widget_show_all(widget);
@@ -622,40 +647,44 @@ gnac_profiles_mgr_show_import_progressbar(gboolean show)
}
}
+
static void
gnac_profiles_mgr_set_window_sensitive(gboolean sensitive)
{
GtkWidget *widget;
+
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-profiles-list"));
+ "frame-profiles-list"));
gtk_widget_set_sensitive(widget, sensitive);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-description"));
+ "frame-description"));
gtk_widget_set_sensitive(widget, sensitive);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-status"));
+ "frame-status"));
gtk_widget_set_sensitive(widget, sensitive);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "close_button"));
+ "close_button"));
gtk_widget_set_sensitive(widget, sensitive);
-
}
+
static void
gnac_profiles_mgr_set_progress_bar_fraction(gdouble fraction)
{
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "progressbar-import"));
+ "progressbar-import"));
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widget), fraction);
}
+
static void
-gnac_profiles_mgr_display_status_message(const gchar *ok, const gchar *error)
+gnac_profiles_mgr_display_status_message(const gchar *ok,
+ const gchar *error)
{
GtkWidget *frame_status;
GtkWidget *label_status_ok;
@@ -664,22 +693,22 @@ gnac_profiles_mgr_display_status_message(const gchar *ok, const gchar *error)
GtkWidget *image_status_error;
frame_status = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "frame-status"));
+ "frame-status"));
if ((ok == NULL) && (error == NULL)) {
gtk_widget_hide_all(frame_status);
} else {
gtk_widget_show_all(frame_status);
label_status_ok = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "label-status-ok"));
+ "label-status-ok"));
image_status_ok = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "image-status-ok"));
+ "image-status-ok"));
label_status_error = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "label-status-error"));
+ "label-status-error"));
image_status_error = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "image-status-error"));
+ "image-status-error"));
if (ok != NULL) {
- gtk_label_set_markup(GTK_LABEL(label_status_ok),ok);
+ gtk_label_set_markup(GTK_LABEL(label_status_ok), ok);
gtk_widget_show(label_status_ok);
gtk_widget_show(image_status_ok);
} else {
@@ -687,7 +716,7 @@ gnac_profiles_mgr_display_status_message(const gchar *ok, const gchar *error)
gtk_widget_hide(image_status_ok);
}
if (error != NULL) {
- gtk_label_set_markup(GTK_LABEL(label_status_error),error);
+ gtk_label_set_markup(GTK_LABEL(label_status_error), error);
gtk_widget_show(label_status_error);
gtk_widget_show(image_status_error);
} else {
@@ -695,22 +724,22 @@ gnac_profiles_mgr_display_status_message(const gchar *ok, const gchar *error)
gtk_widget_hide(image_status_error);
}
}
-
}
-typedef struct {
- gchar **uris;
- guint info;
-} ThreadCopyData;
void
-gnac_profiles_mgr_on_drag_data_received( GtkWidget* widget,
- GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data,
- guint info, guint time, gpointer data)
+gnac_profiles_mgr_on_drag_data_received(GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time,
+ gpointer data)
{
- gchar **uris;
- GError *error = NULL;
- ThreadCopyData *tcopy_data;
+ gchar **uris;
+ GError *error = NULL;
+ ThreadCopyData *tcopy_data;
tcopy_data = g_malloc(sizeof(ThreadCopyData));
uris = g_uri_list_extract_uris((const gchar*) selection_data->data);
@@ -719,37 +748,34 @@ gnac_profiles_mgr_on_drag_data_received( GtkWidget* widget,
gtk_drag_finish (context, FALSE, FALSE, time);
return;
}
+
tcopy_data->uris = uris;
tcopy_data->info = info;
- g_thread_create((GThreadFunc) gnac_profiles_mgr_copy_and_load_files, tcopy_data,
- TRUE, &error);
+ g_thread_create((GThreadFunc) gnac_profiles_mgr_copy_and_load_files,
+ tcopy_data, TRUE, &error);
if (error) {
- libgnac_warning(_("Impossible to launch thread for collecting files to import: %s\n"),
- error->message);
- gnac_profiles_mgr_display_status_message(NULL,_("Impossible to import file(s)"));
+ libgnac_warning(
+ _("Impossible to launch thread for collecting files to import: %s\n"),
+ error->message);
+ gnac_profiles_mgr_display_status_message(NULL,
+ _("Impossible to import file(s)"));
g_error_free(error);
}
- gtk_drag_finish(context, TRUE, FALSE, time);
+ gtk_drag_finish(context, TRUE, FALSE, time);
}
-typedef struct {
- const gchar *path;
- const gchar *name;
- GError **error;
- gboolean toggle;
-} CopyData;
static void
gnac_profiles_mgr_copy_and_load_files(gpointer data)
{
- gchar **uris;
- gchar *uri;
- GError *error = NULL;
- guint profiles_ok = 0;
- guint profiles_error = 0;
- gint index = 0;
- const gchar *name;
+ gchar **uris;
+ gchar *uri;
+ GError *error = NULL;
+ guint profiles_ok = 0;
+ guint profiles_error = 0;
+ gint index = 0;
+ const gchar *name;
ThreadCopyData *tcopy_data;
tcopy_data = (ThreadCopyData*) data;
@@ -764,13 +790,14 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
gdk_threads_leave();
while (uri != NULL) {
- GFile *file;
+ GFile *file;
GFileInfo *file_info;
file = g_file_new_for_uri(uri);
file_info = g_file_query_info(file,
- G_FILE_ATTRIBUTE_STANDARD_NAME "," G_FILE_ATTRIBUTE_STANDARD_TYPE,
- G_FILE_QUERY_INFO_NONE ,NULL, &error);
+ G_FILE_ATTRIBUTE_STANDARD_NAME ","
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NONE, NULL, &error);
if (error) {
libgnac_warning("%s\n",error->message);
++profiles_error;
@@ -778,32 +805,37 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
} else {
gboolean ok = FALSE;
- switch (tcopy_data->info) {
+ switch (tcopy_data->info)
+ {
case TARGET_URI:
if (g_file_info_get_file_type(file_info) == G_FILE_TYPE_REGULAR) {
name = g_file_info_get_name(file_info);
if (name != NULL) ok = TRUE;
}
break;
+
case TARGET_PLAIN:
if (g_file_info_get_file_type(file_info) == G_FILE_TYPE_UNKNOWN) {
name = g_file_get_basename(file);
if (name != NULL) ok = TRUE;
}
break;
+
default:
return;
}
if (ok) {
- if (gnac_profiles_properties_saved_profiles_contain_name(name,FALSE)) {
- libgnac_warning(_("Impossible to load file \"%s\": a profile with same file "
- "name already exists.\n"), uri);
+ if (gnac_profiles_properties_saved_profiles_contain_name(name, FALSE))
+ {
+ libgnac_warning(
+ _("Impossible to load file \"%s\": a profile with same file "
+ "name already exists.\n"), uri);
++profiles_error;
} else {
- gchar *path;
- GFile *dest;
- CopyData copy_data;
+ gchar *path;
+ GFile *dest;
+ CopyData copy_data;
path = g_build_filename(g_get_tmp_dir(), name, NULL);
dest = g_file_new_for_path(path);
@@ -817,11 +849,11 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
gdk_threads_leave();
g_file_copy(file, dest, G_FILE_COPY_NONE, NULL,
- (GFileProgressCallback) gnac_profiles_mgr_on_drag_profile_copied,
- ©_data, &error);
+ (GFileProgressCallback) gnac_profiles_mgr_on_drag_profile_copied,
+ ©_data, &error);
if (error) {
- libgnac_warning("%s\n",error->message);
+ libgnac_warning("%s\n", error->message);
g_clear_error(&error);
++profiles_error;
} else {
@@ -831,8 +863,9 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
g_object_unref(dest);
}
} else {
- libgnac_warning(_("Impossible to import the file \"%s\". File type not supported\n"),
- uri);
+ libgnac_warning(
+ _("Impossible to import the file \"%s\". File type not supported\n"),
+ uri);
++profiles_error;
}
}
@@ -850,7 +883,7 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
"%d files failed to be imported", profiles_error), profiles_error);
if (profiles_ok > 0) {
oks = g_strdup_printf(ngettext("%d file successfully imported",
- "%d files successfully imported", profiles_ok), profiles_ok);
+ "%d files successfully imported", profiles_ok), profiles_ok);
}
}
@@ -861,25 +894,27 @@ gnac_profiles_mgr_copy_and_load_files(gpointer data)
gdk_flush();
gdk_threads_leave();
+ /* Cleanup */
g_free(oks);
g_free(errors);
g_strfreev(tcopy_data->uris);
g_free(tcopy_data);
}
+
void
-gnac_profiles_mgr_on_drag_profile_copied( goffset current_num_bytes,
- goffset total_num_bytes,
- gpointer user_data)
+gnac_profiles_mgr_on_drag_profile_copied(goffset current_num_bytes,
+ goffset total_num_bytes,
+ gpointer user_data)
{
AudioProfileGeneric *profile;
CopyData *copy_data;
GFile *file;
-
- gdouble frac = ((gdouble) current_num_bytes)/ ((gdouble) total_num_bytes);
- if (frac > 1.0) frac = 1.0;
- else if (frac < 0.0) frac = 0.0;
+ /* CLAMP ensures that frac is between 0.0 and 1.0 */
+ gdouble frac = CLAMP(
+ ((gdouble) current_num_bytes) / ((gdouble) total_num_bytes),
+ 0.0, 1.0);
gdk_threads_enter();
gnac_profiles_mgr_set_progress_bar_fraction(frac);
@@ -891,8 +926,8 @@ gnac_profiles_mgr_on_drag_profile_copied( goffset current_num_bytes,
if (!copy_data->toggle) {
copy_data->toggle = TRUE;
} else {
- profile = gnac_profiles_properties_load_profile_from_file(copy_data->path,
- copy_data->name, copy_data->error);
+ profile = gnac_profiles_properties_load_profile_from_file(
+ copy_data->path, copy_data->name, copy_data->error);
if (profile != NULL) {
gdk_threads_enter();
gnac_profiles_properties_save_profile(profile);
@@ -907,10 +942,14 @@ gnac_profiles_mgr_on_drag_profile_copied( goffset current_num_bytes,
}
}
+
void
-gnac_profiles_mgr_on_drag_data_get(GtkWidget *widget,
- GdkDragContext *drag_context, GtkSelectionData *data, guint info, guint time,
- gpointer user_data)
+gnac_profiles_mgr_on_drag_data_get(GtkWidget *widget,
+ GdkDragContext *drag_context,
+ GtkSelectionData *data,
+ guint info,
+ guint time,
+ gpointer user_data)
{
gchar **uris;
@@ -919,23 +958,25 @@ gnac_profiles_mgr_on_drag_data_get(GtkWidget *widget,
gtk_selection_data_set_uris(data, uris);
}
+
static gchar **
gnac_profiles_mgr_get_selected_uris(void)
{
- GList *selected;
- GList *temp;
+ GList *selected;
+ GList *temp;
gchar **uris;
- gint i;
+ gint i;
selected = gnac_profiles_mgr_get_selected_rows();
uris = g_malloc((g_list_length(selected)+1) * sizeof(gchar*));
+
for (i = 0, temp = selected; temp != NULL; temp = temp->next, ++i) {
GFile *file;
AudioProfileGeneric *profile;
gchar *path;
- gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data, COL_PROFILE,
- (void**) &profile);
+ gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
+ COL_PROFILE, (gpointer*) &profile);
profile = profile->generic;
path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(profile->name), NULL);
file = g_file_new_for_path(path);
@@ -944,22 +985,28 @@ gnac_profiles_mgr_get_selected_uris(void)
}
uris[i] = NULL;
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
+
return uris;
}
gboolean
-gnac_profiles_mgr_on_drag_drop(GtkWidget *widget, GdkDragContext *drag_context,
- gint x, gint y, guint time, gpointer user_data)
+gnac_profiles_mgr_on_drag_drop(GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ guint time,
+ gpointer user_data)
{
return TRUE;
}
void
-gnac_profiles_mgr_on_add(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_add(GtkWidget *widget,
+ gpointer data)
{
gnac_profiles_properties_show(NULL, _("New Profile"),
G_CALLBACK(gnac_profiles_mgr_on_new_profile));
@@ -967,12 +1014,14 @@ gnac_profiles_mgr_on_add(GtkWidget *widget, gpointer data)
static void
-gnac_profiles_mgr_on_new_profile(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_new_profile(GtkWidget *widget,
+ gpointer data)
{
gnac_profiles_mgr_insert(data);
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
}
+
void
gnac_profiles_mgr_on_copy(GtkWidget *widget,
gpointer data)
@@ -990,12 +1039,13 @@ gnac_profiles_mgr_on_copy(GtkWidget *widget,
selected = gnac_profiles_mgr_get_selected_rows();
gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
- COL_PROFILE, (void**)&profile);
+ COL_PROFILE, (gpointer*)&profile);
generic = profile->generic;
- full_path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(generic->name), NULL);
+ full_path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(generic->name),
+ NULL);
new_name = g_strconcat(GNAC_SAVED_PROFILES_URL(generic->name),
- gettext(GNAC_COPY_SUFFIX), NULL);
+ gettext(GNAC_COPY_SUFFIX), NULL);
new_path = g_strconcat(new_name, ".xml", NULL);
src = g_file_new_for_path(full_path);
@@ -1005,9 +1055,11 @@ gnac_profiles_mgr_on_copy(GtkWidget *widget,
if (error)
{
libgnac_debug("Failed to copy the profile %s: %s",
- generic->name, error->message);
+ generic->name, error->message);
gnac_profiles_mgr_display_status_message(
- NULL, _("Failed to copy the profile"));
+ NULL, _("Failed to copy the profile"));
+
+ /* Cleanup */
g_clear_error(&error);
g_object_unref(src);
g_object_unref(dst);
@@ -1020,20 +1072,20 @@ gnac_profiles_mgr_on_copy(GtkWidget *widget,
}
copy_profile = gnac_profiles_properties_load_profile_from_file(
- new_path, new_name, &error);
+ new_path, new_name, &error);
if (copy_profile)
{
(copy_profile->generic)->name = g_strconcat(generic->name,
- gettext(GNAC_COPY_SUFFIX), NULL);
+ gettext(GNAC_COPY_SUFFIX), NULL);
gnac_profiles_properties_save_profile(copy_profile);
gnac_profiles_mgr_insert(copy_profile);
}
else if (error)
{
libgnac_debug("Failed to load the profile %s: %s",
- (copy_profile->generic)->name, error->message);
+ (copy_profile->generic)->name, error->message);
gnac_profiles_mgr_display_status_message(
- NULL, _("Failed to copy the profile"));
+ NULL, _("Failed to copy the profile"));
g_clear_error(&error);
}
@@ -1047,97 +1099,108 @@ gnac_profiles_mgr_on_copy(GtkWidget *widget,
g_list_free(selected);
}
+
void
-gnac_profiles_mgr_on_edit(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_edit(GtkWidget *widget,
+ gpointer data)
{
GList *selected;
AudioProfileGeneric *profile;
selected = gnac_profiles_mgr_get_selected_rows();
- gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data, COL_PROFILE, (void**)&profile);
+ gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
+ COL_PROFILE, (gpointer*)&profile);
profile->generic->user_data = selected->data;
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
- gnac_profiles_properties_show(profile,_("Edit Profile"),
+ gnac_profiles_properties_show(profile, _("Edit Profile"),
G_CALLBACK(gnac_profiles_mgr_on_edit_profile));
}
+
static void
-gnac_profiles_mgr_on_edit_profile(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_edit_profile(GtkWidget *widget,
+ gpointer data)
{
AudioProfileGeneric *profile;
AudioProfileGeneric *generic;
AudioProfileGeneric *old_generic;
- void *old_profile;
- gchar *formated_name;
+ gpointer old_profile;
+ gchar *formatted_name;
GList *selected;
//gchar *message;
selected = gnac_profiles_mgr_get_selected_rows();
- gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data, COL_PROFILE,
- &old_profile);
+ gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
+ COL_PROFILE, &old_profile);
old_generic = ((AudioProfileGeneric*)old_profile)->generic;
profile = (AudioProfileGeneric*) data;
generic = profile->generic;
- if (g_strcmp0(generic->name,old_generic->name)) {
+ if (g_strcmp0(generic->name, old_generic->name)) {
gnac_profiles_mgr_delete_profile_file(old_generic->name);
}
- formated_name = gnac_profiles_properties_filter_text_for_displaying(
- generic->name, MAX_NAME_DISPLAY_SIZE);
+ formatted_name = gnac_profiles_properties_filter_text_for_displaying(
+ generic->name, MAX_NAME_DISPLAY_SIZE);
gnac_profiles_mgr_set((GtkTreeRowReference*) selected->data,
- 0, formated_name,
- 1, generic->format_name,
- 2, generic->extension,
- 3, profile,
- -1);
+ 0, formatted_name,
+ 1, generic->format_name,
+ 2, generic->extension,
+ 3, profile,
+ -1);
- g_free(formated_name);
+ g_free(formatted_name);
gnac_profiles_properties_free_audio_profile(old_profile);
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
gnac_profiles_mgr_on_treeselection_changed();
}
+
void
-gnac_profiles_mgr_on_remove(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_remove(GtkWidget *widget,
+ gpointer data)
{
- GList *selected;
+ GList *selected;
GtkTreeModel *model;
- GtkTreePath *path;
- GtkTreeIter iter;
- gboolean new_selected = FALSE;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ gboolean new_selected = FALSE;
AudioProfileGeneric *profile;
selected = gnac_profiles_mgr_get_selected_rows();
if (selected != NULL) {
- gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data, COL_PROFILE,
- (void**) &profile);
+ gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
+ COL_PROFILE, (gpointer*) &profile);
gnac_profiles_mgr_delete_profile_file(profile->generic->name);
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
/* We can do this while selection is unique */
- model = gtk_tree_row_reference_get_model((GtkTreeRowReference*)selected->data);
- path = gtk_tree_row_reference_get_path((GtkTreeRowReference*)selected->data);
- if (gtk_tree_model_get_iter(model, &iter, path)) {
- if (gtk_tree_model_iter_next(model,&iter)
- || (gtk_tree_path_prev(path) && gtk_tree_model_get_iter(model, &iter, path))) {
+ model = gtk_tree_row_reference_get_model(
+ (GtkTreeRowReference*)selected->data);
+ path = gtk_tree_row_reference_get_path(
+ (GtkTreeRowReference*)selected->data);
- GtkTreeView *view;
+ if (gtk_tree_model_get_iter(model, &iter, path)) {
+ if (gtk_tree_model_iter_next(model, &iter)
+ || (gtk_tree_path_prev(path) &&
+ gtk_tree_model_get_iter(model, &iter, path)))
+ {
+ GtkTreeView *view;
GtkTreeSelection *selection;
view = GTK_TREE_VIEW(gtk_builder_get_object(profiles_mgr_builder,
- "profile_treeview"));
+ "profile_treeview"));
selection = gtk_tree_view_get_selection(view);
gtk_tree_selection_select_iter(selection, &iter);
new_selected = TRUE;
@@ -1149,117 +1212,138 @@ gnac_profiles_mgr_on_remove(GtkWidget *widget, gpointer data)
gnac_profiles_mgr_activate_buttons(new_selected);
gnac_profiles_mgr_show_description_frame(new_selected);
+ /* Cleanup */
gtk_tree_path_free(path);
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
}
-
}
+
static void
gnac_profiles_mgr_delete_profile_file(const gchar *name)
{
GFile *file;
gchar *full_path;
- full_path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(name) ,NULL);
+ full_path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(name), NULL);
file = g_file_new_for_path(full_path);
g_file_delete(file, NULL, NULL);
g_object_unref(file);
g_free(full_path);
}
+
void
gnac_profiles_mgr_on_row_inserted(GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer user_data)
{
+
}
+
void
gnac_profiles_mgr_on_row_deleted(GtkTreeModel *tree_model,
GtkTreePath *path,
gpointer user_data)
{
+
}
+
static void
gnac_profiles_mgr_on_treeselection_changed(void)
{
AudioProfileGeneric *profile;
- GList *selected;
+ GList *selected;
GtkWidget *widget;
selected = gnac_profiles_mgr_get_selected_rows();
- //When remove
+ // When remove
if (selected != NULL) {
gchar *descr;
gnac_profiles_mgr_activate_buttons(TRUE);
- gnac_profiles_mgr_display_status_message(NULL,NULL);
+ gnac_profiles_mgr_display_status_message(NULL, NULL);
- gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data, COL_PROFILE,
- (void**) &profile);
+ gnac_profiles_mgr_get((GtkTreeRowReference*)selected->data,
+ COL_PROFILE, (gpointer*) &profile);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "label-description-content"));
+ "label-description-content"));
descr = gnac_profiles_properties_filter_text_for_displaying(
- profile->generic->description, MAX_DESCR_DISPLAY_SIZE);
+ profile->generic->description, MAX_DESCR_DISPLAY_SIZE);
gtk_label_set_text(GTK_LABEL(widget), descr);
g_free(descr);
gnac_profiles_mgr_show_description_frame(TRUE);
- g_list_foreach (selected, (GFunc)gtk_tree_row_reference_free, NULL);
- g_list_free (selected);
+ /* Cleanup */
+ g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
+ g_list_free(selected);
}
}
+
void
-gnac_profiles_mgr_on_close(GtkWidget *widget, gpointer data)
+gnac_profiles_mgr_on_close(GtkWidget *widget,
+ gpointer data)
{
GtkWidget *window;
window = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "profile_manager_window"));
+ "profile_manager_window"));
gtk_widget_hide(window);
close_callback(widget, data);
}
+
gboolean
-gnac_profiles_mgr_on_delete_event(GtkWidget *widget, GdkEvent *event,
- gpointer user_data)
+gnac_profiles_mgr_on_delete_event(GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
{
- gnac_profiles_mgr_on_close(widget,user_data);
+ gnac_profiles_mgr_on_close(widget, user_data);
return TRUE;
}
+
gboolean
-gnac_profiles_mgr_list_on_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data)
+gnac_profiles_mgr_list_on_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data)
{
- switch (event->keyval) {
+ switch (event->keyval)
+ {
case GDK_Delete:
- gnac_profiles_mgr_on_remove(NULL,NULL);
+ gnac_profiles_mgr_on_remove(NULL, NULL);
break;
+
default:
break;
}
+
return FALSE;
}
+
gboolean
-gnac_profiles_mgr_on_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data)
+gnac_profiles_mgr_on_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data)
{
- switch (event->keyval) {
+ switch (event->keyval)
+ {
case GDK_Escape:
widget = GTK_WIDGET(gtk_builder_get_object(profiles_mgr_builder,
- "close_button"));
+ "close_button"));
gtk_button_clicked(GTK_BUTTON(widget));
return TRUE;
+
default:
break;
}
+
return FALSE;
}
diff --git a/src/profiles/gnac-profiles-manager.h b/src/profiles/gnac-profiles-manager.h
index 85b1ca5..2e41333 100644
--- a/src/profiles/gnac-profiles-manager.h
+++ b/src/profiles/gnac-profiles-manager.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,6 +29,8 @@
#include "gnac-profiles-properties.h"
#include "gnac-profiles-utils.h"
+G_BEGIN_DECLS
+
void
gnac_profiles_mgr_init(StandardCallBack call_back);
@@ -45,33 +47,49 @@ void
gnac_profiles_mgr_show(void);
-//GtkBuilder handler
+// GtkBuilder handler
void
-gnac_profiles_mgr_on_drag_data_received( GtkWidget* widget,
- GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data,
- guint info, guint time, gpointer data);
+gnac_profiles_mgr_on_drag_data_received(GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ GtkSelectionData *selection_data,
+ guint info,
+ guint time,
+ gpointer data);
void
-gnac_profiles_mgr_on_drag_data_get(GtkWidget *widget,
- GdkDragContext *drag_context, GtkSelectionData *data, guint info, guint time,
- gpointer user_data);
+gnac_profiles_mgr_on_drag_data_get(GtkWidget *widget,
+ GdkDragContext *drag_context,
+ GtkSelectionData *data,
+ guint info,
+ guint time,
+ gpointer user_data);
gboolean
-gnac_profiles_mgr_on_drag_drop(GtkWidget *widget, GdkDragContext *drag_context,
- gint x, gint y, guint time, gpointer user_data);
+gnac_profiles_mgr_on_drag_drop(GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ guint time,
+ gpointer user_data);
void
-gnac_profiles_mgr_on_add(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_add(GtkWidget *widget,
+ gpointer data);
void
-gnac_profiles_mgr_on_copy(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_copy(GtkWidget *widget,
+ gpointer data);
void
-gnac_profiles_mgr_on_edit(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_edit(GtkWidget *widget,
+ gpointer data);
void
-gnac_profiles_mgr_on_remove(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_remove(GtkWidget *widget,
+ gpointer data);
void
gnac_profiles_mgr_on_row_inserted(GtkTreeModel *tree_model,
@@ -85,18 +103,24 @@ gnac_profiles_mgr_on_row_deleted(GtkTreeModel *tree_model,
gpointer user_data);
void
-gnac_profiles_mgr_on_close(GtkWidget *widget, gpointer data);
+gnac_profiles_mgr_on_close(GtkWidget *widget,
+ gpointer data);
gboolean
-gnac_profiles_mgr_on_delete_event(GtkWidget *widget, GdkEvent *event,
- gpointer user_data);
+gnac_profiles_mgr_on_delete_event(GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
gboolean
-gnac_profiles_mgr_list_on_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data);
+gnac_profiles_mgr_list_on_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data);
gboolean
-gnac_profiles_mgr_on_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data);
+gnac_profiles_mgr_on_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data);
+
+G_END_DECLS
#endif /* GNAC_PROFILES_MANAGER_H */
diff --git a/src/profiles/gnac-profiles-properties.c b/src/profiles/gnac-profiles-properties.c
index 0ee5738..794e62d 100644
--- a/src/profiles/gnac-profiles-properties.c
+++ b/src/profiles/gnac-profiles-properties.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -29,25 +29,30 @@
#include <gdk/gdkkeysyms.h>
#include <gio/gio.h>
+#include <glib/gi18n.h>
#include <gmodule.h>
#include <stdlib.h>
-#include <glib/gi18n.h>
-#include "gnac-profiles-properties.h"
+#include "formats/gnac-profiles-aac.h"
+#include "formats/gnac-profiles-flac.h"
+#include "formats/gnac-profiles-lame.h"
+#include "formats/gnac-profiles-speex.h"
+#include "formats/gnac-profiles-unknown.h"
+#include "formats/gnac-profiles-vorbis.h"
+#include "formats/gnac-profiles-wav.h"
+#include "formats/gnac-profiles-wavpack.h"
+
#include "gnac-profiles-default.h"
-#include "libgnac-debug.h"
+#include "gnac-profiles-properties.h"
+#include "libgnac-debug.h"
-#ifdef _WIN32
- #ifndef __WIN32
- #define __WIN32
- #endif
-#endif
+#define NB_PLUGINS 8
-#ifdef __WIN32
+#ifdef G_OS_WIN32
static const guint nb_forbidden_chars = 11;
//TODO put correct GDK key event
-static const char forbidden_chars[] = {'\\', '/', ':', '*', '?', '"',
+static const gchar forbidden_chars[] = {'\\', '/', ':', '*', '?', '"',
'<', '>', '|', '{', '}'};
static const gchar *forbidden_chars_string = "\\ / : * ? \" < > | { }";
#else
@@ -57,17 +62,6 @@ static const gchar forbidden_chars[] = {'/','\n','\t'};
static const gchar *forbidden_chars_string = " /, <return>, <tab>";
#endif
-#define NB_PLUGINS 8
-
-#include "formats/gnac-profiles-aac.h"
-#include "formats/gnac-profiles-flac.h"
-#include "formats/gnac-profiles-lame.h"
-#include "formats/gnac-profiles-speex.h"
-#include "formats/gnac-profiles-unknown.h"
-#include "formats/gnac-profiles-vorbis.h"
-#include "formats/gnac-profiles-wav.h"
-#include "formats/gnac-profiles-wavpack.h"
-
static FormatModuleGetFuncs formats_get_funcs[NB_PLUGINS] = {
gnac_profiles_aac_get_funcs,
gnac_profiles_flac_get_funcs,
@@ -82,7 +76,7 @@ static FormatModuleGetFuncs formats_get_funcs[NB_PLUGINS] = {
//static WindowSize properties_window_size;
typedef struct {
- FormatModuleFuncs funcs;
+ FormatModuleFuncs funcs;
//GModule *module;
GtkTreeRowReference *tree_ref;
} FormatModule;
@@ -90,9 +84,9 @@ typedef struct {
static GHashTable *formats;
static FormatModule *current_format_module;
-static GtkBuilder *profiles_properties_builder = NULL;
-static gulong save_button_handler_id = 0;
-static const gchar *current_profile_name;
+static GtkBuilder *profiles_properties_builder = NULL;
+static gulong save_button_handler_id = 0;
+static const gchar *current_profile_name;
static void
gnac_profiles_properties_init_format(void);
@@ -106,7 +100,7 @@ gnac_profiles_properties_find_modules(void);*/
static void
gnac_profiles_properties_combo_format_on_changed(GtkComboBox *widget,
- gpointer user_data);
+ gpointer user_data);
static void
gnac_profiles_properties_update_textbuffer(const gchar *pipeline);
@@ -121,18 +115,21 @@ static gboolean
gnac_profiles_properties_is_valid_filename_char(guint keyval);
static void
-gnac_profiles_properties_on_save(GtkWidget *widget, gpointer data);
+gnac_profiles_properties_on_save(GtkWidget *widget,
+ gpointer data);
static void
gnac_profiles_properties_name_description_set_text(const gchar *name,
- const gchar *description);
+ const gchar *description);
static void
gnac_profiles_properties_reinit(void);
+
void
gnac_profiles_properties_init(void)
{
+ GError *error = NULL;
GtkWidget *widget;
GtkWidget *combo_format;
GtkWidget *hbox_properties;
@@ -141,114 +138,129 @@ gnac_profiles_properties_init(void)
profiles_properties_builder = gtk_builder_new();
formats = g_hash_table_new(g_str_hash,g_str_equal);
- saved_profiles_dir = g_build_filename(g_get_home_dir(), ".gnac", "profiles",
- NULL);
+ saved_profiles_dir = g_build_filename(g_get_home_dir(),
+ ".gnac", "profiles", NULL);
- GError *error = NULL;
if (!gtk_builder_add_from_file(profiles_properties_builder,
- PKGDATADIR "/profiles/gnac-profiles-properties.xml", &error)) {
+ PKGDATADIR "/profiles/gnac-profiles-properties.xml", &error))
+ {
libgnac_critical("%s\n",error->message);
g_error_free(error);
exit(EXIT_FAILURE);
}
- hbox_properties = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "hbox_properties"));
+ hbox_properties = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "hbox_properties"));
- //Set up combo format
+ // Set up combo format
combo_format = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "format_combo_box"));
- gtk_builder_connect_signals (profiles_properties_builder, NULL);
+ "format_combo_box"));
+ gtk_builder_connect_signals(profiles_properties_builder, NULL);
renderer_format = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_format),
- renderer_format, FALSE);
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_format),
+ renderer_format, FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_format),
- renderer_format, "text", 0, NULL);
+ renderer_format, "text", 0, NULL);
- g_signal_connect (G_OBJECT (combo_format), "changed",
- G_CALLBACK (gnac_profiles_properties_combo_format_on_changed), hbox_properties);
+ g_signal_connect(G_OBJECT(combo_format), "changed",
+ G_CALLBACK(gnac_profiles_properties_combo_format_on_changed),
+ hbox_properties);
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"window1"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "window1"));
gtk_window_set_type_hint(GTK_WINDOW(widget), GDK_WINDOW_TYPE_HINT_DIALOG);
- g_signal_connect (G_OBJECT (widget), "delete_event",
- G_CALLBACK (gtk_widget_hide), NULL);
+ g_signal_connect(G_OBJECT (widget), "delete_event",
+ G_CALLBACK(gtk_widget_hide), NULL);
- gtk_builder_connect_signals (profiles_properties_builder, NULL);
+ gtk_builder_connect_signals(profiles_properties_builder, NULL);
gnac_profiles_properties_init_format();
gnac_profiles_properties_display_status_message(NULL);
- gtk_window_set_modal(GTK_WINDOW(widget),TRUE);
-
+ gtk_window_set_modal(GTK_WINDOW(widget), TRUE);
}
+
void
gnac_profiles_properties_set_parent(GtkWidget *parent)
{
GtkWidget *widget;
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"window1"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "window1"));
gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(parent));
gtk_window_set_position(GTK_WINDOW(widget), GTK_WIN_POS_CENTER_ON_PARENT);
}
+
static void
gnac_profiles_properties_init_format(void) {
- GtkWidget *widget;
- GtkWidget *format_combo_box;
- GtkWidget *hbox_properties;
- GtkWidget *properties;
+ GtkWidget *widget;
+ GtkWidget *format_combo_box;
+ GtkWidget *hbox_properties;
+ GtkWidget *properties;
GtkListStore *model;
- GtkTreeIter iter;
- GtkTreePath *tree_path;
- const gchar *format_id;
- gchar *format_name;
- int i;
+ GtkTreeIter iter;
+ GtkTreePath *tree_path;
+ const gchar *format_id;
+ gchar *format_name;
+ gint i;
- hbox_properties = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "hbox_properties"));
-
- format_combo_box = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "format_combo_box"));
- model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(format_combo_box)));
+ hbox_properties = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "hbox_properties"));
+ format_combo_box = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "format_combo_box"));
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 2, GTK_SORT_ASCENDING);
-
+ model = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(format_combo_box)));
+
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 2,
+ GTK_SORT_ASCENDING);
- for (i = 0; i<NB_PLUGINS; ++i) {
+ for (i = 0; i < NB_PLUGINS; ++i) {
FormatModule *format_module;
- GtkWidget *pipeline_box;
+ GtkWidget *pipeline_box;
format_module = g_malloc(sizeof(FormatModule));
format_module->funcs = formats_get_funcs[i]();
- format_id = format_module->funcs.init(gnac_profiles_properties_update_textbuffer);
+ format_id = format_module->funcs.init(
+ gnac_profiles_properties_update_textbuffer);
format_name = format_module->funcs.get_combo_format_name();
g_hash_table_insert(formats, (gpointer) format_id, format_module);
gtk_list_store_append(model, &iter);
- if (g_strcmp0(format_id,"custom-format")) {
- gtk_list_store_set(model, &iter, 0, format_name, 1, format_module,
- 2, format_name, -1);
+ if (g_strcmp0(format_id, "custom-format")) {
+ gtk_list_store_set(model, &iter,
+ 0, format_name,
+ 1, format_module,
+ 2, format_name,
+ -1);
} else {
- //This is a big hack to be sure that Custom Format will be at the end :-D
- gtk_list_store_set(model, &iter, 0, format_name, 1, format_module,
- 2, "ZZZZZZZZZZZZZZZZZZZ", -1);
+ // XXX This is a big hack to be sure that Custom Format
+ // will be at the end :-D
+ gtk_list_store_set(model, &iter,
+ 0, format_name,
+ 1, format_module,
+ 2, "ZZZZZZZZZZZZZZZZZZZ",
+ -1);
}
+
tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), &iter);
format_module->tree_ref = gtk_tree_row_reference_new(
- GTK_TREE_MODEL(model), tree_path);
+ GTK_TREE_MODEL(model), tree_path);
gtk_tree_path_free(tree_path);
if (format_module->funcs.set_pipeline_func != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_text_view"));
- pipeline_box = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_box"));
- format_module->funcs.set_pipeline_func(GTK_TEXT_VIEW(widget), pipeline_box);
+ "gstreamer_pipeline_text_view"));
+ pipeline_box = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "gstreamer_pipeline_box"));
+ format_module->funcs.set_pipeline_func(GTK_TEXT_VIEW(widget),
+ pipeline_box);
}
properties = format_module->funcs.get_widget(NULL);
@@ -259,50 +271,53 @@ gnac_profiles_properties_init_format(void) {
}
}
-/*
-static void
+
+/*static void
gnac_profiles_properties_init_modules(void)
{
- GList *list;
- GList *temp;
- GModule *module;
- GtkWidget *widget;
- GtkWidget *format_combo_box;
- GtkWidget *hbox_properties;
+ GList *list;
+ GList *temp;
+ GModule *module;
+ GtkWidget *widget;
+ GtkWidget *format_combo_box;
+ GtkWidget *hbox_properties;
GtkListStore *model;
- GtkTreeIter iter;
- GtkTreePath *tree_path;
+ GtkTreeIter iter;
+ GtkTreePath *tree_path;
- hbox_properties = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "hbox_properties"));
+ hbox_properties = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "hbox_properties"));
list = gnac_profiles_properties_find_modules();
temp = list;
- format_combo_box = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "format_combo_box"));
- model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(format_combo_box)));
+ format_combo_box = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "format_combo_box"));
+ model = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(format_combo_box)));
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 2, GTK_SORT_ASCENDING);
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model), 2,
+ GTK_SORT_ASCENDING);
while (temp != NULL) {
module = g_module_open(temp->data, G_MODULE_BIND_LAZY);
if (module == NULL) {
- libgnac_warning(_("Impossible to load format module %s\n"), (gchar*) temp->data);
+ libgnac_warning(_("Impossible to load format module %s\n"),
+ (gchar*) temp->data);
} else {
- FormatModule *format_module;
- FormatModuleFuncs *format_funcs;
- FormatModuleInitFunc module_init;
- FormatModuleGetComboFormatNameFunc get_combo_format_name;
- FormatModuleSetPipelineTextViewFunc set_pipeline_text_view;
- FormatModuleGetPluginName get_plugin_name;
+ FormatModule *format_module;
+ FormatModuleFuncs *format_funcs;
+ FormatModuleInitFunc module_init;
+ FormatModuleGetComboFormatNameFunc get_combo_format_name;
+ FormatModuleSetPipelineTextViewFunc set_pipeline_text_view;
+ FormatModuleGetPluginName get_plugin_name;
const gchar *format_id;
const gchar *plugin_name;
- gchar *format_name;
- GstPlugin *plugin;
- GtkWidget *properties;
+ gchar *format_name;
+ GstPlugin *plugin;
+ GtkWidget *properties;
- g_module_symbol(module, "gnac_profiles_format_init",
- (gpointer*) &module_init);
+ g_module_symbol(module, "gnac_profiles_format_init",
+ (gpointer*) &module_init);
if (module_init) {
format_id = module_init(gnac_profiles_properties_update_textbuffer);
@@ -311,26 +326,26 @@ gnac_profiles_properties_init_modules(void)
format_funcs = &(format_module->funcs);
g_module_symbol(module, "gnac_profiles_format_get_description",
- (gpointer*) &format_funcs->get_description);
+ (gpointer*) &format_funcs->get_description);
g_module_symbol(module, "gnac_profiles_format_generate_pipeline",
- (gpointer*) &format_funcs->generate_pipeline);
+ (gpointer*) &format_funcs->generate_pipeline);
g_module_symbol(module, "gnac_profiles_format_generate_audio_profile",
- (gpointer*) &format_funcs->generate_audio_profile);
+ (gpointer*) &format_funcs->generate_audio_profile);
g_module_symbol(module, "gnac_profiles_format_free_audio_profile",
- (gpointer*) &format_funcs->free_audio_profile);
+ (gpointer*) &format_funcs->free_audio_profile);
g_module_symbol(module, "gnac_profiles_format_fullfill_fields",
- (gpointer*) &format_funcs->fullfill_fields);
+ (gpointer*) &format_funcs->fullfill_fields);
g_module_symbol(module, "gnac_profiles_format_get_widget",
- (gpointer*) &format_funcs->get_widget);
+ (gpointer*) &format_funcs->get_widget);
g_module_symbol(module, "gnac_profiles_format_save_profile",
- (gpointer*) &format_funcs->save_profile_in_file);
+ (gpointer*) &format_funcs->save_profile_in_file);
g_module_symbol(module, "gnac_profiles_format_load_specific_properties",
- (gpointer*) &format_funcs->load_specific_properties);
+ (gpointer*) &format_funcs->load_specific_properties);
g_module_symbol(module, "gnac_profiles_format_clean_up",
- (gpointer*) &format_funcs->clean_up);
+ (gpointer*) &format_funcs->clean_up);
g_module_symbol(module, "gnac_profiles_format_get_plugin_name",
- (gpointer*) &get_plugin_name);
+ (gpointer*) &get_plugin_name);
plugin_name = get_plugin_name();
plugin = gst_plugin_load_by_name(plugin_name);
if (plugin != NULL) {
@@ -341,28 +356,38 @@ gnac_profiles_properties_init_modules(void)
format_name = get_combo_format_name();
gtk_list_store_append(model, &iter);
- if (g_strcmp0(format_id,"custom-format")) {
- gtk_list_store_set(model, &iter, 0, format_name, 1, format_module,
- 2, format_name, -1);
+ if (g_strcmp0(format_id, "custom-format")) {
+ gtk_list_store_set(model, &iter,
+ 0, format_name,
+ 1, format_module,
+ 2, format_name,
+ -1);
} else {
- //This is a big hack to be sure that Custom Format will be at the end :-D
- gtk_list_store_set(model, &iter, 0, format_name, 1, format_module,
- 2, "ZZZZZZZZZZZZZZZZZZZ", -1);
+ // This is a big hack to be sure that Custom Format will be
+ // at the end :-D
+ gtk_list_store_set(model, &iter,
+ 0, format_name,
+ 1, format_module,
+ 2, "ZZZZZZZZZZZZZZZZZZZ",
+ -1);
}
tree_path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), &iter);
format_module->tree_ref = gtk_tree_row_reference_new(
- GTK_TREE_MODEL(model), tree_path);
+ GTK_TREE_MODEL(model), tree_path);
gtk_tree_path_free(tree_path);
- if (g_module_symbol(module, "gnac_profiles_format_set_pipeline_text_view",
- (gpointer*) &set_pipeline_text_view)) {
+ if (g_module_symbol(module,
+ "gnac_profiles_format_set_pipeline_text_view",
+ (gpointer*) &set_pipeline_text_view))
+ {
GtkWidget *pipeline_box;
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_text_view"));
- pipeline_box = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_box"));
+ widget = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "gstreamer_pipeline_text_view"));
+ pipeline_box = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "gstreamer_pipeline_box"));
set_pipeline_text_view(GTK_TEXT_VIEW(widget), pipeline_box);
}
+
properties = format_funcs->get_widget(NULL);
gtk_box_pack_start_defaults(GTK_BOX(hbox_properties), properties);
gtk_widget_hide(properties);
@@ -374,29 +399,31 @@ gnac_profiles_properties_init_modules(void)
}
} else {
- libgnac_warning("Impossible to find format module init function for"
- " module %s\n", (gchar *) temp->data);
+ libgnac_warning(
+ "Impossible to find format module init function for module %s\n",
+ (gchar*) temp->data);
}
}
+
temp = temp->next;
}
g_list_foreach(list, (GFunc) g_free ,NULL);
g_list_free(list);
-
}
+
static GList *
gnac_profiles_properties_find_modules(void)
{
- GList *list = NULL;
- GFile *dir;
+ GList *list = NULL;
+ GFile *dir;
GFileEnumerator *files;
- GFileInfo *file_info;
- GError *error = NULL;
+ GFileInfo *file_info;
+ GError *error = NULL;
dir = g_file_new_for_path(PLUGINDIR);
- if (!g_file_query_exists(dir,NULL)) {
+ if (!g_file_query_exists(dir, NULL)) {
libgnac_warning(_("The format modules directory does not exist\n"));
g_error_free(error);
}
@@ -408,7 +435,8 @@ gnac_profiles_properties_find_modules(void)
G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &error);
if (files != NULL) {
- while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL) {
+ while ((file_info = g_file_enumerator_next_file(files, NULL, NULL)) != NULL)
+ {
guint32 type;
const gchar *content_type;
@@ -416,11 +444,12 @@ gnac_profiles_properties_find_modules(void)
content_type = g_file_info_get_content_type(file_info);
if ((type == G_FILE_TYPE_REGULAR)
- && (!g_strcmp0("application/x-sharedlib",content_type))) {
- GFile *module;
- gchar *module_path;
+ && !g_strcmp0("application/x-sharedlib",content_type))
+ {
+ GFile *module;
+ gchar *module_path;
const gchar *module_name;
- gchar *module_full_path;
+ gchar *module_full_path;
module = g_file_enumerator_get_container(files);
module_path = g_file_get_path(module);
@@ -429,56 +458,68 @@ gnac_profiles_properties_find_modules(void)
g_free(module_path);
list = g_list_append(list, module_full_path);
}
+
g_object_unref(file_info);
}
} else {
- libgnac_warning("%s:%s\n", _("Unable to browse to format directory\n"),
- error->message);
+ libgnac_warning("%s:%s\n",
+ _("Unable to browse to format directory\n"),
+ error->message);
g_error_free(error);
}
+
g_object_unref(dir);
g_file_enumerator_close(files, NULL, NULL);
g_object_unref(files);
return list;
-}
-*/
+}*/
void
-gnac_profiles_properties_show(void *profile, const gchar *title, GCallback call_back)
+gnac_profiles_properties_show(gpointer profile,
+ const gchar *title,
+ GCallback call_back)
{
AudioProfileGeneric *p;
- GtkWidget *widget;
- GtkWidget *format_combo_box;
- FormatModule *format_module;
- GtkTreeIter iter;
- GtkTreePath *tree_path;
- GtkTreeModel *model;
+ GtkWidget *widget;
+ GtkWidget *format_combo_box;
+ FormatModule *format_module;
+ GtkTreeIter iter;
+ GtkTreePath *tree_path;
+ GtkTreeModel *model;
gnac_profiles_properties_reinit();
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"save-button"));
- if (g_signal_handler_is_connected(G_OBJECT(widget), save_button_handler_id)) {
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "save-button"));
+
+ if (g_signal_handler_is_connected(G_OBJECT(widget), save_button_handler_id))
+ {
g_signal_handler_disconnect(G_OBJECT(widget), save_button_handler_id);
}
- save_button_handler_id = g_signal_connect (G_OBJECT (widget), "clicked",
- G_CALLBACK(gnac_profiles_properties_on_save), call_back);
+
+ save_button_handler_id = g_signal_connect(G_OBJECT(widget), "clicked",
+ G_CALLBACK(gnac_profiles_properties_on_save), call_back);
- widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"window1"));
- gtk_window_set_title(GTK_WINDOW(widget),title);
- format_combo_box = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"format_combo_box"));
+ widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "window1"));
+ gtk_window_set_title(GTK_WINDOW(widget), title);
+
+ format_combo_box = GTK_WIDGET(gtk_builder_get_object(
+ profiles_properties_builder, "format_combo_box"));
if (profile == NULL) {
gtk_widget_show(widget);
gtk_combo_box_set_active(GTK_COMBO_BOX(format_combo_box), 0);
} else {
p = ((AudioProfileGeneric*)profile)->generic;
- format_module = g_hash_table_lookup(formats,p->format_id);
+ format_module = g_hash_table_lookup(formats, p->format_id);
if (format_module == NULL) {
libgnac_warning(_("Format not supported\n"));
} else {
model = gtk_combo_box_get_model(GTK_COMBO_BOX(format_combo_box));
- gnac_profiles_properties_name_description_set_text(p->name, p->description);
+ gnac_profiles_properties_name_description_set_text(p->name,
+ p->description);
format_module->funcs.fullfill_fields(profile);
tree_path = gtk_tree_row_reference_get_path(format_module->tree_ref);
gtk_tree_model_get_iter(model, &iter, tree_path);
@@ -492,13 +533,13 @@ gnac_profiles_properties_show(void *profile, const gchar *title, GCallback call_
void
-gnac_profiles_properties_free_audio_profile(void *profile)
+gnac_profiles_properties_free_audio_profile(gpointer profile)
{
AudioProfileGeneric *p;
FormatModule *format_module;
p = ((AudioProfileGeneric*)profile)->generic;
- format_module = g_hash_table_lookup(formats,p->format_id);
+ format_module = g_hash_table_lookup(formats, p->format_id);
if (format_module == NULL) {
libgnac_warning(_("Format not supported\n"));
} else {
@@ -511,9 +552,9 @@ void
gnac_profiles_properties_destroy(void)
{
if (formats) {
- GList *list;
- GList *temp;
- GtkWidget *window;
+ GList *list;
+ GList *temp;
+ GtkWidget *window;
FormatModule *format_module;
list = g_hash_table_get_values(formats);
@@ -523,52 +564,60 @@ gnac_profiles_properties_destroy(void)
//g_module_close(format_module->module);
g_free(format_module);
}
+
+ /* Cleanup */
g_list_free(list);
g_hash_table_destroy(formats);
formats = NULL;
g_free(saved_profiles_dir);
- window = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"window1"));
+
+ window = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "window1"));
g_object_unref(G_OBJECT(profiles_properties_builder));
gtk_widget_destroy(window);
}
}
+
static void
-gnac_profiles_properties_combo_format_on_changed(GtkComboBox *widget, gpointer user_data)
+gnac_profiles_properties_combo_format_on_changed(GtkComboBox *widget,
+ gpointer user_data)
{
- GtkWidget *properties;
- GtkWidget *hbox_properties;
- GtkWidget *label;
- GtkWidget *text_view;
+ GtkWidget *properties;
+ GtkWidget *hbox_properties;
+ GtkWidget *label;
+ GtkWidget *text_view;
GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
FormatModule *format_module;
model = gtk_combo_box_get_model(widget);
if (gtk_combo_box_get_active_iter(widget, &iter)) {
- gtk_tree_model_get(model,&iter,1,(void**)&format_module,-1);
+ gtk_tree_model_get(model, &iter, 1, (gpointer*)&format_module, -1);
gnac_profiles_properties_display_status_message(NULL);
hbox_properties = GTK_WIDGET(user_data);
- if ((current_format_module != NULL)
- && (format_module != current_format_module)) {
+ if ((current_format_module != NULL)
+ && (format_module != current_format_module))
+ {
properties = current_format_module->funcs.get_widget(NULL);
gtk_widget_hide(properties);
}
text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_text_view"));
+ "gstreamer_pipeline_text_view"));
gtk_text_view_set_editable(GTK_TEXT_VIEW(text_view), FALSE);
#ifndef GNOME_ENABLE_DEBUG
- text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_box"));
- gtk_widget_hide(text_view);
+ text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "gstreamer_pipeline_box"));
+ gtk_widget_hide(text_view);
#endif /* GNOME_ENABLE_DEBUG */
label = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "format_decription_label"));
- gtk_label_set_markup(GTK_LABEL(label), format_module->funcs.get_description());
+ "format_decription_label"));
+ gtk_label_set_markup(GTK_LABEL(label),
+ format_module->funcs.get_description());
properties = format_module->funcs.get_widget(NULL);
gtk_widget_show(properties);
format_module->funcs.generate_pipeline(NULL);
@@ -580,27 +629,29 @@ gnac_profiles_properties_combo_format_on_changed(GtkComboBox *widget, gpointer u
static void
gnac_profiles_properties_update_textbuffer(const gchar *pipeline)
{
- GtkWidget *text_view;
+ GtkWidget *text_view;
GtkTextBuffer *pipeline_text_buffer;
text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_text_view"));
+ "gstreamer_pipeline_text_view"));
pipeline_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
- gtk_text_buffer_set_text(pipeline_text_buffer,pipeline,g_utf8_strlen(pipeline,-1));
+ gtk_text_buffer_set_text(pipeline_text_buffer, pipeline,
+ g_utf8_strlen(pipeline, -1));
}
+
static void
gnac_profiles_properties_display_status_message(const gchar *error)
{
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "hbox-properties-status"));
+ "hbox-properties-status"));
if (error != NULL) {
gtk_widget_show_all(widget);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "label-properties-status-error"));
+ "label-properties-status-error"));
gtk_label_set_text(GTK_LABEL(widget), error);
} else {
@@ -608,13 +659,14 @@ gnac_profiles_properties_display_status_message(const gchar *error)
}
}
+
static void
gnac_profiles_properties_reinit() {
GList *list;
GList *temp;
gnac_profiles_properties_update_textbuffer("");
- gnac_profiles_properties_name_description_set_text("","");
+ gnac_profiles_properties_name_description_set_text("", "");
list = g_hash_table_get_values(formats);
for (temp = list; temp != NULL; temp = temp->next) {
((FormatModule*)temp->data)->funcs.fullfill_fields(NULL);
@@ -622,43 +674,47 @@ gnac_profiles_properties_reinit() {
g_list_free(list);
}
+
static void
gnac_profiles_properties_name_description_set_text(const gchar *name,
- const gchar *description)
+ const gchar *description)
{
- GtkWidget *widget;
+ GtkWidget *widget;
GtkTextBuffer *text_buffer;
if (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
"name_entry"));
- gtk_entry_set_text(GTK_ENTRY(widget),name);
+ gtk_entry_set_text(GTK_ENTRY(widget), name);
current_profile_name = name;
}
if (description != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "profile_description_text_view"));
+ "profile_description_text_view"));
text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
- gtk_text_buffer_set_text(GTK_TEXT_BUFFER(text_buffer),description,
- g_utf8_strlen(description,-1));
+ gtk_text_buffer_set_text(GTK_TEXT_BUFFER(text_buffer), description,
+ g_utf8_strlen(description, -1));
}
}
+
static void
-gnac_profiles_properties_on_save(GtkWidget *widget, gpointer data)
+gnac_profiles_properties_on_save(GtkWidget *widget,
+ gpointer data)
{
- GtkWidget *window;
- GtkTextBuffer *text_buffer;
- GtkTextIter start;
- GtkTextIter end;
- const gchar *name;
- StandardCallBack call_back = (StandardCallBack) data;
- void *profile;
+ GtkWidget *window;
+ GtkTextBuffer *text_buffer;
+ GtkTextIter start;
+ GtkTextIter end;
+ const gchar *name;
+ StandardCallBack call_back = (StandardCallBack) data;
+ gpointer profile;
AudioProfileGeneric *generic;
- GError *error = NULL;
+ GError *error = NULL;
- window = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,"window1"));
+ window = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
+ "window1"));
profile = current_format_module->funcs.generate_audio_profile(&error);
if (profile == NULL) {
@@ -671,23 +727,23 @@ gnac_profiles_properties_on_save(GtkWidget *widget, gpointer data)
GtkTextBuffer *pipeline_text_buffer;
text_view = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "gstreamer_pipeline_text_view"));
+ "gstreamer_pipeline_text_view"));
pipeline_text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
generic = ((AudioProfileGeneric*) profile)->generic;
if (generic->pipeline == NULL) {
- gtk_text_buffer_get_start_iter(pipeline_text_buffer,&start);
- gtk_text_buffer_get_end_iter(pipeline_text_buffer,&end);
+ gtk_text_buffer_get_start_iter(pipeline_text_buffer, &start);
+ gtk_text_buffer_get_end_iter(pipeline_text_buffer, &end);
generic->pipeline = gtk_text_buffer_get_text(pipeline_text_buffer,
- &start,&end,FALSE);
+ &start, &end, FALSE);
}
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
"name_entry"));
name = gtk_entry_get_text(GTK_ENTRY(widget));
- if (!g_strcmp0(name,"")) {
+ if (!g_strcmp0(name, "")) {
gnac_profiles_properties_display_status_message(
_("The profile name must be non-empty"));
} else if (!gnac_profiles_properties_is_valid_filename_chars(name)) {
@@ -699,21 +755,21 @@ gnac_profiles_properties_on_save(GtkWidget *widget, gpointer data)
gnac_profiles_properties_display_status_message(message);
g_free(message);
} else if (g_strcmp0(current_profile_name, name)
- && (gnac_profiles_properties_saved_profiles_contain_name(name,TRUE))) {
-
+ && (gnac_profiles_properties_saved_profiles_contain_name(name, TRUE)))
+ {
gnac_profiles_properties_display_status_message(
_("This name is already used by another profile."));
-
} else {
gnac_profiles_properties_display_status_message(NULL);
generic->name = g_strdup(name);
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "profile_description_text_view"));
+ "profile_description_text_view"));
text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
- gtk_text_buffer_get_start_iter(text_buffer,&start);
- gtk_text_buffer_get_end_iter(text_buffer,&end);
- generic->description = gtk_text_buffer_get_text(text_buffer,&start,&end,FALSE);
+ gtk_text_buffer_get_start_iter(text_buffer, &start);
+ gtk_text_buffer_get_end_iter(text_buffer, &end);
+ generic->description = gtk_text_buffer_get_text(text_buffer,
+ &start, &end, FALSE);
current_format_module->funcs.save_profile_in_file(profile);
@@ -724,15 +780,17 @@ gnac_profiles_properties_on_save(GtkWidget *widget, gpointer data)
}
}
+
gboolean
-gnac_profiles_properties_on_name_entry_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data)
+gnac_profiles_properties_on_name_entry_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data)
{
if (event->keyval == GDK_Return) {
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "save-button"));
+ "save-button"));
gtk_button_clicked(GTK_BUTTON(widget));
return TRUE;
} else if (gnac_profiles_properties_is_valid_filename_char(event->keyval)) {
@@ -750,15 +808,17 @@ gnac_profiles_properties_on_name_entry_key_pressed(GtkWidget *widget,
}
}
+
gboolean
-gnac_profiles_properties_on_window_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data)
+gnac_profiles_properties_on_window_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data)
{
if (event->keyval == GDK_Escape) {
GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "cancel-button"));
+ "cancel-button"));
gtk_button_clicked(GTK_BUTTON(widget));
return TRUE;
} else {
@@ -766,12 +826,13 @@ gnac_profiles_properties_on_window_key_pressed(GtkWidget *widget,
}
}
+
static gboolean
gnac_profiles_properties_is_valid_filename_char(guint keyval)
{
guint i;
- for (i = 0; i<nb_forbidden_chars; ++i) {
+ for (i = 0; i < nb_forbidden_chars; ++i) {
if (keyval == forbidden_chars_keys[i]) {
return FALSE;
}
@@ -780,37 +841,42 @@ gnac_profiles_properties_is_valid_filename_char(guint keyval)
return TRUE;
}
+
static gboolean
gnac_profiles_properties_is_valid_filename_chars(const gchar *chars) {
glong len;
- int i;
- int j;
+ gint i;
+ gint j;
len = g_utf8_strlen(chars, -1);
- for (i = 0; i<len; ++i) {
- for (j = 0; j<nb_forbidden_chars; ++j) {
+ for (i = 0; i < len; ++i) {
+ for (j = 0; j < nb_forbidden_chars; ++j) {
if (chars[i] == forbidden_chars[j]) {
return FALSE;
}
}
}
+
return TRUE;
}
void
-gnac_profiles_properties_on_cancel(GtkWidget *widget, gpointer data)
+gnac_profiles_properties_on_cancel(GtkWidget *widget,
+ gpointer data)
{
GtkWidget *window;
window = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
- "window1"));
+ "window1"));
gtk_widget_hide(window);
}
-void *
-gnac_profiles_properties_load_profile_from_file(const gchar *path,
- const gchar *filename, GError **error)
+
+gpointer
+gnac_profiles_properties_load_profile_from_file(const gchar *path,
+ const gchar *filename,
+ GError **error)
{
XMLDoc *doc;
AudioProfileGeneric *profile;
@@ -824,7 +890,7 @@ gnac_profiles_properties_load_profile_from_file(const gchar *path,
}
} else {
- format_module = g_hash_table_lookup(formats,profile->format_id);
+ format_module = g_hash_table_lookup(formats, profile->format_id);
if (format_module == NULL) {
if ((error) && (*error == NULL)) {
*error = g_error_new(g_quark_from_static_string("gnac"), 0,
@@ -834,7 +900,7 @@ gnac_profiles_properties_load_profile_from_file(const gchar *path,
gnac_profiles_utils_free_audio_profile_generic(profile);
profile = NULL;
} else {
- profile = format_module->funcs.load_specific_properties(doc,profile);
+ profile = format_module->funcs.load_specific_properties(doc, profile);
}
}
@@ -842,30 +908,36 @@ gnac_profiles_properties_load_profile_from_file(const gchar *path,
return profile;
}
+
gboolean
gnac_profiles_properties_saved_profiles_contain_name(const gchar *name,
- gboolean add_ext)
+ gboolean add_ext)
{
- gchar *path;
- GFile *file;
- gboolean exists;
+ gchar *path;
+ GFile *file;
+ gboolean exists;
if (!add_ext) {
path = g_strconcat(GNAC_SAVED_PROFILES_URL(name), NULL);
} else {
path = g_strconcat(GNAC_SAVED_PROFILES_URL_WITH_EXT(name), NULL);
}
+
file = g_file_new_for_path(path);
- exists = g_file_query_exists(file,NULL);
+ exists = g_file_query_exists(file, NULL);
+ /* Cleanup */
g_free(path);
g_object_unref(file);
+
return exists;
}
+
void
-gnac_profiles_properties_save_profile(void *profile) {
- const gchar *format_id;
+gnac_profiles_properties_save_profile(gpointer profile)
+{
+ const gchar *format_id;
FormatModule *format_module;
format_id = ((AudioProfileGeneric*)profile)->generic->format_id;
@@ -875,8 +947,11 @@ gnac_profiles_properties_save_profile(void *profile) {
}
}
+
gchar *
-gnac_profiles_properties_filter_text_for_displaying(const gchar *text, int length) {
+gnac_profiles_properties_filter_text_for_displaying(const gchar *text,
+ gint length)
+{
gchar *str1;
gchar *str2;
glong len;
@@ -885,12 +960,12 @@ gnac_profiles_properties_filter_text_for_displaying(const gchar *text, int lengt
len = g_utf8_strlen(text, -1);
if (len > length) {
str2 = g_strndup(text, length);
- str1 = g_strconcat(str2,"...", NULL);
+ str1 = g_strconcat(str2, "...", NULL);
g_free(str2);
} else {
str1 = g_strdup(text);
}
- g_strdelimit(str1,"\n\t\r\b\f",' ');
+ g_strdelimit(str1, "\n\t\r\b\f", ' ');
return str1;
} else {
return NULL;
diff --git a/src/profiles/gnac-profiles-properties.h b/src/profiles/gnac-profiles-properties.h
index e4811a9..89aaa37 100644
--- a/src/profiles/gnac-profiles-properties.h
+++ b/src/profiles/gnac-profiles-properties.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -27,11 +27,12 @@
#define GNAC_PROFILES_PROPERTIES_H
#include <gtk/gtk.h>
-#include <gst/gst.h>
#define MAX_DESCR_DISPLAY_SIZE 497
#define MAX_NAME_DISPLAY_SIZE 23
+G_BEGIN_DECLS
+
void
gnac_profiles_properties_init(void);
@@ -39,39 +40,48 @@ void
gnac_profiles_properties_set_parent(GtkWidget *parent);
void
-gnac_profiles_properties_show(void *profile, const gchar *title, GCallback call_back);
+gnac_profiles_properties_show(gpointer profile,
+ const gchar *title,
+ GCallback call_back);
-void *
-gnac_profiles_properties_load_profile_from_file(const gchar *path,
- const gchar *filename, GError **error);
+gpointer
+gnac_profiles_properties_load_profile_from_file(const gchar *path,
+ const gchar *filename,
+ GError **error);
void
-gnac_profiles_properties_free_audio_profile(void *profile);
+gnac_profiles_properties_free_audio_profile(gpointer profile);
void
gnac_profiles_properties_destroy(void);
gboolean
gnac_profiles_properties_saved_profiles_contain_name(const gchar *name,
- gboolean add_ext);
+ gboolean add_ext);
void
-gnac_profiles_properties_save_profile(void *profile);
+gnac_profiles_properties_save_profile(gpointer profile);
-//GtkBuilder handler
+// GtkBuilder handler
void
-gnac_profiles_properties_on_cancel(GtkWidget *widget, gpointer data);
+gnac_profiles_properties_on_cancel(GtkWidget *widget,
+ gpointer data);
gboolean
-gnac_profiles_properties_on_name_entry_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data);
+gnac_profiles_properties_on_name_entry_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data);
gboolean
-gnac_profiles_properties_on_window_key_pressed(GtkWidget *widget,
- GdkEventKey *event, gpointer data);
+gnac_profiles_properties_on_window_key_pressed(GtkWidget *widget,
+ GdkEventKey *event,
+ gpointer data);
gchar *
-gnac_profiles_properties_filter_text_for_displaying(const gchar *text, int length);
+gnac_profiles_properties_filter_text_for_displaying(const gchar *text,
+ gint length);
+
+G_END_DECLS
#endif /* GNAC_PROFILES_PROPERTIES_H */
diff --git a/src/profiles/gnac-profiles-utils.c b/src/profiles/gnac-profiles-utils.c
index 9ba1c40..af11a0e 100755
--- a/src/profiles/gnac-profiles-utils.c
+++ b/src/profiles/gnac-profiles-utils.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -23,163 +23,204 @@
* Boston, MA 02110-1301 USA
*/
+#include <stdlib.h>
+
#include "gnac-profiles-utils.h"
#include "libgnac-debug.h"
-#include <stdlib.h>
-
gchar *raw = NULL;
gchar *audioconvert = NULL;
+
void
-gnac_profiles_utils_init_name_extension(XMLDoc *doc, const gchar *format,
- gchar **name, gchar **extension)
+gnac_profiles_utils_init_name_extension(XMLDoc *doc,
+ const gchar *format,
+ gchar **name,
+ gchar **extension)
{
gchar *xpath_query_name;
gchar *xpath_query_extension;
xpath_query_name = g_strconcat("//profile[ id='", format, "']/name", NULL);
xpath_query_extension = g_strconcat("//profile[ id='", format,
- "']/output-file-extension", NULL);
+ "']/output-file-extension", NULL);
*name = gnac_profiles_xml_engine_get_text_node(doc, xpath_query_name);
- *extension = gnac_profiles_xml_engine_get_text_node(doc, xpath_query_extension);
+ *extension = gnac_profiles_xml_engine_get_text_node(doc,
+ xpath_query_extension);
+ /* Cleanup */
g_free(xpath_query_name);
g_free(xpath_query_extension);
}
gchar *
-gnac_profiles_utils_get_combo_format_name(gchar *name, gchar *extension)
+gnac_profiles_utils_get_combo_format_name(gchar *name,
+ gchar *extension)
{
return g_strconcat(name, " (.", extension, ")", NULL);
}
+
gchar *
-gnac_profiles_utils_init_description(XMLDoc *doc, const gchar *format)
+gnac_profiles_utils_init_description(XMLDoc *doc,
+ const gchar *format)
{
gchar *xpath_query;
gchar *raw_desc;
gchar *desc;
xpath_query = g_strconcat("//profile[ id='", format, "']/description", NULL);
- raw_desc = gnac_profiles_xml_engine_get_text_node(doc,xpath_query);
+ raw_desc = gnac_profiles_xml_engine_get_text_node(doc, xpath_query);
desc = g_strconcat("<i>", raw_desc, "</i>", NULL);
+
+ /* Cleanup */
g_free(xpath_query);
g_free(raw_desc);
return desc;
}
+
GtkWidget *
gnac_profiles_utils_all_in_one_for_combo(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *combo_name, const gchar *xpath_query)
+ GCallback call_back,
+ const gchar *combo_name,
+ const gchar *xpath_query)
{
- GtkWidget* widget;
+ GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, combo_name));
if (widget != NULL) {
- gnac_profiles_utils_register_combo(widget,bfi->doc,xpath_query,
- call_back,NULL);
+ gnac_profiles_utils_register_combo(widget, bfi->doc, xpath_query,
+ call_back, NULL);
} else {
libgnac_warning("Combo %s not found\n", combo_name);
}
+
return widget;
}
+
GtkWidget *
gnac_profiles_utils_all_in_one_for_slider(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *slider_name, const gchar *xpath_query)
+ GCallback call_back,
+ const gchar *slider_name,
+ const gchar *xpath_query)
{
- GtkWidget* widget;
+ GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, slider_name));
if (widget != NULL) {
- gnac_profiles_utils_register_slider(widget,bfi->doc,xpath_query,
- call_back,NULL);
+ gnac_profiles_utils_register_slider(widget, bfi->doc, xpath_query,
+ call_back, NULL);
} else {
libgnac_warning("Slider %s not found\n", slider_name);
}
+
return widget;
}
+
GtkWidget *
gnac_profiles_utils_all_in_one_for_check(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *check_name, const gchar *xpath_query)
+ GCallback call_back,
+ const gchar *check_name,
+ const gchar *xpath_query)
{
- GtkWidget* widget;
+ GtkWidget *widget;
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, check_name));
if (widget != NULL) {
- gnac_profiles_utils_register_check(widget,bfi->doc,xpath_query,
- call_back,NULL);
+ gnac_profiles_utils_register_check(widget, bfi->doc, xpath_query,
+ call_back, NULL);
} else {
libgnac_warning("Check %s not found\n", check_name);
}
+
return widget;
}
GtkWidget *
gnac_profiles_utils_add_toggle_signal(BasicFormatInfo *bfi,
- const gchar *check, GCallback f, gpointer user_data)
+ const gchar *check,
+ GCallback f,
+ gpointer user_data)
{
GtkWidget *widget;
- widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder,
- check));
- g_signal_connect (G_OBJECT (widget), "toggled", f, user_data);
+ widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, check));
+ g_signal_connect(G_OBJECT(widget), "toggled", f, user_data);
return widget;
}
+
gint
-gnac_profiles_utils_register_combo(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data)
+gnac_profiles_utils_register_combo(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data)
{
ComboValues *combo;
gint result;
combo = g_malloc(sizeof(ComboValues));
- result = gnac_profiles_xml_engine_get_combo_values(doc,xpath_query,combo);
+ result = gnac_profiles_xml_engine_get_combo_values(doc, xpath_query, combo);
if (result == 0) {
- gnac_profiles_utils_add_values_combo(widget,combo);
+ gnac_profiles_utils_add_values_combo(widget, combo);
g_object_set_data(G_OBJECT(widget), "combo-values", combo);
- g_signal_connect (G_OBJECT(widget), "changed", call_back , user_data);
+ g_signal_connect(G_OBJECT(widget), "changed", call_back, user_data);
} else {
- libgnac_warning("Impossible to register combo with xpath query %s\n", xpath_query);
+ libgnac_warning("Impossible to register combo with xpath query %s\n",
+ xpath_query);
g_free(combo);
}
+
return result;
}
+
gint
-gnac_profiles_utils_register_slider(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data)
+gnac_profiles_utils_register_slider(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data)
{
SliderValues *slider;
gint result;
slider = g_malloc(sizeof(SliderValues));
- result = gnac_profiles_xml_engine_get_slider_values(doc,xpath_query,slider);
+ result = gnac_profiles_xml_engine_get_slider_values(doc, xpath_query, slider);
if (result == 0) {
- gnac_profiles_utils_add_values_slider(widget,slider);
+ gnac_profiles_utils_add_values_slider(widget, slider);
g_object_set_data(G_OBJECT(widget), "slider-values", slider);
- g_signal_connect (G_OBJECT(widget), "value-changed", call_back , user_data);
- //g_signal_connect (G_OBJECT(widget), "button-release-event", call_back , user_data);
- //g_signal_connect (G_OBJECT(widget), "key-release-event", call_back , user_data);
- //g_signal_connect (G_OBJECT(widget), "leave-notify-event", call_back , user_data);
+ g_signal_connect(G_OBJECT(widget), "value-changed", call_back, user_data);
+ //g_signal_connect(G_OBJECT(widget), "button-release-event",
+ // call_back, user_data);
+ //g_signal_connect(G_OBJECT(widget), "key-release-event",
+ // call_back, user_data);
+ //g_signal_connect(G_OBJECT(widget), "leave-notify-event",
+ // call_back, user_data);
} else {
- libgnac_warning("Impossible to register slider with xpath query %s\n", xpath_query);
+ libgnac_warning("Impossible to register slider with xpath query %s\n",
+ xpath_query);
g_free(slider);
}
+
return result;
}
gint
-gnac_profiles_utils_register_check(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data)
+gnac_profiles_utils_register_check(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data)
{
CheckValues *check;
gint result;
@@ -188,74 +229,82 @@ gnac_profiles_utils_register_check(GtkWidget *widget, XMLDoc *doc,
result = gnac_profiles_xml_engine_get_check_values(doc, xpath_query, check);
if (result == 0) {
g_object_set_data(G_OBJECT(widget), "check-values", check);
- g_signal_connect (G_OBJECT(widget), "toggled", call_back , user_data);
+ g_signal_connect(G_OBJECT(widget), "toggled", call_back, user_data);
} else {
- libgnac_warning("Impossible to register check with xpath query %s\n", xpath_query);
+ libgnac_warning("Impossible to register check with xpath query %s\n",
+ xpath_query);
g_free(check);
}
+
return result;
}
GtkWidget *
gnac_profiles_utils_register_advanced_channels(GtkBuilder *builder,
- XMLDoc *doc, GCallback call_back, gpointer user_data)
+ XMLDoc *doc,
+ GCallback call_back,
+ gpointer user_data)
{
GtkWidget *widget = NULL;
widget = GTK_WIDGET(gtk_builder_get_object(builder, "combo-channels"));
if (widget != NULL) {
gnac_profiles_utils_register_combo(widget, doc,
- "//variable[ id='channels']/*", call_back, user_data);
+ "//variable[ id='channels']/*", call_back, user_data);
} else {
libgnac_warning("Impossible to find widget %s\n", "combo-channels");
}
+
return widget;
}
+
GtkWidget *
gnac_profiles_utils_register_advanced_sample_rate(GtkBuilder *builder,
- XMLDoc *doc, GCallback call_back, gpointer user_data)
+ XMLDoc *doc,
+ GCallback call_back,
+ gpointer user_data)
{
GtkWidget *widget = NULL;
widget = GTK_WIDGET(gtk_builder_get_object(builder, "combo-sample-rate"));
if (widget != NULL) {
gnac_profiles_utils_register_combo(widget, doc,
- "//variable[ id='sample-rate']/*", call_back, user_data);
+ "//variable[ id='sample-rate']/*", call_back, user_data);
} else {
libgnac_warning("Impossible to find widget %s\n", "combo-sample-rate");
}
+
return widget;
}
void
-gnac_profiles_utils_add_values_combo(GtkWidget *combo, ComboValues *values)
+gnac_profiles_utils_add_values_combo(GtkWidget *combo,
+ ComboValues *values)
{
- GtkTreeModel *model;
+ GtkTreeModel *model;
GtkCellRenderer *renderer;
- GList *list_names;
- GList *list_values;
+ GList *list_names;
+ GList *list_values;
- model = GTK_TREE_MODEL(gtk_list_store_new(1,G_TYPE_STRING));
+ model = GTK_TREE_MODEL(gtk_list_store_new(1, G_TYPE_STRING));
renderer = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo),
- renderer, FALSE);
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo),
- renderer, "text", 0, NULL);
- gtk_combo_box_set_model(GTK_COMBO_BOX(combo),model);
+ renderer, "text", 0, NULL);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(combo), model);
list_names = values->names;
list_values= values->values;
gint index = 0;
while (list_names != NULL) {
gtk_combo_box_append_text(GTK_COMBO_BOX(combo),
- (const gchar*) list_names->data);
+ (const gchar*) list_names->data);
- if (!g_strcmp0(values->default_value,
- (const gchar*) list_values->data)) {
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo),index);
+ if (!g_strcmp0(values->default_value, (const gchar*) list_values->data)) {
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
}
list_names = list_names->next;
@@ -264,16 +313,17 @@ gnac_profiles_utils_add_values_combo(GtkWidget *combo, ComboValues *values)
}
}
+
void
gnac_profiles_utils_reinit_values_combo(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
+ GtkWidget *widget;
ComboValues *values;
- va_list ap;
- void *v;
+ va_list ap;
+ gpointer v;
- va_start(ap,bfi);
- v = va_arg(ap,void*);
+ va_start(ap, bfi);
+ v = va_arg(ap, gpointer);
while (v != NULL) {
const gchar *combo_name = (const gchar *) v;
@@ -282,17 +332,19 @@ gnac_profiles_utils_reinit_values_combo(BasicFormatInfo *bfi, ...)
gnac_profiles_utils_set_value_combo(widget, values->default_value);
- v = va_arg(ap,void*);
+ v = va_arg(ap, gpointer);
}
va_end(ap);
}
+
void
-gnac_profiles_utils_set_value_combo(GtkWidget *combo, const gchar *value)
+gnac_profiles_utils_set_value_combo(GtkWidget *combo,
+ const gchar *value)
{
ComboValues *values;
- GList *list_values;
- gint index;
+ GList *list_values;
+ gint index;
values = g_object_get_data(G_OBJECT(combo), "combo-values");
list_values= values->values;
@@ -300,26 +352,27 @@ gnac_profiles_utils_set_value_combo(GtkWidget *combo, const gchar *value)
index = 0;
while (list_values != NULL) {
if (!g_strcmp0(value, (const gchar*) list_values->data)) {
- gtk_combo_box_set_active(GTK_COMBO_BOX(combo),index);
+ gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
}
list_values = list_values->next;
++index;
}
}
+
void
gnac_profiles_utils_set_values_combo(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
- value = va_arg(ap,const gchar *);
+ value = va_arg(ap, const gchar *);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
gnac_profiles_utils_set_value_combo(widget, value);
@@ -329,21 +382,22 @@ gnac_profiles_utils_set_values_combo(BasicFormatInfo *bfi, ...)
va_end(ap);
}
+
void
gnac_profiles_utils_set_values_checked_combo(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name_combo;
const gchar *name_checkbox;
const gchar *value;
- va_start(ap,bfi);
- name_combo = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name_combo = va_arg(ap, const gchar *);
while (name_combo != NULL) {
- name_checkbox = va_arg(ap,const gchar *);
- value = va_arg(ap,const gchar *);
+ name_checkbox = va_arg(ap, const gchar *);
+ value = va_arg(ap, const gchar *);
if (value != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name_combo));
@@ -366,32 +420,35 @@ gnac_profiles_utils_get_value_combo(GtkWidget *combo)
gint index;
index = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
- values = g_object_get_data(G_OBJECT(combo),"combo-values");
- return g_strconcat(g_list_nth_data(values->values,index),NULL);
+ values = g_object_get_data(G_OBJECT(combo), "combo-values");
+ return g_strconcat(g_list_nth_data(values->values, index), NULL);
}
+
void
-gnac_profiles_utils_add_values_slider(GtkWidget *slider, SliderValues *values)
+gnac_profiles_utils_add_values_slider(GtkWidget *slider,
+ SliderValues *values)
{
gtk_scale_set_digits(GTK_SCALE(slider), 0);
- gtk_range_set_range(GTK_RANGE(slider),values->min,values->max);
- gtk_range_set_value(GTK_RANGE(slider),values->default_value);
+ gtk_range_set_range(GTK_RANGE(slider), values->min, values->max);
+ gtk_range_set_value(GTK_RANGE(slider), values->default_value);
gtk_range_set_increments(GTK_RANGE(slider), values->step, values->step);
}
+
void
gnac_profiles_utils_get_values_combo_and_set(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
- const gchar *name;
- gchar **value;
+ GtkWidget *widget;
+ va_list ap;
+ const gchar *name;
+ gchar **value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
- value = va_arg(ap,gchar **);
+ value = va_arg(ap, gchar **);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
*value = gnac_profiles_utils_get_value_combo(widget);
@@ -399,23 +456,23 @@ gnac_profiles_utils_get_values_combo_and_set(BasicFormatInfo *bfi, ...)
name = va_arg(ap, const gchar *);
}
va_end(ap);
-
}
+
void
gnac_profiles_utils_get_values_checked_combo_and_set(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
- const gchar *name;
- const gchar *checkbox_name;
+ GtkWidget *widget;
+ va_list ap;
+ const gchar *name;
+ const gchar *checkbox_name;
const gchar **value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
- value = va_arg(ap,const gchar **);
+ value = va_arg(ap, const gchar **);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, checkbox_name));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
@@ -428,69 +485,72 @@ gnac_profiles_utils_get_values_checked_combo_and_set(BasicFormatInfo *bfi, ...)
va_end(ap);
}
+
void
gnac_profiles_utils_reinit_values_slider(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
+ GtkWidget *widget;
SliderValues *values;
- va_list ap;
- void *v;
+ va_list ap;
+ gpointer v;
- va_start(ap,bfi);
- v = va_arg(ap,void*);
+ va_start(ap, bfi);
+ v = va_arg(ap, gpointer);
while (v != NULL) {
const gchar *slider_name = (const gchar *) v;
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, slider_name));
values = g_object_get_data(G_OBJECT(widget), "slider-values");
- gtk_range_set_value(GTK_RANGE(widget),values->default_value);
+ gtk_range_set_value(GTK_RANGE(widget), values->default_value);
- v = va_arg(ap,void*);
+ v = va_arg(ap, gpointer);
}
va_end(ap);
}
+
void
gnac_profiles_utils_set_values_slider(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- gdouble value;
+ gdouble value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
- value = va_arg(ap,gdouble);
+ value = va_arg(ap, gdouble);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- gtk_range_set_value(GTK_RANGE(widget),value);
+ gtk_range_set_value(GTK_RANGE(widget), value);
name = va_arg(ap, const gchar *);
}
va_end(ap);
}
+
void
gnac_profiles_utils_set_values_checked_slider(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *checkbox_name;
- gdouble value;
+ gdouble value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
- value = va_arg(ap,gdouble);
+ value = va_arg(ap, gdouble);
if (value != -1) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- gtk_range_set_value(GTK_RANGE(widget),value);
+ gtk_range_set_value(GTK_RANGE(widget), value);
}
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, checkbox_name));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), (value != -1));
@@ -498,22 +558,22 @@ gnac_profiles_utils_set_values_checked_slider(BasicFormatInfo *bfi, ...)
name = va_arg(ap, const gchar *);
}
va_end(ap);
-
}
+
void
gnac_profiles_utils_get_values_slider_and_set(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- gdouble *value;
+ gdouble *value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL){
- value = va_arg(ap,gdouble*);
+ value = va_arg(ap, gdouble*);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
*value = gtk_range_get_value(GTK_RANGE(widget));
@@ -523,21 +583,22 @@ gnac_profiles_utils_get_values_slider_and_set(BasicFormatInfo *bfi, ...)
va_end(ap);
}
+
void
gnac_profiles_utils_get_values_checked_slider_and_set(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *checkbox_name;
- gdouble *value;
+ gdouble *value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
- value = va_arg(ap,gdouble*);
+ value = va_arg(ap, gdouble*);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, checkbox_name));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
@@ -547,19 +608,19 @@ gnac_profiles_utils_get_values_checked_slider_and_set(BasicFormatInfo *bfi, ...)
name = va_arg(ap, const gchar *);
}
va_end(ap);
-
}
+
void
gnac_profiles_utils_reinit_values_check(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
+ GtkWidget *widget;
CheckValues *values;
- va_list ap;
- void *v;
+ va_list ap;
+ gpointer v;
- va_start(ap,bfi);
- v = va_arg(ap,void*);
+ va_start(ap, bfi);
+ v = va_arg(ap, gpointer);
while (v != NULL) {
const gchar *check_name = (const gchar *) v;
@@ -567,64 +628,68 @@ gnac_profiles_utils_reinit_values_check(BasicFormatInfo *bfi, ...)
values = g_object_get_data(G_OBJECT(widget), "check-values");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
- values->default_value);
+ values->default_value);
- v = va_arg(ap,void*);
+ v = va_arg(ap, gpointer);
}
va_end(ap);
}
+
void
gnac_profiles_utils_set_values_check(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
- value = va_arg(ap,const gchar *);
+ value = va_arg(ap, const gchar *);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
- (!g_strcmp0(value, "true")));
+ !g_strcmp0(value, "true"));
name = va_arg(ap, const gchar *);
}
va_end(ap);
}
+
void
gnac_profiles_utils_get_values_check_and_set(BasicFormatInfo *bfi, ...)
{
- GtkWidget *widget;
- va_list ap;
- const gchar *name;
+ GtkWidget *widget;
+ va_list ap;
+ const gchar *name;
const gchar **value;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL){
- value = va_arg(ap,const gchar **);
+ value = va_arg(ap, const gchar **);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- *value = g_strdup((gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))
- ? "true" : "false"));
+ *value = g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) ?
+ "true" : "false");
name = va_arg(ap, const gchar *);
}
va_end(ap);
}
+
void
gnac_profiles_utils_add_description_tooltip(BasicFormatInfo *bfi,
- const gchar *xpath_query, ...)
+ const gchar *xpath_query,
+ ...)
{
GtkWidget *widget;
- gchar *description;
- va_list ap;
+ gchar *description;
+ va_list ap;
description = gnac_profiles_xml_engine_get_text_node(bfi->doc, xpath_query);
if (description != NULL) {
@@ -640,80 +705,100 @@ gnac_profiles_utils_add_description_tooltip(BasicFormatInfo *bfi,
}
}
+
void
gnac_profiles_utils_init_raw_audioconvert(XMLDoc *doc)
{
if ((raw == NULL) && (audioconvert == NULL)) {
raw = gnac_profiles_xml_engine_get_text_node(doc,
- "//process[ id='gstreamer-audio']");
-
+ "//process[ id='gstreamer-audio']");
audioconvert = gnac_profiles_xml_engine_get_text_node(doc,
- "//process[ id='audioconvert']");
+ "//process[ id='audioconvert']");
}
}
+
gchar *
-gnac_profiles_utils_get_basepipeline(const gchar *channels, const gchar *rate)
+gnac_profiles_utils_get_basepipeline(const gchar *channels,
+ const gchar *rate)
{
- return g_strconcat(audioconvert," ! ", raw, ", rate=",rate, ", channels=",
- channels, " ! ", audioconvert, NULL);
+ return g_strconcat(audioconvert, " ! ", raw, ", rate=", rate,
+ ", channels=", channels, " ! ", audioconvert, NULL);
}
+
gchar *
-gnac_profiles_utils_add_pipe(gchar *pipeline, gchar *new_pipe)
+gnac_profiles_utils_add_pipe(gchar *pipeline,
+ gchar *new_pipe)
{
gchar *temp;
+
temp = g_strconcat(pipeline, " ! ", new_pipe, NULL);
+
g_free(pipeline);
+
return temp;
}
+
gchar *
-gnac_profiles_utils_add_pipes(gchar *pipeline, GList *values)
+gnac_profiles_utils_add_pipes(gchar *pipeline,
+ GList *values)
{
GList *list_temp = values;
+
while (list_temp != NULL) {
Value *v = list_temp->data;
gchar *temp;
- if (!g_strcmp0("",pipeline)) {
- temp = g_strconcat(v->value,NULL);
+ if (!g_strcmp0("", pipeline)) {
+ temp = g_strconcat(v->value, NULL);
} else {
- temp = g_strconcat(pipeline," ! ",v->value,NULL);
+ temp = g_strconcat(pipeline, " ! ", v->value, NULL);
}
+
+ /* Cleanup */
g_free(pipeline);
g_free(v->name);
g_free(v->value);
g_free(v);
+
pipeline = temp;
list_temp = list_temp->next;
}
+
return pipeline;;
}
+
gchar *
-gnac_profiles_utils_add_property_combo(gchar *pipeline, GtkWidget *combo)
+gnac_profiles_utils_add_property_combo(gchar *pipeline,
+ GtkWidget *combo)
{
- gchar *temp;
+ gchar *temp;
ComboValues *values;
- gint index;
+ gint index;
- index = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
- values = g_object_get_data(G_OBJECT(combo),"combo-values");
- gchar *value = g_list_nth_data(values->values,index);
- temp = g_strconcat(pipeline," ", values->variable_name, "=", value ,NULL);
+ index = gtk_combo_box_get_active(GTK_COMBO_BOX(combo));
+ values = g_object_get_data(G_OBJECT(combo), "combo-values");
+ gchar *value = g_list_nth_data(values->values, index);
+ temp = g_strconcat(pipeline, " ", values->variable_name, "=", value, NULL);
g_free(pipeline);
+
return temp;
}
+
gchar *
-gnac_profiles_utils_add_properties_combo(gchar *pipeline, BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_add_properties_combo(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
@@ -726,16 +811,19 @@ gnac_profiles_utils_add_properties_combo(gchar *pipeline, BasicFormatInfo *bfi,
return pipeline;
}
+
gchar *
-gnac_profiles_utils_add_properties_checked_combo(gchar *pipeline, BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_add_properties_checked_combo(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *checkbox_name;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
@@ -752,61 +840,75 @@ gnac_profiles_utils_add_properties_checked_combo(gchar *pipeline, BasicFormatInf
return pipeline;
}
+
gchar *
-gnac_profiles_utils_add_property_slider(gchar *pipeline, const gchar *format,
- gdouble factor, GtkWidget *slider)
+gnac_profiles_utils_add_property_slider(gchar *pipeline,
+ const gchar *format,
+ gdouble factor,
+ GtkWidget *slider)
{
- gchar *temp;
- gdouble value;
- gchar *value_str;
+ gchar *temp;
+ gdouble value;
+ gchar *value_str;
SliderValues *values;
value = gtk_range_get_value(GTK_RANGE(slider));
- values = g_object_get_data(G_OBJECT(slider),"slider-values");
- value_str = gnac_profiles_utils_gdouble_to_gchararray_format(value*factor,format);
- temp = g_strconcat(pipeline," ", values->variable_name, "=",
- value_str, NULL);
+ values = g_object_get_data(G_OBJECT(slider), "slider-values");
+ value_str = gnac_profiles_utils_gdouble_to_gchararray_format(value*factor,
+ format);
+ temp = g_strconcat(pipeline, " ", values->variable_name,
+ "=", value_str, NULL);
+
+ /* Cleanup */
g_free(pipeline);
g_free(value_str);
+
return temp;
}
+
gchar *
-gnac_profiles_utils_add_properties_slider(gchar *pipeline, BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_add_properties_slider(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1, widget);
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1,
+ widget);
name = va_arg(ap, const gchar *);
}
va_end(ap);
return pipeline;
-
}
+
gchar *
-gnac_profiles_utils_add_properties_slider_format(gchar *pipeline,
- BasicFormatInfo *bfi, const gchar *format, ...)
+gnac_profiles_utils_add_properties_slider_format(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ const gchar *format,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- va_start(ap,format);
- name = va_arg(ap,const gchar *);
+ va_start(ap, format);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, format, 1, widget);
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline, format, 1,
+ widget);
name = va_arg(ap, const gchar *);
}
@@ -815,23 +917,27 @@ gnac_profiles_utils_add_properties_slider_format(gchar *pipeline,
return pipeline;
}
+
gchar *
-gnac_profiles_utils_add_properties_checked_slider(gchar *pipeline, BasicFormatInfo *bfi, ...)
+gnac_profiles_utils_add_properties_checked_slider(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *checkbox_name;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, checkbox_name));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1, widget);
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline, "%.0f", 1,
+ widget);
}
name = va_arg(ap, const gchar *);
@@ -841,24 +947,29 @@ gnac_profiles_utils_add_properties_checked_slider(gchar *pipeline, BasicFormatIn
return pipeline;
}
+
gchar *
-gnac_profiles_utils_add_properties_checked_slider_format(gchar *pipeline,
- BasicFormatInfo *bfi, const gchar *format, ...)
+gnac_profiles_utils_add_properties_checked_slider_format(
+ gchar *pipeline,
+ BasicFormatInfo *bfi,
+ const gchar *format,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
const gchar *checkbox_name;
- va_start(ap,format);
- name = va_arg(ap,const gchar *);
+ va_start(ap, format);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
checkbox_name = va_arg(ap, const gchar *);
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, checkbox_name));
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
- pipeline = gnac_profiles_utils_add_property_slider(pipeline, format, 1, widget);
+ pipeline = gnac_profiles_utils_add_property_slider(pipeline, format, 1,
+ widget);
}
name = va_arg(ap, const gchar *);
@@ -868,31 +979,36 @@ gnac_profiles_utils_add_properties_checked_slider_format(gchar *pipeline,
return pipeline;
}
+
gchar *
-gnac_profiles_utils_add_property_check(gchar *pipeline, GtkWidget *check)
+gnac_profiles_utils_add_property_check(gchar *pipeline,
+ GtkWidget *check)
{
- gchar *temp;
- gboolean checked;
+ gchar *temp;
+ gboolean checked;
CheckValues *values;
checked = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check));
- values = g_object_get_data(G_OBJECT(check),"check-values");
- temp = g_strconcat(pipeline," ", values->variable_name, "=",
- (checked ? "true" : "false") , NULL);
+ values = g_object_get_data(G_OBJECT(check), "check-values");
+ temp = g_strconcat(pipeline, " ", values->variable_name,
+ "=", checked ? "true" : "false", NULL);
g_free(pipeline);
+
return temp;
}
+
gchar *
-gnac_profiles_utils_add_properties_check(gchar *pipeline, BasicFormatInfo *bfi,
- ...)
+gnac_profiles_utils_add_properties_check(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- va_start(ap,bfi);
- name = va_arg(ap,const gchar *);
+ va_start(ap, bfi);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
@@ -905,15 +1021,18 @@ gnac_profiles_utils_add_properties_check(gchar *pipeline, BasicFormatInfo *bfi,
return pipeline;
}
+
void
-gnac_profiles_utils_set_active_toggle_button(BasicFormatInfo *bfi, gboolean active, ...)
+gnac_profiles_utils_set_active_toggle_button(BasicFormatInfo *bfi,
+ gboolean active,
+ ...)
{
- GtkWidget *widget;
- va_list ap;
+ GtkWidget *widget;
+ va_list ap;
const gchar *name;
- va_start(ap,active);
- name = va_arg(ap,const gchar *);
+ va_start(ap, active);
+ name = va_arg(ap, const gchar *);
while (name != NULL) {
widget = GTK_WIDGET(gtk_builder_get_object(bfi->builder, name));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), active);
@@ -923,37 +1042,40 @@ gnac_profiles_utils_set_active_toggle_button(BasicFormatInfo *bfi, gboolean acti
va_end(ap);
}
+
void
gnac_profiles_utils_on_toggle_optionnal_property(GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
GtkWidget *widget = GTK_WIDGET(user_data);
if (gtk_toggle_button_get_active(togglebutton)) {
- gtk_widget_set_sensitive(widget,TRUE);
+ gtk_widget_set_sensitive(widget, TRUE);
} else {
- gtk_widget_set_sensitive(widget,FALSE);
+ gtk_widget_set_sensitive(widget, FALSE);
}
}
+
void
gnac_profiles_utils_save_specific_properties_in_file(XMLDoc *doc, ...)
{
va_list ap;
- va_start(ap,doc);
- gnac_profiles_xml_engine_add_values(doc, "/audio-profile/format-specific",
- ap);
-
+ va_start(ap, doc);
+ gnac_profiles_xml_engine_add_values(doc,
+ "/audio-profile/format-specific", ap);
}
+
void
-gnac_profiles_utils_load_saved_profile(XMLDoc *doc, const gchar *base_query,
- ...)
+gnac_profiles_utils_load_saved_profile(XMLDoc *doc,
+ const gchar *base_query,
+ ...)
{
- const gchar *spec_query;
- gchar *query;
- gchar **value;
- va_list ap;
+ const gchar *spec_query;
+ gchar *query;
+ gchar **value;
+ va_list ap;
va_start(ap, base_query);
spec_query = va_arg(ap, const gchar *);
@@ -969,12 +1091,14 @@ gnac_profiles_utils_load_saved_profile(XMLDoc *doc, const gchar *base_query,
va_end(ap);
}
+
AudioProfileGeneric *
-gnac_profiles_utils_allocate_audio_profile_generic()
+gnac_profiles_utils_allocate_audio_profile_generic(void)
{
AudioProfileGeneric *profile;
profile = g_malloc(sizeof(AudioProfileGeneric));
+
profile->generic = profile;
profile->name = NULL;
profile->description = NULL;
@@ -988,6 +1112,7 @@ gnac_profiles_utils_allocate_audio_profile_generic()
return profile;
}
+
void
gnac_profiles_utils_free_audio_profile_generic(AudioProfileGeneric *profile)
{
@@ -1002,6 +1127,7 @@ gnac_profiles_utils_free_audio_profile_generic(AudioProfileGeneric *profile)
g_free(profile);
}
+
void
gnac_profiles_utils_free_basic_format_info_content(BasicFormatInfo *bfi)
{
@@ -1021,8 +1147,8 @@ gnac_profiles_utils_free_basic_format_info_content(BasicFormatInfo *bfi)
void
gnac_profiles_utils_free_combo_values(BasicFormatInfo *bfi, ...)
{
- va_list ap;
- GtkWidget *widget;
+ va_list ap;
+ GtkWidget *widget;
const gchar *name;
ComboValues *values;
@@ -1037,12 +1163,13 @@ gnac_profiles_utils_free_combo_values(BasicFormatInfo *bfi, ...)
va_end(ap);
}
+
void
gnac_profiles_utils_free_slider_values(BasicFormatInfo *bfi, ...)
{
- va_list ap;
- GtkWidget *widget;
- const gchar *name;
+ va_list ap;
+ GtkWidget *widget;
+ const gchar *name;
SliderValues *values;
va_start(ap, bfi);
@@ -1056,11 +1183,12 @@ gnac_profiles_utils_free_slider_values(BasicFormatInfo *bfi, ...)
va_end(ap);
}
+
void
gnac_profiles_utils_free_check_values(BasicFormatInfo *bfi, ...)
{
- va_list ap;
- GtkWidget *widget;
+ va_list ap;
+ GtkWidget *widget;
const gchar *name;
CheckValues *values;
@@ -1079,24 +1207,29 @@ gnac_profiles_utils_free_check_values(BasicFormatInfo *bfi, ...)
gchar *
gnac_profiles_utils_gdouble_to_gchararray(gdouble value)
{
- return gnac_profiles_utils_gdouble_to_gchararray_format(value,"%.0f");
+ return gnac_profiles_utils_gdouble_to_gchararray_format(value, "%.0f");
}
+
gchar *
-gnac_profiles_utils_gdouble_to_gchararray_format(gdouble value, const gchar *format)
+gnac_profiles_utils_gdouble_to_gchararray_format(gdouble value,
+ const gchar *format)
{
gchar buffer[64];
- g_ascii_formatd(buffer,64,format,value);
+ g_ascii_formatd(buffer, 64, format, value);
+
return g_strdup(buffer);
}
+
gdouble
-gnac_profiles_utils_gchararray_to_gdouble(const gchar * value)
+gnac_profiles_utils_gchararray_to_gdouble(const gchar *value)
{
return g_ascii_strtod(value, NULL);
}
+
void
gnac_profiles_utils_display_error_dialog(GtkWidget *dialog)
{
diff --git a/src/profiles/gnac-profiles-utils.h b/src/profiles/gnac-profiles-utils.h
index 1e4ff53..af5743d 100755
--- a/src/profiles/gnac-profiles-utils.h
+++ b/src/profiles/gnac-profiles-utils.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -26,24 +26,26 @@
#ifndef GNAC_PROFILES_UTILS_H
#define GNAC_PROFILES_UTILS_H
-//Suppress useless unused warning on callback parameters
-#define DISCARD_PARAMETER(p) (void)p
-
+#include <glib.h>
#include <gtk/gtk.h>
#include <stdarg.h>
+
#include "gnac-profiles-xml-engine.h"
+G_BEGIN_DECLS
+
typedef struct _audio_profile_generic
{
struct _audio_profile_generic *generic;
- gchar *name;
- gchar *description;
- gchar *format_id;
- gchar *format_name;
- gchar *extension;
- gchar *pipeline;
- gchar *rate;
- gchar *channels;
+
+ gchar *name;
+ gchar *description;
+ gchar *format_id;
+ gchar *format_name;
+ gchar *extension;
+ gchar *pipeline;
+ gchar *rate;
+ gchar *channels;
gpointer *user_data;
}
AudioProfileGeneric;
@@ -51,17 +53,17 @@ AudioProfileGeneric;
typedef struct
{
const gchar *gtkbuilder_xml_file;
- GtkBuilder *builder;
+ GtkBuilder *builder;
const gchar *data_xml_file;
- XMLDoc *doc;
- gchar *pipeline;
- gchar *pipeline_encoder;
- gchar *pipeline_multiplexers;
- gchar *format_id;
- gchar *format_plugin_name;
- gchar *format_name;
- gchar *file_extension;
- gchar *description;
+ XMLDoc *doc;
+ gchar *pipeline;
+ gchar *pipeline_encoder;
+ gchar *pipeline_multiplexers;
+ gchar *format_id;
+ gchar *format_plugin_name;
+ gchar *format_name;
+ gchar *file_extension;
+ gchar *description;
}
BasicFormatInfo;
@@ -69,60 +71,86 @@ typedef void (*UpdateTextBufferFunc) (const gchar*);
typedef void (*StandardCallBack) (GtkWidget *widget, gpointer data);
void
-gnac_profiles_utils_init_name_extension(XMLDoc *doc, const gchar *format,
- gchar **name, gchar **extension);
+gnac_profiles_utils_init_name_extension(XMLDoc *doc,
+ const gchar *format,
+ gchar **name,
+ gchar **extension);
gchar *
-gnac_profiles_utils_get_combo_format_name(gchar *name, gchar *extension);
+gnac_profiles_utils_get_combo_format_name(gchar *name,
+ gchar *extension);
gchar *
-gnac_profiles_utils_init_description(XMLDoc *doc, const gchar *format);
-
+gnac_profiles_utils_init_description(XMLDoc *doc,
+ const gchar *format);
GtkWidget *
gnac_profiles_utils_all_in_one_for_combo(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *combo_name, const gchar *xpath_query);
+ GCallback call_back,
+ const gchar *combo_name,
+ const gchar *xpath_query);
GtkWidget *
gnac_profiles_utils_all_in_one_for_slider(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *slider_name, const gchar *xpath_query);
+ GCallback call_back,
+ const gchar *slider_name,
+ const gchar *xpath_query);
GtkWidget *
gnac_profiles_utils_all_in_one_for_check(BasicFormatInfo *bfi,
- GCallback call_back, const gchar *check_name, const gchar *xpath_query);
+ GCallback call_back,
+ const gchar *check_name,
+ const gchar *xpath_query);
GtkWidget *
-gnac_profiles_utils_add_toggle_signal(BasicFormatInfo *bfi,
- const gchar *check, GCallback f, gpointer user_data);
+gnac_profiles_utils_add_toggle_signal(BasicFormatInfo *bfi,
+ const gchar *check,
+ GCallback f,
+ gpointer user_data);
gint
-gnac_profiles_utils_register_combo(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data);
+gnac_profiles_utils_register_combo(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data);
gint
-gnac_profiles_utils_register_slider(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data);
+gnac_profiles_utils_register_slider(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data);
gint
-gnac_profiles_utils_register_check(GtkWidget *widget, XMLDoc *doc,
- const gchar *xpath_query, GCallback call_back, gpointer user_data);
+gnac_profiles_utils_register_check(GtkWidget *widget,
+ XMLDoc *doc,
+ const gchar *xpath_query,
+ GCallback call_back,
+ gpointer user_data);
GtkWidget *
gnac_profiles_utils_register_advanced_channels(GtkBuilder *builder,
- XMLDoc *doc, GCallback call_back, gpointer user_data);
+ XMLDoc *doc,
+ GCallback call_back,
+ gpointer user_data);
GtkWidget *
gnac_profiles_utils_register_advanced_sample_rate(GtkBuilder *builder,
- XMLDoc *doc, GCallback call_back, gpointer user_data);
+ XMLDoc *doc,
+ GCallback call_back,
+ gpointer user_data);
void
-gnac_profiles_utils_add_values_combo(GtkWidget *combo, ComboValues *values);
+gnac_profiles_utils_add_values_combo(GtkWidget *combo,
+ ComboValues *values);
void
gnac_profiles_utils_reinit_values_combo(BasicFormatInfo *bfi, ...);
void
-gnac_profiles_utils_set_value_combo(GtkWidget *combo, const gchar *value);
+gnac_profiles_utils_set_value_combo(GtkWidget *combo,
+ const gchar *value);
void
gnac_profiles_utils_set_values_combo(BasicFormatInfo *bfi, ...);
@@ -140,7 +168,8 @@ void
gnac_profiles_utils_get_values_checked_combo_and_set(BasicFormatInfo *bfi, ...);
void
-gnac_profiles_utils_add_values_slider(GtkWidget *slider, SliderValues *values);
+gnac_profiles_utils_add_values_slider(GtkWidget *slider,
+ SliderValues *values);
void
gnac_profiles_utils_reinit_values_slider(BasicFormatInfo *bfi, ...);
@@ -168,67 +197,92 @@ gnac_profiles_utils_get_values_check_and_set(BasicFormatInfo *bfi, ...);
void
gnac_profiles_utils_add_description_tooltip(BasicFormatInfo *bfi,
- const gchar *xpath_query, ...);
+ const gchar *xpath_query,
+ ...);
void
gnac_profiles_utils_init_raw_audioconvert(XMLDoc *doc);
gchar *
-gnac_profiles_utils_get_basepipeline(const gchar *channels, const gchar *rate);
+gnac_profiles_utils_get_basepipeline(const gchar *channels,
+ const gchar *rate);
gchar *
-gnac_profiles_utils_add_pipe(gchar *pipeline, gchar *new_pipe);
+gnac_profiles_utils_add_pipe(gchar *pipeline,
+ gchar *new_pipe);
gchar *
-gnac_profiles_utils_add_pipes(gchar *pipeline, GList *values);
+gnac_profiles_utils_add_pipes(gchar *pipeline,
+ GList *values);
gchar *
-gnac_profiles_utils_add_property_combo(gchar *pipeline, GtkWidget *combo);
+gnac_profiles_utils_add_property_combo(gchar *pipeline,
+ GtkWidget *combo);
gchar *
-gnac_profiles_utils_add_properties_combo(gchar *pipeline, BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_add_properties_combo(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...);
gchar *
-gnac_profiles_utils_add_properties_checked_combo(gchar *pipeline, BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_add_properties_checked_combo(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...);
gchar *
-gnac_profiles_utils_add_property_slider(gchar *pipeline, const gchar *format,
- gdouble factor, GtkWidget *slider);
+gnac_profiles_utils_add_property_slider(gchar *pipeline,
+ const gchar *format,
+ gdouble factor,
+ GtkWidget *slider);
gchar *
-gnac_profiles_utils_add_properties_slider(gchar *pipeline, BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_add_properties_slider(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...);
gchar *
-gnac_profiles_utils_add_properties_slider_format(gchar *pipeline,
- BasicFormatInfo *bfi, const gchar *format, ...);
+gnac_profiles_utils_add_properties_slider_format(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ const gchar *format,
+ ...);
gchar *
-gnac_profiles_utils_add_properties_checked_slider(gchar *pipeline, BasicFormatInfo *bfi, ...);
+gnac_profiles_utils_add_properties_checked_slider(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...);
gchar *
-gnac_profiles_utils_add_properties_checked_slider_format(gchar *pipeline,
- BasicFormatInfo *bfi, const gchar *format, ...);
+gnac_profiles_utils_add_properties_checked_slider_format(
+ gchar *pipeline,
+ BasicFormatInfo *bfi,
+ const gchar *format,
+ ...);
gchar *
-gnac_profiles_utils_add_property_check(gchar *pipeline, GtkWidget *check);
+gnac_profiles_utils_add_property_check(gchar *pipeline,
+ GtkWidget *check);
gchar *
-gnac_profiles_utils_add_properties_check(gchar *pipeline, BasicFormatInfo *bfi,
- ...);
+gnac_profiles_utils_add_properties_check(gchar *pipeline,
+ BasicFormatInfo *bfi,
+ ...);
void
-gnac_profiles_utils_set_active_toggle_button(BasicFormatInfo *bfi, gboolean active, ...);
+gnac_profiles_utils_set_active_toggle_button(BasicFormatInfo *bfi,
+ gboolean active,
+ ...);
void
gnac_profiles_utils_on_toggle_optionnal_property(GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
void
gnac_profiles_utils_save_specific_properties_in_file(XMLDoc *doc, ...);
void
-gnac_profiles_utils_load_saved_profile(XMLDoc *doc, const gchar *base_query,
- ...);
+gnac_profiles_utils_load_saved_profile(XMLDoc *doc,
+ const gchar *base_query,
+ ...);
AudioProfileGeneric *
gnac_profiles_utils_allocate_audio_profile_generic(void);
@@ -252,13 +306,15 @@ gchar *
gnac_profiles_utils_gdouble_to_gchararray(gdouble value);
gchar *
-gnac_profiles_utils_gdouble_to_gchararray_format(gdouble value, const gchar *format);
+gnac_profiles_utils_gdouble_to_gchararray_format(gdouble value,
+ const gchar *format);
gdouble
-gnac_profiles_utils_gchararray_to_gdouble(const gchar * value);
+gnac_profiles_utils_gchararray_to_gdouble(const gchar *value);
void
gnac_profiles_utils_display_error_dialog(GtkWidget *dialog);
+G_END_DECLS
#endif /* GNAC_PROFILES_UTILS_H */
diff --git a/src/profiles/gnac-profiles-xml-engine.c b/src/profiles/gnac-profiles-xml-engine.c
index 2a7aea0..4f171e1 100755
--- a/src/profiles/gnac-profiles-xml-engine.c
+++ b/src/profiles/gnac-profiles-xml-engine.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -27,36 +27,37 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#include <libxml/tree.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <libxml/parser.h>
+#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
#include "gnac-profiles-xml-engine.h"
static xmlXPathObjectPtr
-gnac_profiles_xml_engine_evaluate_query(const gchar *query,
- xmlXPathContextPtr xpath_context);
+gnac_profiles_xml_engine_evaluate_query(const gchar *query,
+ xmlXPathContextPtr xpath_context);
static gboolean
gnac_profiles_xml_engine_is_i12n_node(xmlNodePtr node);
+
XMLDoc *
gnac_profiles_xml_engine_load_doc_xpath(const gchar *filename)
{
- xmlDocPtr doc;
- xmlXPathContextPtr xpath;
- XMLDoc *dx = NULL;
+ xmlDocPtr doc;
+ xmlXPathContextPtr xpath;
+ XMLDoc *dx = NULL;
doc = xmlParseFile(filename);
if (doc != NULL) {
xpath = xmlXPathNewContext(doc);
if (xpath != NULL) {
dx = g_malloc(sizeof(XMLDoc));
- dx->doc = (void*) doc;
- dx->xpath_context = (void*) xpath;
+ dx->doc = (gpointer) doc;
+ dx->xpath_context = (gpointer) xpath;
} else {
xmlFreeDoc(doc);
}
@@ -68,16 +69,16 @@ gnac_profiles_xml_engine_load_doc_xpath(const gchar *filename)
gchar *
gnac_profiles_xml_engine_get_format_id(XMLDoc *dx)
{
- xmlXPathObjectPtr xpath_obj;
- const gchar *expr = "//profiles/profile";
+ xmlXPathObjectPtr xpath_obj;
+ const gchar *expr = "//profiles/profile";
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if ((nodes != NULL) && (nodes->nodeNr > 0)) {
- gchar *format_id;
- xmlNodePtr node;
+ gchar *format_id;
+ xmlNodePtr node;
node = nodes->nodeTab[0];
format_id = g_strdup((const gchar *) node->properties->children->content);
@@ -89,14 +90,15 @@ gnac_profiles_xml_engine_get_format_id(XMLDoc *dx)
return NULL;
}
+
gchar *
-gnac_profiles_xml_engine_get_text_node( XMLDoc *dx,
- const gchar *expr)
+gnac_profiles_xml_engine_get_text_node(XMLDoc *dx,
+ const gchar *expr)
{
xmlXPathObjectPtr xpath_obj;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if ((nodes != NULL) && (nodes->nodeNr > 0)) {
@@ -114,39 +116,42 @@ gnac_profiles_xml_engine_get_text_node( XMLDoc *dx,
return NULL;
}
+
static gboolean
gnac_profiles_xml_engine_is_i12n_node(xmlNodePtr node)
{
- return !g_strcmp0((const gchar*) node->properties->name,"lang");
+ return !g_strcmp0((const gchar*) node->properties->name, "lang");
}
+
GList *
-gnac_profiles_xml_engine_get_list_values( XMLDoc *dx,
- const gchar *expr)
+gnac_profiles_xml_engine_get_list_values(XMLDoc *dx,
+ const gchar *expr)
{
xmlXPathObjectPtr xpath_obj;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if (nodes != NULL) {
- gint nb_element;
- gint i;
+ gint nb_element;
+ gint i;
GList *list = NULL;
nb_element = nodes->nodeNr;
- for (i = 0; i<nb_element; ++i) {
+ for (i = 0; i < nb_element; ++i) {
xmlNode *current_node = nodes->nodeTab[i];
Value *v;
if (!gnac_profiles_xml_engine_is_i12n_node(current_node)) {
v = g_malloc(sizeof(Value));
- v->name = g_strdup(gettext((const gchar*) current_node->children->content));
- v->value = g_strdup((const gchar*) current_node->properties->children->content);
- list = g_list_append(list,v);
+ v->name = g_strdup(gettext(
+ (const gchar*) current_node->children->content));
+ v->value = g_strdup(
+ (const gchar*) current_node->properties->children->content);
+ list = g_list_append(list, v);
}
-
}
xmlXPathFreeObject(xpath_obj);
return list;
@@ -156,59 +161,68 @@ gnac_profiles_xml_engine_get_list_values( XMLDoc *dx,
return NULL;
}
+
static xmlXPathObjectPtr
-gnac_profiles_xml_engine_evaluate_query(const gchar *query,
- xmlXPathContextPtr xpath_context)
+gnac_profiles_xml_engine_evaluate_query(const gchar *query,
+ xmlXPathContextPtr xpath_context)
{
- const xmlChar* expr_cast;
+ const xmlChar *expr_cast;
expr_cast = BAD_CAST query;
+
return xmlXPathEvalExpression(expr_cast, xpath_context);
}
+
gint
-gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
+gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
const gchar *expr,
ComboValues *combo_values)
{
xmlXPathObjectPtr xpath_obj;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if (nodes != NULL)
{
- gint nb_element;
- gint i;
- gboolean is_combo = FALSE;
- xmlNode *values_first = NULL;
- xmlNode *values_last = NULL;
- gchar *default_value = NULL;
- gchar *variable_name = NULL;
+ gint nb_element;
+ gint i;
+ gboolean is_combo = FALSE;
+ xmlNode *values_first = NULL;
+ xmlNode *values_last = NULL;
+ gchar *default_value = NULL;
+ gchar *variable_name = NULL;
nb_element = nodes->nodeNr;
- for (i = 0; i<nb_element; ++i)
+ for (i = 0; i < nb_element; ++i)
{
xmlNode *current_node = nodes->nodeTab[i];
- if (!g_strcmp0("variable-name",(const gchar*) current_node->name)) {
+ if (!g_strcmp0("variable-name", (const gchar*) current_node->name)) {
variable_name = g_strdup((gchar*) current_node->children->content);
- } else if (!g_strcmp0("control-type",(const gchar*) current_node->name)) {
- is_combo =
- (!(g_strcmp0("combo",(const gchar*) current_node->children->content)));
- } else if (!g_strcmp0("default-value",(const gchar*) current_node->name)) {
+ } else if (!g_strcmp0("control-type", (const gchar*)current_node->name))
+ {
+ is_combo = !(g_strcmp0("combo",
+ (const gchar*) current_node->children->content));
+ } else if (!g_strcmp0("default-value",
+ (const gchar*)current_node->name))
+ {
default_value = g_strdup((gchar*) current_node->children->content);
- } else if (!g_strcmp0("possible-values",(const gchar*) current_node->name)) {
+ } else if (!g_strcmp0("possible-values",
+ (const gchar*) current_node->name))
+ {
values_first = current_node->children->next;
values_last = current_node->last;
}
}
if (is_combo && values_first && values_last
- && default_value && variable_name) {
- gboolean stop = FALSE;
- xmlNode *current_node = values_first;
- GList *values = NULL;
- GList *names = NULL;
+ && default_value && variable_name)
+ {
+ gboolean stop = FALSE;
+ xmlNode *current_node = values_first;
+ GList *values = NULL;
+ GList *names = NULL;
do {
@@ -216,14 +230,14 @@ gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
values = g_list_append(values,
g_strdup((gchar*)current_node->properties->children->content));
- names = g_list_append(names,
- g_strdup(gettext((const gchar*) current_node->children->content)));
+ names = g_list_append(names, g_strdup(gettext(
+ (const gchar*) current_node->children->content)));
}
current_node = current_node->next;
if (current_node == values_last) {
stop = TRUE;
- } else if (!g_strcmp0("text", (const gchar *) current_node->name)){
+ } else if (!g_strcmp0("text", (const gchar *) current_node->name)) {
current_node = current_node->next;
}
} while (!stop);
@@ -242,47 +256,54 @@ gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
return -1;
}
+
gint
-gnac_profiles_xml_engine_get_slider_values(XMLDoc *dx,
- const gchar *expr,
+gnac_profiles_xml_engine_get_slider_values(XMLDoc *dx,
+ const gchar *expr,
SliderValues *slider_values)
{
xmlXPathObjectPtr xpath_obj;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if (nodes != NULL) {
- gint nb_element;
- gint i;
- gboolean is_slider = FALSE;
- gdouble min = 0.0;
- gdouble max = 0.0;
- gdouble step = 0.0;
- gdouble default_value = 0.0;
- gchar *variable_name = NULL;
+ gint nb_element;
+ gint i;
+ gboolean is_slider = FALSE;
+ gdouble min = 0.0;
+ gdouble max = 0.0;
+ gdouble step = 0.0;
+ gdouble default_value = 0.0;
+ gchar *variable_name = NULL;
nb_element = nodes->nodeNr;
- for (i = 0; i<nb_element; ++i) {
+ for (i = 0; i < nb_element; ++i) {
xmlNode *current_node = nodes->nodeTab[i];
- if (!g_strcmp0("variable-name",(const gchar*) current_node->name)) {
+ if (!g_strcmp0("variable-name", (const gchar*) current_node->name)) {
variable_name = g_strdup((gchar*) current_node->children->content);
- } else if (!g_strcmp0("control-type",(const gchar*) current_node->name)){
- is_slider =
- (!(g_strcmp0("slider",(const gchar*) current_node->children->content)));
- } else if (!g_strcmp0("default-value",(const gchar*) current_node->name)) {
+ } else if (!g_strcmp0("control-type", (const gchar*)current_node->name))
+ {
+ is_slider = !(g_strcmp0("slider",
+ (const gchar*) current_node->children->content));
+ } else if (!g_strcmp0("default-value",
+ (const gchar*) current_node->name))
+ {
default_value = g_ascii_strtod(
- (const gchar*) current_node->children->content, NULL);
- } else if (!g_strcmp0("min-value",(const gchar*) current_node->name)) {
+ (const gchar*) current_node->children->content, NULL);
+ } else if (!g_strcmp0("min-value", (const gchar*) current_node->name))
+ {
min = g_ascii_strtod(
- (const gchar*) current_node->children->content, NULL);
- } else if (!g_strcmp0("max-value",(const gchar*) current_node->name)) {
+ (const gchar*) current_node->children->content, NULL);
+ } else if (!g_strcmp0("max-value", (const gchar*) current_node->name))
+ {
max = g_ascii_strtod(
- (const gchar*) current_node->children->content, NULL);
- } else if (!g_strcmp0("step-value",(const gchar*) current_node->name)) {
+ (const gchar*) current_node->children->content, NULL);
+ } else if (!g_strcmp0("step-value", (const gchar*) current_node->name))
+ {
step = g_ascii_strtod(
- (const gchar*) current_node->children->content, NULL);
+ (const gchar*) current_node->children->content, NULL);
}
}
if (is_slider && variable_name)
@@ -303,34 +324,37 @@ gnac_profiles_xml_engine_get_slider_values(XMLDoc *dx,
gint
-gnac_profiles_xml_engine_get_check_values(XMLDoc *dx,
+gnac_profiles_xml_engine_get_check_values(XMLDoc *dx,
const gchar *expr,
CheckValues *check_values)
{
xmlXPathObjectPtr xpath_obj;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
- if ((xpath_obj != NULL) && (!xpath_obj->boolval)) {
+ if ((xpath_obj != NULL) && !xpath_obj->boolval) {
xmlNodeSetPtr nodes = xpath_obj->nodesetval;
if (nodes != NULL) {
- gint nb_element;
- gint i;
- gchar *variable_name = NULL;
- gboolean is_check = FALSE;
- gboolean default_value = FALSE;
+ gint nb_element;
+ gint i;
+ gchar *variable_name = NULL;
+ gboolean is_check = FALSE;
+ gboolean default_value = FALSE;
nb_element = nodes->nodeNr;
- for (i = 0; i<nb_element; ++i) {
+ for (i = 0; i < nb_element; ++i) {
xmlNode *current_node = nodes->nodeTab[i];
- if (!g_strcmp0("variable-name",(const gchar*) current_node->name)) {
+ if (!g_strcmp0("variable-name", (const gchar*) current_node->name)) {
variable_name = g_strdup((gchar*) current_node->children->content);
- } else if (!g_strcmp0("control-type",(const gchar*) current_node->name)){
- is_check =
- (!(g_strcmp0("check",(const gchar*) current_node->children->content)));
- } else if (!g_strcmp0("default-value",(const gchar*) current_node->name)) {
- default_value =
- (!g_strcmp0((const gchar*) current_node->children->content,"true"));
+ } else if (!g_strcmp0("control-type", (const gchar*)current_node->name))
+ {
+ is_check = !(g_strcmp0("check",
+ (const gchar*) current_node->children->content));
+ } else if (!g_strcmp0("default-value",
+ (const gchar*) current_node->name))
+ {
+ default_value = !g_strcmp0(
+ (const gchar*) current_node->children->content,"true");
}
}
if (is_check && variable_name)
@@ -346,23 +370,26 @@ gnac_profiles_xml_engine_get_check_values(XMLDoc *dx,
return -1;
}
+
void
-gnac_profiles_xml_engine_modify_values(XMLDoc *dx, const gchar *expr, ...)
+gnac_profiles_xml_engine_modify_values(XMLDoc *dx,
+ const gchar *expr,
+ ...)
{
- va_list ap;
- const gchar *value;
- xmlNodeSetPtr nodes;
- xmlXPathObjectPtr xpath_obj;
- gint nbElement;
- gint i;
+ va_list ap;
+ const gchar *value;
+ xmlNodeSetPtr nodes;
+ xmlXPathObjectPtr xpath_obj;
+ gint nbElement;
+ gint i;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
nodes = xpath_obj->nodesetval;
nbElement = nodes->nodeNr;
- va_start(ap,expr);
- value = va_arg(ap,const gchar *);
+ va_start(ap, expr);
+ value = va_arg(ap, const gchar *);
for (i = nbElement-1; i >= 0; --i) {
gchar *value_formated = gnac_profiles_xml_engine_format_text_to_xml(value);
xmlNodeSetContent(nodes->nodeTab[i], BAD_CAST value_formated);
@@ -376,24 +403,28 @@ gnac_profiles_xml_engine_modify_values(XMLDoc *dx, const gchar *expr, ...)
if (xpath_obj != NULL) xmlXPathFreeObject(xpath_obj);
}
+
void
-gnac_profiles_xml_engine_add_values(XMLDoc *dx, const gchar *expr, va_list ap)
+gnac_profiles_xml_engine_add_values(XMLDoc *dx,
+ const gchar *expr,
+ va_list ap)
{
- xmlNodeSetPtr nodes;
- xmlNodePtr format_node;
- xmlNodePtr node;
- xmlXPathObjectPtr xpath_obj;
- const xmlChar *name;
- const gchar *value;
- const xmlChar *base_indent;
- xmlChar *properties_indent;
+ xmlNodeSetPtr nodes;
+ xmlNodePtr format_node;
+ xmlNodePtr node;
+ xmlXPathObjectPtr xpath_obj;
+ const xmlChar *name;
+ const gchar *value;
+ const xmlChar *base_indent;
+ xmlChar *properties_indent;
xpath_obj = gnac_profiles_xml_engine_evaluate_query(expr, dx->xpath_context);
nodes = xpath_obj->nodesetval;
format_node = nodes->nodeTab[0];
base_indent = format_node->prev->content;
- properties_indent = (xmlChar*) g_strconcat((const gchar*) base_indent," ",NULL);
+ properties_indent = (xmlChar*) g_strconcat((const gchar*) base_indent,
+ " ", NULL);
xmlAddChild(format_node, xmlNewText(BAD_CAST " "));
name = va_arg(ap, const xmlChar *);
@@ -401,12 +432,12 @@ gnac_profiles_xml_engine_add_values(XMLDoc *dx, const gchar *expr, va_list ap)
value = va_arg(ap, const gchar *);
- node = xmlNewNode(format_node->ns,name);
+ node = xmlNewNode(format_node->ns, name);
node = xmlAddChild(format_node, node);
if (g_strcmp0("", value)) {
- gchar *value_formated = gnac_profiles_xml_engine_format_text_to_xml(value);
- xmlNodeSetContent(node, BAD_CAST value_formated);
- g_free(value_formated);
+ gchar *formatted = gnac_profiles_xml_engine_format_text_to_xml(value);
+ xmlNodeSetContent(node, BAD_CAST formatted);
+ g_free(formatted);
}
name = va_arg(ap, const xmlChar *);
@@ -421,34 +452,39 @@ gnac_profiles_xml_engine_add_values(XMLDoc *dx, const gchar *expr, va_list ap)
if (xpath_obj != NULL) xmlXPathFreeObject(xpath_obj);
}
+
gchar *
gnac_profiles_xml_engine_format_text_to_xml(const gchar *text) {
if (text != NULL) {
- gchar *text_return = NULL;
- glong text_size;
+ gchar *text_return = NULL;
+ glong text_size;
const gchar *replacement;
- gchar *temp;
- int last_replacement = 0;
- int i;
+ gchar *temp;
+ gint last_replacement = 0;
+ gint i;
text_size = g_utf8_strlen(text, -1);
- for (i = 0; i<text_size; ++i) {
- switch (text[i]) {
+ for (i = 0; i < text_size; ++i) {
+ switch (text[i])
+ {
case '&':
replacement = "&";
break;
+
case '<':
replacement = "<";
break;
+
case '>':
replacement = ">";
break;
+
default:
replacement = NULL;
break;
}
if (replacement != NULL) {
- temp = g_strndup(&(text[last_replacement]),i-last_replacement);
+ temp = g_strndup(&(text[last_replacement]), i-last_replacement);
if (text_return != NULL) {
gchar *temp2;
@@ -472,8 +508,10 @@ gnac_profiles_xml_engine_format_text_to_xml(const gchar *text) {
}
}
+
void
-gnac_profiles_xml_engine_save_doc(XMLDoc *dx, const gchar *filename)
+gnac_profiles_xml_engine_save_doc(XMLDoc *dx,
+ const gchar *filename)
{
gchar *xml_filename;
@@ -483,6 +521,7 @@ gnac_profiles_xml_engine_save_doc(XMLDoc *dx, const gchar *filename)
g_free(xml_filename);
}
+
void
gnac_profiles_xml_engine_free_doc_xpath(XMLDoc *dx)
{
@@ -491,6 +530,7 @@ gnac_profiles_xml_engine_free_doc_xpath(XMLDoc *dx)
g_free(dx);
}
+
void
gnac_profiles_xml_engine_free_combo_values(ComboValues *values)
{
@@ -503,6 +543,7 @@ gnac_profiles_xml_engine_free_combo_values(ComboValues *values)
g_free(values);
}
+
void
gnac_profiles_xml_engine_free_slider_values(SliderValues *values)
{
@@ -510,6 +551,7 @@ gnac_profiles_xml_engine_free_slider_values(SliderValues *values)
g_free(values);
}
+
void
gnac_profiles_xml_engine_free_check_values(CheckValues *values)
{
diff --git a/src/profiles/gnac-profiles-xml-engine.h b/src/profiles/gnac-profiles-xml-engine.h
index ad522a2..c772260 100755
--- a/src/profiles/gnac-profiles-xml-engine.h
+++ b/src/profiles/gnac-profiles-xml-engine.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,16 +28,19 @@
#include <glib.h>
-#define GNAC_SAVED_PROFILES_URL(name) saved_profiles_dir , G_DIR_SEPARATOR_S, name
-#define GNAC_SAVED_PROFILES_URL_WITH_EXT(name) GNAC_SAVED_PROFILES_URL(name) ,\
- ".xml"
+#define GNAC_SAVED_PROFILES_URL(name) \
+ saved_profiles_dir , G_DIR_SEPARATOR_S, name
+#define GNAC_SAVED_PROFILES_URL_WITH_EXT(name) \
+ GNAC_SAVED_PROFILES_URL(name) , ".xml"
+
+G_BEGIN_DECLS
gchar *saved_profiles_dir;
typedef struct
{
- void* doc;
- void* xpath_context;
+ gpointer doc;
+ gpointer xpath_context;
}
XMLDoc;
@@ -59,55 +62,61 @@ ComboValues;
typedef struct
{
- gdouble min;
- gdouble max;
- gdouble step;
- gdouble default_value;
- gchar *variable_name;
+ gdouble min;
+ gdouble max;
+ gdouble step;
+ gdouble default_value;
+ gchar *variable_name;
}
SliderValues;
typedef struct
{
- gboolean default_value;
- gchar *variable_name;
-} CheckValues;
+ gboolean default_value;
+ gchar *variable_name;
+}
+CheckValues;
XMLDoc *
gnac_profiles_xml_engine_load_doc_xpath(const gchar *filename);
gchar *
-gnac_profiles_xml_engine_get_format_id( XMLDoc *dx);
+gnac_profiles_xml_engine_get_format_id(XMLDoc *dx);
gchar *
-gnac_profiles_xml_engine_get_text_node( XMLDoc *dx,
- const gchar *expr);
+gnac_profiles_xml_engine_get_text_node(XMLDoc *dx,
+ const gchar *expr);
GList *
-gnac_profiles_xml_engine_get_list_values( XMLDoc *dx,
- const gchar *expr);
+gnac_profiles_xml_engine_get_list_values(XMLDoc *dx,
+ const gchar *expr);
gint
-gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
+gnac_profiles_xml_engine_get_combo_values(XMLDoc *dx,
const gchar *expr,
ComboValues *combo_values);
gint
-gnac_profiles_xml_engine_get_slider_values(XMLDoc *dx,
- const gchar *expr,
+gnac_profiles_xml_engine_get_slider_values(XMLDoc *dx,
+ const gchar *expr,
SliderValues *slider_values);
gint
-gnac_profiles_xml_engine_get_check_values(XMLDoc *dx,
+gnac_profiles_xml_engine_get_check_values(XMLDoc *dx,
const gchar *expr,
CheckValues *check_values);
void
-gnac_profiles_xml_engine_modify_values(XMLDoc *dx, const gchar *expr, ...);
+gnac_profiles_xml_engine_modify_values(XMLDoc *dx,
+ const gchar *expr,
+ ...);
void
-gnac_profiles_xml_engine_add_values(XMLDoc *dx, const gchar *expr, va_list ap);
+gnac_profiles_xml_engine_add_values(XMLDoc *dx,
+ const gchar *expr,
+ va_list ap);
void
-gnac_profiles_xml_engine_save_doc(XMLDoc *dx, const gchar *filename);
+gnac_profiles_xml_engine_save_doc(XMLDoc *dx,
+ const gchar *filename);
void
gnac_profiles_xml_engine_free_doc_xpath(XMLDoc *dx);
@@ -124,4 +133,6 @@ gnac_profiles_xml_engine_free_check_values(CheckValues *values);
gchar *
gnac_profiles_xml_engine_format_text_to_xml(const gchar *text);
+G_END_DECLS
+
#endif /* GNAC_PROFILES_XML_ENGINE_H */
diff --git a/src/profiles/gnac-profiles.c b/src/profiles/gnac-profiles.c
index 2ba2b35..dda8159 100755
--- a/src/profiles/gnac-profiles.c
+++ b/src/profiles/gnac-profiles.c
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -34,38 +34,42 @@ static AudioProfileGeneric *
gnac_profiles_get_active_profile(void);
static void
-gnac_profiles_on_profiles_managed_closed(GtkWidget *widget, gpointer data);
+gnac_profiles_on_profiles_managed_closed(GtkWidget *widget,
+ gpointer data);
static void
-gnac_profiles_on_combo_profile_changed(GtkWidget *widget, gpointer data);
+gnac_profiles_on_combo_profile_changed(GtkWidget *widget,
+ gpointer data);
static gchar *
gnac_profiles_get_display_name(void);
static GtkWidget *combo_profile = NULL;
+
void
gnac_profiles_init(void)
{
GtkCellRenderer *renderer;
- GtkListStore *model;
+ GtkListStore *model;
model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER);
combo_profile = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model));
renderer = gtk_cell_renderer_text_new();
- gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_profile),
- renderer, FALSE);
- gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_profile),
- renderer, "text", 0, NULL);
- gtk_combo_box_set_model(GTK_COMBO_BOX(combo_profile),GTK_TREE_MODEL(model));
+ gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_profile), renderer, FALSE);
+ gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_profile),
+ renderer, "text", 0, NULL);
+ gtk_combo_box_set_model(GTK_COMBO_BOX(combo_profile), GTK_TREE_MODEL(model));
+
g_signal_connect(G_OBJECT(combo_profile), "changed",
- G_CALLBACK(gnac_profiles_on_combo_profile_changed), NULL);
+ G_CALLBACK(gnac_profiles_on_combo_profile_changed), NULL);
- gnac_profiles_mgr_init((StandardCallBack)
- gnac_profiles_on_profiles_managed_closed);
+ gnac_profiles_mgr_init(
+ (StandardCallBack) gnac_profiles_on_profiles_managed_closed);
gnac_profiles_populate_combo();
}
+
void
gnac_profiles_destroy(void)
{
@@ -74,6 +78,7 @@ gnac_profiles_destroy(void)
}
}
+
GtkWidget *
gnac_profiles_get_widget(GtkWidget *parent)
{
@@ -88,36 +93,39 @@ gnac_profiles_get_widget(GtkWidget *parent)
static gchar *
-gnac_profiles_get_display_name(void) {
+gnac_profiles_get_display_name(void)
+{
GtkTreeModel *model;
- GtkTreeIter iter;
- gchar *name;
+ GtkTreeIter iter;
+ gchar *name;
model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo_profile));
if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo_profile), &iter)) {
- gtk_tree_model_get(model,&iter,0,(void**)&name,-1);
+ gtk_tree_model_get(model, &iter, 0, (gpointer*)&name, -1);
return name;
}
return NULL;
}
+
static AudioProfileGeneric *
gnac_profiles_get_active_profile(void)
{
GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
AudioProfileGeneric *profile;
model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo_profile));
if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combo_profile), &iter)) {
- gtk_tree_model_get(model,&iter,1,(void**)&profile,-1);
+ gtk_tree_model_get(model, &iter, 1, (gpointer*)&profile, -1);
return profile->generic;
}
return NULL;
}
+
const gchar *
gnac_profiles_get_pipeline(void)
{
@@ -131,6 +139,7 @@ gnac_profiles_get_pipeline(void)
return NULL;
}
+
const gchar *
gnac_profiles_get_extension(void)
{
@@ -144,6 +153,7 @@ gnac_profiles_get_extension(void)
return NULL;
}
+
const gchar *
gnac_profiles_get_name(void)
{
@@ -157,23 +167,24 @@ gnac_profiles_get_name(void)
return NULL;
}
+
void
-gnac_profiles_set_current_profile(const gchar *name) {
+gnac_profiles_set_current_profile(const gchar *name)
+{
GtkTreeModel *model;
- GtkTreeIter iter;
+ GtkTreeIter iter;
AudioProfileGeneric *profile;
model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo_profile));
if (gtk_tree_model_get_iter_first(model, &iter)) {
do {
- gtk_tree_model_get(model,&iter,1,(void**)&profile,-1);
+ gtk_tree_model_get(model, &iter, 1, (gpointer*)&profile, -1);
if (!g_strcmp0(profile->name, name)) {
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile),&iter);
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile), &iter);
break;
}
} while (gtk_tree_model_iter_next(model, &iter));
}
-
}
@@ -181,11 +192,11 @@ static void
gnac_profiles_populate_combo(void)
{
GtkListStore *model;
- GtkTreeIter iter;
- GList *list;
- GList *temp;
- gchar *active_text;
- gboolean set_active;
+ GtkTreeIter iter;
+ GList *list;
+ GList *temp;
+ gchar *active_text;
+ gboolean set_active;
model = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(combo_profile)));
@@ -202,25 +213,27 @@ gnac_profiles_populate_combo(void)
profile = ((AudioProfileGeneric*)temp->data)->generic;
formated_name = gnac_profiles_properties_filter_text_for_displaying(
- profile->name, MAX_NAME_DISPLAY_SIZE);
- str = g_strconcat(formated_name," (.", profile->extension, ")", NULL);
+ profile->name, MAX_NAME_DISPLAY_SIZE);
+ str = g_strconcat(formated_name, " (.", profile->extension, ")", NULL);
gtk_list_store_append(model, &iter);
gtk_list_store_set(model, &iter, 0, str, 1, profile, -1);
if (active_text != NULL) {
- if (!g_strcmp0(str,active_text)) {
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile),&iter);
+ if (!g_strcmp0(str, active_text)) {
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile), &iter);
g_free(active_text);
active_text = NULL;
set_active = TRUE;
}
}
+
+ /* Cleanup */
g_free(str);
g_free(formated_name);
}
if (!set_active) {
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
- gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile),&iter);
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_profile), &iter);
}
}
@@ -228,44 +241,51 @@ gnac_profiles_populate_combo(void)
} else {
gtk_widget_set_sensitive(combo_profile, FALSE);
}
+
+ /* Cleanup */
if (active_text != NULL) g_free(active_text);
}
+
void
gnac_profiles_on_edit(void)
{
gnac_profiles_mgr_show();
}
+
static void
-gnac_profiles_on_combo_profile_changed(GtkWidget *widget, gpointer data)
+gnac_profiles_on_combo_profile_changed(GtkWidget *widget,
+ gpointer data)
{
AudioProfileGeneric *profile;
- gchar *description;
- gchar *description_formated;
+ gchar *desc;
+ gchar *formatted;
profile = gnac_profiles_get_active_profile();
if (profile != NULL) {
- if ((profile->description != NULL) && (g_strcmp0(profile->description,""))){
- description_formated = gnac_profiles_properties_filter_text_for_displaying(
- profile->description, MAX_DESCR_DISPLAY_SIZE);
- description = gnac_profiles_xml_engine_format_text_to_xml(description_formated);
- g_free(description_formated);
- description_formated = description;
- description = g_strconcat("<i>",description_formated,"</i>",
- NULL);
- g_free(description_formated);
+ if ((profile->description != NULL) && g_strcmp0(profile->description, ""))
+ {
+ formatted = gnac_profiles_properties_filter_text_for_displaying(
+ profile->description, MAX_DESCR_DISPLAY_SIZE);
+ desc = gnac_profiles_xml_engine_format_text_to_xml(formatted);
+ g_free(formatted);
+ formatted = desc;
+ desc = g_strconcat("<i>", formatted, "</i>", NULL);
+ g_free(formatted);
} else {
- description = g_strdup("No description");
+ desc = g_strdup("No description");
}
- gtk_widget_set_tooltip_markup(widget,description);
- g_free(description);
+ gtk_widget_set_tooltip_markup(widget, desc);
+ g_free(desc);
}
}
+
static void
-gnac_profiles_on_profiles_managed_closed(GtkWidget *widget, gpointer data)
+gnac_profiles_on_profiles_managed_closed(GtkWidget *widget,
+ gpointer data)
{
gnac_profiles_populate_combo();
}
diff --git a/src/profiles/gnac-profiles.h b/src/profiles/gnac-profiles.h
index 6367390..2a8085c 100755
--- a/src/profiles/gnac-profiles.h
+++ b/src/profiles/gnac-profiles.h
@@ -1,7 +1,7 @@
/*
* This file is part of GNAC - Gnome Audio Converter
*
- * Copyright (C) 2007 - 2009 Gnac
+ * Copyright (C) 2007 - 2010 Gnac
*
* - DUPASQUIER Benoit <bdupasqu src gnome org>
* - JOAQUIM David <djoaquim src gnome org>
@@ -28,6 +28,8 @@
#include <gtk/gtk.h>
+G_BEGIN_DECLS
+
void
gnac_profiles_init(void);
@@ -52,4 +54,6 @@ gnac_profiles_set_current_profile(const gchar *name);
void
gnac_profiles_on_edit(void);
+G_END_DECLS
+
#endif /* GNAC_PROFILES_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]