mp3splt-gtk
mp3splt-gtk.c File Reference
#include <signal.h>
#include <locale.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <glib/gi18n.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <libmp3splt/mp3splt.h>
#include "util.h"
#include "special_split.h"
#include "player.h"
#include "utilities.h"
#include "tree_tab.h"
#include "main_win.h"
#include "snackamp_control.h"
#include "split_files.h"
#include "preferences_tab.h"
#include "multiple_files.h"
#include "preferences_manager.h"
#include "player_tab.h"
#include "import.h"
#include "mp3splt-gtk.h"
#include "ui_manager.h"
Include dependency graph for mp3splt-gtk.c:

Go to the source code of this file.

Functions

void change_window_progress_bar (splt_progress *p_bar)
 
GThread * create_thread (GThreadFunc func, gpointer data, gboolean joinable, GError **error)
 
void enter_threads ()
 
void exit_threads ()
 
gint main (gint argc, gchar *argv[], gchar **envp)
 
void put_message_from_library (const char *message, splt_message_type mess_type)
 
void put_split_filename (const char *filename, int progress_data)
 
void sigint_handler (gint sig)
 
void sigpipe_handler (gint sig)
 
gpointer split_it (gpointer data)
 

Variables

GtkWidget * adjust_mode
 
GtkWidget * cancel_button
 
GtkWidget * create_dirs_from_output_files
 
gchar * filename_path_of_split
 
gchar * filename_to_split
 
GtkWidget * frame_mode
 
GtkWidget * multiple_files_tree
 
gint multiple_files_tree_number
 
GtkWidget * output_entry
 
GtkWidget * percent_progress_bar
 
GtkWidget * progress_bar
 
GtkWidget * queue_files_button
 
GtkWidget * remove_all_files_button
 
gint selected_player
 
gboolean sigint_called = FALSE
 
GtkWidget * silence_remove_silence
 
GtkWidget * spinner_adjust_gap
 
GtkWidget * spinner_adjust_offset
 
GtkWidget * spinner_adjust_threshold
 
GtkWidget * spinner_silence_minimum
 
GtkWidget * spinner_silence_number_tracks
 
GtkWidget * spinner_silence_offset
 
GtkWidget * spinner_silence_threshold
 
GtkWidget * spinner_time
 
gint split_file_mode
 
gint split_files = 0
 
gint splitnumber
 
GArray * splitpoints
 
splt_statethe_state = NULL
 
ui_stateui = NULL
 
gint we_are_splitting
 
gint we_quit_main_program
 

Detailed Description


The main file,

this file contains the main() function as well as some globally used functions.

Definition in file mp3splt-gtk.c.

Function Documentation

void change_window_progress_bar ( splt_progress p_bar)
gint main ( gint  argc,
gchar *  argv[],
gchar **  envp 
)

The traditional C main function.

Todo:
  • Handle the case that more than one input file is specified at the command line. Until now we just open the first one of the specified files which on windows is basically what notepad does.
    And decide what to do in this case:
    • Going into the multiple files mode will mean that our functionality is enabled if several files are opened at once in Windows
    • And opening a separate instance of our program would mean that windows and nautilus behaviour are consistent (nautilus seems to open every file separately) but - does this really make sense?
  • Handle the case that the specified inputfile is a playlist file
  • Set the full path to the file to make sure that the player will find it even if we are called in a different directory than the file is in and stuff.
  • Gstreamer needs a fully qualified path to the audio file in order to be able to play it back. Don't know why. But what I know is that on solaris realpath() may return a relative filename. And there might be an old system around that does not malloc() memory for a pathname if the pathname we give to it is 0 => find a solution that works everywhere.

Definition at line 511 of file mp3splt-gtk.c.

References change_window_progress_bar(), check_if_dir(), check_if_file(), check_pref_file(), handle_import(), inputfilename, mp3splt_new_state(), mp3splt_set_message_function(), mp3splt_set_progress_function(), mp3splt_set_split_filename_function(), outputdirectory_set(), print_status_bar_confirmation(), put_message_from_library(), put_split_filename(), sigint_handler(), sigpipe_handler(), splitpoints, SPLT_FALSE, SPLT_OPT_DEBUG_MODE, SPLT_OPT_SET_FILE_FROM_CUE_IF_FILE_TAG_FOUND, and SPLT_TRUE.

Here is the call graph for this function:

void put_message_from_library ( const char *  message,
splt_message_type  mess_type 
)

prints a message from the library

Definition at line 434 of file mp3splt-gtk.c.

References put_status_message_with_type().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void put_split_filename ( const char *  filename,
int  progress_data 
)

Add another file to the split_file tab.

Definition at line 147 of file mp3splt-gtk.c.

References add_split_row(), put_status_message(), queue_files_button, and remove_all_files_button.

Referenced by detect_silence_and_set_splitpoints(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void sigint_handler ( gint  sig)

handler for the SIGINT signal

Definition at line 423 of file mp3splt-gtk.c.

Referenced by main().

Here is the caller graph for this function:

void sigpipe_handler ( gint  sig)

handler for the SIGPIPE signal

This signal is issued by snackamp on close.

Definition at line 413 of file mp3splt-gtk.c.

References disconnect_snackamp(), and player_is_running().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

gpointer split_it ( gpointer  data)

Variable Documentation

GtkWidget* adjust_mode
GtkWidget* frame_mode

frame mode option

Definition at line 98 of file preferences_tab.c.

Referenced by adjust_event(), load_preferences(), and put_options_from_preferences().

GtkWidget* output_entry

output for the cddb,cue and freedb file output

Definition at line 73 of file preferences_tab.c.

GtkWidget* queue_files_button
GtkWidget* remove_all_files_button
GtkWidget* spinner_adjust_gap
GArray* splitpoints

The array all splitpoints are kept in.

The splitpoints themself will be in the

Definition at line 69 of file tree_tab.c.

ui_state* ui = NULL

move all options inside

Definition at line 144 of file mp3splt-gtk.c.