Mostly code cleanups (no more deprecated calls), GUI fixes, Confirm
authorterminatorX <>
Wed, 13 Aug 2003 19:48:50 +0000 (19:48 +0000)
committerterminatorX <>
Wed, 13 Aug 2003 19:48:50 +0000 (19:48 +0000)
"Quit" option and doc updates - Alex

30 files changed:
ChangeLog
doc/terminatorX-manual/C/terminatorX-manual.xml
src/Makefile.am
src/main.cc
src/tX_audiodevice.cc
src/tX_audiodevice.h
src/tX_dial.c
src/tX_dial.h
src/tX_dialog.cc
src/tX_dialog.h
src/tX_engine.cc
src/tX_extdial.cc
src/tX_flash.c
src/tX_flash.h
src/tX_glade_interface.cc
src/tX_global.c
src/tX_global.h
src/tX_knobloader.c
src/tX_knobloader.h
src/tX_ladspa_class.cc
src/tX_loaddlg.cc
src/tX_mastergui.cc
src/tX_midiin.cc
src/tX_panel.cc
src/tX_pbutton.cc
src/tX_seqpar.cc
src/tX_vttgui.cc
src/tX_widget.c
src/tX_widget.h
terminatorX.glade

index d703281c7192228f60dd5cdabfcccc0de9aba011..084986faf8ca69a34677583cd7a3f8b636fa6ef1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ This is not a GNU-style ChangeLog but you sort of get the idea what was
 changed.
 
 [v3.81]
+- obligatory documentation updates - clicking on the sub-sections should now 
+  work.
+- removed gtk+ 1.2 cruft - terminatorX now compiles and gtk+ 2.2 and
+  *_DISABLE_DEPRECATED macros enabled.
 - terminatorX now has a JACK backend. Currently it works like this: on startup
   tX will connect to the JACK daemon - if the daemon is not available on 
   startup JACK output is not available. When the audio engine is turned off,
index 17b9f3b7d8ffd6b0c82df8c9b40057ccd9bbeb1b..f3c92fc96566242ff5dba32d0d826b43b2281edb 100644 (file)
       url="http://www.ladspa.org">LADSPA</ulink> plugin effects), a sequencer
       and MIDI interface - all accessible through an easy-to-use gtk+ GUI.</para>
 
-      <para>This is <emphasis>beta</emphasis> Software please help me fix
-      <ulink url="http://terminatorX.cx/bugs.html">bugs</ulink>. See <xref
-      linkend="CONTACT" /> (Contact/Download). Please read this manual and
-      take a look at the <ulink url="http://www.terminatorX.cx">homepage</ulink>.</para>
+      <para>This is software may have <ulink
+      url="http://terminatorX.cx/bugs.html">bugs</ulink> please help fixing
+      them. See <xref linkend="CONTACT" />. Please read this manual and visit
+      the <ulink url="http://www.terminatorX.cx">homepage</ulink>.</para>
     </sect2>
 
     <sect2 id="QUICKSTART">
@@ -97,7 +97,7 @@
 
       <para>Try the following steps:</para>
 
-      <orderedlist inheritnum="ignore" continuation="restarts">
+      <orderedlist continuation="restarts" inheritnum="ignore">
         <listitem>
           <para>If you don&#39;t have <application moreinfo="none">LADSPA</application>
           (Linux Audio Developer&#39;s Simple Plugin API) installed, go and
         </listitem>
 
         <listitem>
-          <para>MIDI Interface (Input)</para>
+          <para>MIDI Interface</para>
         </listitem>
 
         <listitem>
         </listitem>
 
         <listitem>
-          <para>Broad audiofile-type support through the use of sox and mpg123</para>
+          <para>Broad audiofile-type support</para>
         </listitem>
 
         <listitem>
-          <para>Recording to</para>
+          <para>Record to disk</para>
         </listitem>
 
         <listitem>
-          <para>Save turntable sets (.tX - files)</para>
+          <para>Save and Load turntable sets (.tX - files)</para>
         </listitem>
 
         <listitem>
-          <para>Support for the LADSPA-plugin-standard.</para>
+          <para>Support for LADSPA plugins.</para>
+        </listitem>
+
+        <listitem>
+          <para>Support for the <emphasis>JACK Audio Connection Kit</emphasis></para>
         </listitem>
 
         <listitem>
 
               <itemizedlist>
                 <listitem>
-                  <para>The Linux Operating System (Version &#62;= 2.0) or
-                  FreeBSD</para>
+                  <para>Linux, FreeBSD or the like</para>
                 </listitem>
 
                 <listitem>
   <sect1 id="OPERATION">
     <title>Operation</title>
 
-    <para>With Release Version 3.70 the terminatorX has undergone some
-    redesign again. It&#39;s split up in the main controls (master, sequencer,
-    engine controls and menu buttons) and the individual turntable&#39;s
-    controls. Each turntable has it&#39;s own GUI split up into control and
-    audio panel.</para>
+    <para>TerminatorX&#39; user interface is split up into the main controls
+    (master, sequencer, engine controls and menu buttons) and the individual
+    turntable&#39;s controls. Each turntable has it&#39;s own interface split
+    up into a control and a audio panel (see <xref linkend="TURNTABLECONTROLS" />).</para>
 
-    <sect2>
+    <sect2 id="MENU">
       <title>Menu</title>
 
       <para>To clean-up the user interface a bit further some functions have
       been moved into a more standard menu bar for the main window (with
       release 3.80). The following sub-menus are available:</para>
 
-      <sect3>
+      <sect3 id="FILEMENU">
         <title><emphasis>File</emphasis> Menu</title>
 
         <para>The <emphasis>File</emphasis> menu features these functions:</para>
         </itemizedlist>
       </sect3>
 
-      <sect3>
+      <sect3 id="TURNTABLESMENU">
         <title><emphasis>Turntables</emphasis> Menu</title>
 
         <para>The <emphasis>Turntables</emphasis> menu features these
         <title><emphasis>Sequencer</emphasis> Menu</title>
 
         <para>The <emphasis>Sequencer</emphasis> (see the <xref
-        linkend="SEQUENCER" />section for general information on the
+        linkend="SEQUENCER" /> section for general information on the
         sequencer) menu features these functions:</para>
 
         <itemizedlist>
         </itemizedlist>
       </sect3>
 
-      <sect3>
+      <sect3 id="OPTIONSMENU">
         <title><emphasis>Options</emphasis> Menu</title>
 
         <para>The <emphasis>Options</emphasis> menu features these functions:</para>
             <para><emphasis>Preferences</emphasis></para>
 
             <para>Will pop up the Preferences dialog. For more details on
-            configuration itself see the <xref linkend="CONFIGURATION" />
-            section.</para>
+            configuration itself see <xref linkend="CONFIGURATION" />.</para>
           </listitem>
         </itemizedlist>
       </sect3>
 
-      <sect3>
+      <sect3 id="HELPMENU">
         <title><emphasis>Help</emphasis> Menu</title>
 
         <para>The <emphasis>Help</emphasis> menu features these functions:</para>
           <para>Some functions are not available when the audio engine is on,
           their controls will be marked insensitive when you enable the
           engine. To actually enter grab mode you&#39;ll have to click on the
-          &#34;Mouse Grab&#34; button. See <xref linkend="GRABMODE" /> (Grab
-          Mode Operation) to find out how to control the software then.</para>
+          &#34;Mouse Grab&#34; button. See <xref linkend="GRABMODE" /> to find
+          out how to control the software then.</para>
         </listitem>
 
         <listitem>
           <para><emphasis>Sequencer Play / Record / Stop</emphasis></para>
 
-          <para>Please read the <link linkend="SEQUENCER">sequencer</link>
-          section to find out more about the sequencer.</para>
+          <para>Please read the <xref linkend="SEQUENCER" /> section to find
+          out more about the sequencer.</para>
         </listitem>
 
         <listitem>
       </itemizedlist>
     </sect2>
 
-    <sect2 id="TURNtableCONTROLS">
+    <sect2 id="TURNTABLECONTROLS">
       <title>Turntable Controls</title>
 
       <para>The turntable GUI contains multiple controls and the real time
 
           <para>The trigger panel holds all controls related to triggering the
           turntable. For more details on synchronization see <xref
-          linkend="SYNCHRONIZATION" /> (synchronization).</para>
+          linkend="SYNCHRONIZATION" />.</para>
 
           <itemizedlist>
             <listitem>
           displayed signal shows the turntable&#39;s current signal not
           including the echo-signal which is mixed separately.</para></listitem></itemizedlist></para>
         </sect4>
+      </sect3>
 
-        <sect4>
-          <title>Parameter Menus</title>
-
-          <para>TerminatorX can record events for nearly all parameters of a
-          turntable. All of these so-called &#34;sequencable&#34; parameters
-          have an extra pop-up menu since Version 3.81. Simply right-click on
-          the knob, button, slider of the parameter you want to setup, and a
-          menu with the following options will appear:<itemizedlist><listitem><para><emphasis>MIDI
-          Learn</emphasis></para><para>This options provides an easy method to
-          select the MIDI control to modify the parameter you select. If you
-          choose this menu entry, a tiny dialog box will pop up that reads
-          <emphasis>&#34;Waiting for MIDI Event...&#34;</emphasis>. The first
-          MIDI event terminatorX receives will now be mapped to control this
-          parameter.</para></listitem><listitem><para><emphasis>Remove MIDI
-          Binding</emphasis></para><para>If a MIDI event has been bound to a
-          parameter it can be removed by selecting this menu entry.</para></listitem><listitem><para><emphasis>Set
-          Upper MIDI Bound</emphasis></para><para>Sometimes it is preferable
-          to modify a certain parameter only within a specific value range -
-          this can be achieved with this option - by setting an upper and a
-          lower bound for the MIDI control of this parameter. When you select
-          this menu entry, the current setting of this parameter will be used
-          as the upper bound for the parameter&#39;s MIDI mapping.</para></listitem><listitem><para><emphasis>Reset
-          Upper MIDI Bound</emphasis></para><para>If an upper MIDI bound was
-          set for this parameter it can be removed by selecting this menu
-          entry.</para></listitem><listitem><para><emphasis>Set Lower MIDI
-          Bound</emphasis></para><para>Works just like setting the uper MIDI
-          bound: when you select this menu entry, the current setting of this
-          parameter will be used as the lower bound for the parameter&#39;s
-          MIDI mapping.</para></listitem><listitem><para><emphasis>Reset Lower
-          MIDI Bound</emphasis></para><para>If a lower MIDI bound was set for
-          this parameter it can be removed by selecting this menu entry.</para></listitem><listitem><para><emphasis>Delete
-          Sequencer Events</emphasis></para><para>Just like the <xref
-          linkend="SEQUENCERMENU" /> this entry allows you to delete events
-          recorded for this specific parameter.</para></listitem></itemizedlist></para>
-        </sect4>
+      <sect3 id="PARAMETERMENU">
+        <title>Parameter Menu</title>
+
+        <para>TerminatorX can record events for nearly all parameters of a
+        turntable. All of these so-called &#34;sequencable&#34; parameters
+        have an extra pop-up menu since Version 3.81. Simply right-click on
+        the knob, button, slider of the parameter you want to setup, and a
+        menu with the following options will appear:<itemizedlist><listitem><para><emphasis>MIDI
+        Learn</emphasis></para><para>This options provides an easy method to
+        select the MIDI control to modify the parameter you select. If you
+        choose this menu entry, a tiny dialog box will pop up that reads
+        <emphasis>&#34;Waiting for MIDI Event...&#34;</emphasis>. The first
+        MIDI event terminatorX receives will now be mapped to control this
+        parameter.</para></listitem><listitem><para><emphasis>Remove MIDI
+        Binding</emphasis></para><para>If a MIDI event has been bound to a
+        parameter it can be removed by selecting this menu entry.</para></listitem><listitem><para><emphasis>Set
+        Upper MIDI Bound</emphasis></para><para>Sometimes it is preferable to
+        modify a certain parameter only within a specific value range - this
+        can be achieved with this option - by setting an upper and a lower
+        bound for the MIDI control of this parameter. When you select this
+        menu entry, the current setting of this parameter will be used as the
+        upper bound for the parameter&#39;s MIDI mapping.</para></listitem><listitem><para><emphasis>Reset
+        Upper MIDI Bound</emphasis></para><para>If an upper MIDI bound was set
+        for this parameter it can be removed by selecting this menu entry.</para></listitem><listitem><para><emphasis>Set
+        Lower MIDI Bound</emphasis></para><para>Works just like setting the
+        uper MIDI bound: when you select this menu entry, the current setting
+        of this parameter will be used as the lower bound for the
+        parameter&#39;s MIDI mapping.</para></listitem><listitem><para><emphasis>Reset
+        Lower MIDI Bound</emphasis></para><para>If a lower MIDI bound was set
+        for this parameter it can be removed by selecting this menu entry.</para></listitem><listitem><para><emphasis>Delete
+        Sequencer Events</emphasis></para><para>Just like the <xref
+        linkend="SEQUENCERMENU" /> this entry allows you to delete events
+        recorded for this specific parameter.</para></listitem></itemizedlist></para>
       </sect3>
 
       <sect3>
         <figure float="0">
           <title>An example for a terminatorX effect queue</title>
 
-          <graphic format="PNG" fileref="figures/signalflow.png" />
+          <graphic fileref="figures/signalflow.png" format="PNG" />
         </figure>
 
         <para>Now since release 3.71 the built-in echo effect is treated
             plugins have they sometimes might be hard to control with the knob
             widget. In these cases you might want to use the text field to
             enter values. For more details on Plugins see <xref
-            linkend="LADSPAPLUGINS" /> (LADSPA).</para>
+            linkend="LADSPAPLUGINS" />.</para>
           </listitem>
         </itemizedlist>
       </sect3>
       move the sequencer-scale to that position, press <emphasis>Record,</emphasis>
       set the parameter and press <emphasis>Stop</emphasis> again.</para>
 
-      <para>To selectively delete events from the sequencer use the <xref
-      linkend="SEQUENCERMENU" />.</para>
+      <para>To selectively delete events from the sequencer use see <xref
+      linkend="SEQUENCERMENU" /> and <xref linkend="PARAMETERMENU" />.</para>
     </sect2>
 
     <sect2 id="LADSPAPLUGINS">
       url="http://pkl.net/%7Enode/alsa-patch-bay.html">alsa-patch-pay</ulink>
       to connect an output port of your choice (either a hardware MIDI input
       device or a software generating midi events) to the terminatorX input
-      port.</para>
+      port. If the &#34;<emphasis>Restore MIDI Connections</emphasis>&#34;
+      option is activated terminatorX will try to re-connect to the MIDI ports
+      it was connected to with the last run. However this approach is purely
+      address-based and might fail miserably with software ports, in this case
+      just disable the configuration options re-wire manually.</para>
+
+      <para>There are two ways to map MIDI events to a parameter:<itemizedlist><listitem><para>Via
+      the <emphasis>Configure MIDI Bindings</emphasis> dialog as described
+      below</para></listitem><listitem><para>Via the the a parameter&#39;s
+      menu (see <xref linkend="PARAMETERMENU" />) </para></listitem></itemizedlist></para>
 
       <para>Once the connection is set up terminatorX receives MIDI events
       through the input port. To configure what MIDI events will have which
       effect on a terminatorX turntable you can bind MIDI events to parameters
-      of your choice by clicking the <emphasis>MIDI Mapping</emphasis> button
-      of the turntable&#39;s audio panel. As a result the
-      <emphasis>Configure MIDI Bindings</emphasis> dialog will pop up which
-      features a field labelled <emphasis>Selected MIDI Event</emphasis> that
-      will frequently update to display the contents of the last MIDI event
-      received by terminatorX. So in order to map a MIDI controller to a
-      specific turntable parameter select the parameter of your choice from
-      the parameter list, cause your MIDI event sending device to emit the
-      event you want to map the parameter on and click the
-      <emphasis>Bind</emphasis> button.</para>
+      of your choice by clicking the <emphasis>MIDI</emphasis> button of the
+      turntable&#39;s audio panel. As a result the <emphasis>Configure MIDI
+      Bindings</emphasis> dialog will pop up which features a field labelled
+      <emphasis>Selected MIDI Event</emphasis> that will frequently update to
+      display the contents of the last MIDI event received by terminatorX. So
+      in order to map a MIDI controller to a specific turntable parameter
+      select the parameter of your choice from the parameter list, cause your
+      MIDI event sending device to emit the event you want to map the
+      parameter on and click the <emphasis>Bind</emphasis> button.</para>
 
       <para>Immediately after binding the event you should see that the
       <emphasis>Event</emphasis> column entry of the selected parameter is
       url="http://terminatorX.cx/aseqjoy.html">terminatorX website</ulink>,
       too.</para>
     </sect2>
+
+    <sect2 id="JACKSUPPORT">
+      <title>JACK Support</title>
+
+      <para>TerminatorX Version 3.81 brings support for the
+      <emphasis>JACK Audio Connection Kit</emphasis>. Instead of writing audio
+      data directly to some audio device terminatorX can send data to the JACK
+      Daemon for further processing.</para>
+
+      <para>To use the JACK backend you have to ensure that the JACK Daemon is
+      up and running before you start terminatorX. The JACK backend is only
+      available if terminatorX was capable of connecting to the JACK Daemon on
+      startup. By default the two output ports of terminatorX will be
+      connected to physical ports if available. You can then re-wire the ports
+      whatever way you want. They will not be deactivated - when
+      terminatorX&#39; audio engine is turned off , the audio backend emits
+      continuous silence.</para>
+    </sect2>
   </sect1>
 
   <sect1 id="CONFIGURATION">
     default settings. Note: is this file is now an XML file you can edit with
     an editor of your choice.</para>
 
-    <sect2>
+    <sect2 id="AUDIOTAB">
       <title><emphasis>Audio</emphasis> Tab</title>
 
-      <para>This tab allows to select which audio backend to use. Currently
-      there are two of these: one for the OSS (Open Sound System) backend and
-      one for ALSA (Advanced Linux Sound Architecture) backend. Hopefully
-      future releases will feature a JACK backend too.</para>
+      <para>This tab allows to select which audio backend terminatorX should
+      use. Currently there are three options: the OSS (Open Sound System)
+      backend, the ALSA (Advanced Linux Sound Architecture) backend and the
+      JACK (JACK Audio Connection Kit) backend. Some of these options might
+      not be available, if your terminatorX binary wasn&#39;t compiled to
+      support a certain backend.</para>
+
+      <para>The OSS and ALSA backends have dedicated configuration tabs, JACK
+      requires no further configuration - for more details on JACK support see
+      <xref linkend="JACKSUPPORT" />.</para>
     </sect2>
 
-    <sect2>
+    <sect2 id="OSSTAB">
       <title><emphasis>Audio: OSS</emphasis> Tab</title>
 
       <para>Select the audio device you are going to use from the available
       rate.</para>
     </sect2>
 
-    <sect2>
+    <sect2 id="ALSATAB">
       <title><emphasis>Audio: ALSA</emphasis> Tab</title>
 
       <para>Using ALSA for audio output allows specifing the buffer sizes in
       more detailed description check out the ALSA documentation.</para>
     </sect2>
 
-    <sect2>
+    <sect2 id="INPUTTAB">
       <title><emphasis>Input</emphasis> Tab</title>
 
       <para>Between rendering and outputting these blocks terminatorX checks
       homepage for details.</para>
     </sect2>
 
-    <sect2>
+    <sect2 id="USERINTERFACETAB">
       <title><emphasis>User Interface</emphasis> Tab</title>
 
       <para>With <emphasis>Update Idle</emphasis> / <emphasis>Update Delay</emphasis>
     </sect2>
 
     <sect2>
+      <title><emphasis>Audio Colors</emphasis> and <emphasis>VU Colors</emphasis>
+      Tab</title>
+
+      <para>Since Version 3.81 it is possible to configure the colors
+      terminatorX&#39; audio widgets. Simply click on the color you want to
+      modify and select the tone you prefer.</para>
+    </sect2>
+
+    <sect2 id="MISCTAB">
       <title><emphasis>Misc</emphasis> Tab</title>
 
       <para>You can now enter the soundfile editor of your choice in the
       clicking the <emphasis>Edit</emphasis>-button in the main panel of the
       vtt-gui. If you enter for example &#34;myeditor&#34; terminatorX will
       run &#34;myeditor sample_in_vtt.wav&#34;.</para>
+
+      <para>The <emphasis>LADSPA RDF Path</emphasis> defines where liblrdf
+      will look for the RDF files for LADPSA Plugins.</para>
+
+      <para>If <emphasis>Compress set files</emphasis> is activated
+      terminatorX will use zlib to compress set files. This is very usefull
+      for sets that have many events recorded.</para>
+
+      <para>See <xref linkend="MIDI" /> for more details on
+      <emphasis>Restore MIDI Connections</emphasis>. If you disable the
+      <emphasis>Ask for &#34;Quit&#34; Confirmation</emphasis> option
+      terminatorX will no longer ask if you really want to quit.</para>
     </sect2>
   </sect1>
 
index c090d7a4f5961ec077007e6e6267d485ef067c68..c37d95e01ddd8577635da51b11e54cdb43fa6e54 100644 (file)
@@ -2,8 +2,9 @@ LIBS=@X_LIBS@ @GTK_LIBS@ @LIBS@
 
 SUBDIRS = gui_icons smallknob
 
-AM_CFLAGS=@CFLAGS@ @GTK_CFLAGS@ -D_REENTRANT
-AM_CXXFLAGS=@CFLAGS@ @GTK_CFLAGS@ -D_REENTRANT
+EXTRA_CFLAGS=-D_REENTRANT -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED
+AM_CFLAGS=@CFLAGS@ @GTK_CFLAGS@ $(EXTRA_CFLAGS)
+AM_CXXFLAGS=@CFLAGS@ @GTK_CFLAGS@  $(EXTRA_CFLAGS)
 
 license.c: $(top_srcdir)/COPYING
        @AWK@ -f $(srcdir)/licmak.awk < $(top_srcdir)/COPYING > $(srcdir)/license.c
index 297264dd61461b3f9ec77c1bcb56a4c70f75eea3..039fb6fffefc887fe591d0a3886cde1663392158 100644 (file)
@@ -254,14 +254,7 @@ int main(int argc, char **argv)
                tX_cursor::reset_cursor();
        }
 
-#ifdef USE_JACK        
-       jack_check();
-#endif                 
-       
 #ifndef CREATE_BENCHMARK
-
-//     gdk_input_init();
-
        gtk_main();
 
        store_globals();
index 3def5e023a69f13d287c7e69053763f1c6625359..20ed4e257540f75df1b335310a444c2b863232f9 100644 (file)
@@ -197,10 +197,9 @@ int tX_audiodevice_alsa :: open()
        snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
        snd_pcm_hw_params_t *hw_params;
        char pcm_name[64];
-       char foo[PATH_MAX];
-       
+
        /* Removing the device ID comment... */
-       for (int i=0; i<strlen(globals.alsa_device_id); i++) {
+       for (unsigned int i=0; i<strlen(globals.alsa_device_id); i++) {
                if (globals.alsa_device_id[i]!='#') {
                        pcm_name[i]=globals.alsa_device_id[i];
                } else {
@@ -509,8 +508,8 @@ void tX_audiodevice_jack::start()
 
 void tX_audiodevice_jack::fill_frames(jack_default_audio_sample_t *left, jack_default_audio_sample_t *right, jack_nframes_t nframes)
 {
-       int outbuffer_pos=0;
-       int sample;
+       unsigned int outbuffer_pos=0;
+       unsigned int sample;
        
        if (samples_in_overrun_buffer) {
                for (sample=0; ((sample<samples_in_overrun_buffer) && (outbuffer_pos<nframes));) {
@@ -522,12 +521,12 @@ void tX_audiodevice_jack::fill_frames(jack_default_audio_sample_t *left, jack_de
        while (outbuffer_pos<nframes) {
                engine->render_cycle();
                
-               for (sample=0; ((sample<vtt_class::samples_in_mix_buffer) && (outbuffer_pos<nframes));) {
+               for (sample=0; ((sample<(unsigned int) vtt_class::samples_in_mix_buffer) && (outbuffer_pos<nframes));) {
                        left[outbuffer_pos]=vtt_class::mix_buffer[sample++]/32767.0;
                        right[outbuffer_pos++]=vtt_class::mix_buffer[sample++]/32767.0;
                }
                
-               if (sample<vtt_class::samples_in_mix_buffer) {
+               if (sample<(unsigned int) vtt_class::samples_in_mix_buffer) {
                        samples_in_overrun_buffer=vtt_class::samples_in_mix_buffer-sample;
                        /* There's more data in the mixbuffer... */
                        memcpy(overrun_buffer, &vtt_class::mix_buffer[sample], sizeof(f_prec) * samples_in_overrun_buffer);
index 6330ed549c683e06d158264c0f62f22e489dc5ee..b87a61257c4729129422a794d9f323276cf0642e 100644 (file)
@@ -116,7 +116,7 @@ class tX_audiodevice_jack : public tX_audiodevice
        private:
        tX_jack_client *client;
        jack_default_audio_sample_t *overrun_buffer;
-       int samples_in_overrun_buffer;
+       unsigned int samples_in_overrun_buffer;
        
        public:
        virtual int open();
index b6adcbe07f7b05b4094cdadc0f830dea17314b96..8586bd6bf7d7b655ef5abcc5fce2e21e24d4185c 100644 (file)
@@ -27,8 +27,6 @@
 #include <config.h>
 #endif
 
-#ifdef USE_DIAL
-
 #include <math.h>
 #include <stdio.h>
 #include <gtk/gtkmain.h>
 
 /* Forward declarations */
 
-static void gtk_tx_dial_class_init           (GtkTxDialClass    *klass);
-static void gtk_tx_dial_init                 (GtkTxDial         *tx_dial);
-static void gtk_tx_dial_destroy                      (GtkObject        *object);
-static void gtk_tx_dial_realize                      (GtkWidget        *widget);
-static void gtk_tx_dial_size_request         (GtkWidget      *widget,
-                                              GtkRequisition *requisition);
-static void gtk_tx_dial_size_allocate        (GtkWidget     *widget,
-                                              GtkAllocation *allocation);
-static gint gtk_tx_dial_expose               (GtkWidget        *widget,
-                                               GdkEventExpose   *event);
-static gint gtk_tx_dial_button_press         (GtkWidget        *widget,
-                                               GdkEventButton   *event);
-static gint gtk_tx_dial_button_release       (GtkWidget        *widget,
-                                               GdkEventButton   *event);
-static gint gtk_tx_dial_motion_notify        (GtkWidget        *widget,
-                                               GdkEventMotion   *event);
-static gint gtk_tx_dial_timer                (GtkTxDial         *tx_dial);
-
-static void gtk_tx_dial_update_mouse         (GtkTxDial *tx_dial, gint x, gint y);
-static void gtk_tx_dial_update               (GtkTxDial *tx_dial);
-static void gtk_tx_dial_adjustment_changed       (GtkAdjustment        *adjustment,
-                                               gpointer          data);
-static void gtk_tx_dial_adjustment_value_changed (GtkAdjustment        *adjustment,
-                                               gpointer          data);
+static void gtk_tx_dial_class_init             (GtkTxDialClass *klass);
+static void gtk_tx_dial_init                   (GtkTxDial *tx_dial);
+static void gtk_tx_dial_destroy                        (GtkObject *object);
+static void gtk_tx_dial_realize                        (GtkWidget *widget);
+static void gtk_tx_dial_size_request   (GtkWidget *widget, GtkRequisition *requisition);
+static void gtk_tx_dial_size_allocate  (GtkWidget *widget, GtkAllocation *allocation);
+static gint gtk_tx_dial_expose                 (GtkWidget *widget, GdkEventExpose *event);
+static gint gtk_tx_dial_button_press   (GtkWidget *widget, GdkEventButton *event);
+static gint gtk_tx_dial_button_release (GtkWidget *widget, GdkEventButton *event);
+static gint gtk_tx_dial_motion_notify  (GtkWidget *widget, GdkEventMotion *event);
+static gint gtk_tx_dial_timer                  (GtkTxDial *tx_dial);
+static void gtk_tx_dial_update_mouse   (GtkTxDial *tx_dial, gint x, gint y);
+static void gtk_tx_dial_update                 (GtkTxDial *tx_dial);
+static void gtk_tx_dial_adjustment_changed                     (GtkAdjustment *adjustment, gpointer data);
+static void gtk_tx_dial_adjustment_value_changed       (GtkAdjustment *adjustment, gpointer data);
 
 /* Local data */
 
@@ -73,515 +62,456 @@ static GtkWidgetClass *parent_class = NULL;
 
 #define calc_image(f,i); i=(gint) ((f - tx_dial->old_lower)/(tx_dial->old_range) * ((float) TX_MAX_KNOB_PIX)); if(i>TX_MAX_KNOB_PIX) i=TX_MAX_KNOB_PIX; else if (i<0) i=0;
 
-guint
-gtk_tx_dial_get_type ()
+GType gtk_tx_dial_get_type ()
 {
-  static guint tx_dial_type = 0;
-
-  if (!tx_dial_type)
-    {
-      GtkTypeInfo tx_dial_info =
-      {
-       "GtkTxDial",
-       sizeof (GtkTxDial),
-       sizeof (GtkTxDialClass),
-       (GtkClassInitFunc) gtk_tx_dial_class_init,
-       (GtkObjectInitFunc) gtk_tx_dial_init,
-       /* reserved */ NULL,
-       /* reserved */ NULL,
-       /* reserved */ NULL
-      };
-
-      tx_dial_type = gtk_type_unique (gtk_widget_get_type (), &tx_dial_info);
+       static GType tx_dial_type = 0;
+
+       if (!tx_dial_type) {
+               static const GTypeInfo tx_dial_info = {
+                       sizeof (GtkTxDialClass),
+                       NULL,
+                       NULL,
+                       (GClassInitFunc) gtk_tx_dial_class_init, 
+                       NULL,
+                       NULL,
+                       sizeof (GtkTxDial),
+               0,
+                       (GInstanceInitFunc) gtk_tx_dial_init,
+               };
+
+               tx_dial_type = g_type_register_static(GTK_TYPE_WIDGET, "GtkTxDial", &tx_dial_info, 0);
     }
-
-  return tx_dial_type;
+       
+       return tx_dial_type;
 }
 
-static void
-gtk_tx_dial_class_init (GtkTxDialClass *class)
+static void gtk_tx_dial_class_init (GtkTxDialClass *class)
 {
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
+       GtkObjectClass *object_class;
+       GtkWidgetClass *widget_class;
 
-  object_class = (GtkObjectClass*) class;
-  widget_class = (GtkWidgetClass*) class;
+       object_class = (GtkObjectClass*) class;
+       widget_class = (GtkWidgetClass*) class;
 
-  parent_class = gtk_type_class (gtk_widget_get_type ());
+       parent_class = gtk_type_class (gtk_widget_get_type ());
 
-  object_class->destroy = gtk_tx_dial_destroy;
-
-  widget_class->realize = gtk_tx_dial_realize;
-  widget_class->expose_event = gtk_tx_dial_expose;
-  widget_class->size_request = gtk_tx_dial_size_request;
-  widget_class->size_allocate = gtk_tx_dial_size_allocate;
-  widget_class->button_press_event = gtk_tx_dial_button_press;
-  widget_class->button_release_event = gtk_tx_dial_button_release;
-  widget_class->motion_notify_event = gtk_tx_dial_motion_notify;
-}
+       object_class->destroy = gtk_tx_dial_destroy;
 
-static void
-gtk_tx_dial_init (GtkTxDial *tx_dial)
-{
-  tx_dial->button = 0;
-  tx_dial->policy = GTK_UPDATE_CONTINUOUS;
-  tx_dial->timer = 0;
-
-  tx_dial->old_value = 0.0;
-  tx_dial->old_lower = 0.0;
-  tx_dial->old_upper = 0.0;
-  tx_dial->old_range = 0.0; // Dangerous!
-  
-  tx_dial->old_image = 0;
-
-  tx_dial->yofs=0;
-  tx_dial->xofs=0;
-  
-  tx_dial->adjustment = NULL;
+       widget_class->realize = gtk_tx_dial_realize;
+       widget_class->expose_event = gtk_tx_dial_expose;
+       widget_class->size_request = gtk_tx_dial_size_request;
+       widget_class->size_allocate = gtk_tx_dial_size_allocate;
+       widget_class->button_press_event = gtk_tx_dial_button_press;
+       widget_class->button_release_event = gtk_tx_dial_button_release;
+       widget_class->motion_notify_event = gtk_tx_dial_motion_notify;
 }
 
-GtkWidget*
-gtk_tx_dial_new (GtkAdjustment *adjustment)
+static void gtk_tx_dial_init (GtkTxDial *tx_dial)
 {
-  GtkTxDial *tx_dial;
+       tx_dial->button = 0;
+       tx_dial->policy = GTK_UPDATE_CONTINUOUS;
+       tx_dial->timer = 0;
 
-  tx_dial = gtk_type_new (gtk_tx_dial_get_type ());
+       tx_dial->old_value = 0.0;
+       tx_dial->old_lower = 0.0;
+       tx_dial->old_upper = 0.0;
+       tx_dial->old_range = 0.0; // Dangerous!
 
-  if (!adjustment)
-    adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0,
-                                                     0.0, 0.0, 0.0);
+       tx_dial->old_image = 0;
 
-  gtk_tx_dial_set_adjustment (tx_dial, adjustment);
-  gtk_object_ref (GTK_OBJECT (tx_dial->adjustment));
+       tx_dial->yofs=0;
+       tx_dial->xofs=0;
 
-  return GTK_WIDGET (tx_dial);
+       tx_dial->adjustment = NULL;
 }
 
-static void
-gtk_tx_dial_destroy (GtkObject *object)
+GtkWidget* gtk_tx_dial_new (GtkAdjustment *adjustment)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (object));
-
-  tx_dial = GTK_TX_DIAL (object);
+       GtkTxDial *tx_dial;
+       
+       tx_dial = (GtkTxDial *) g_object_new(gtk_tx_dial_get_type(), NULL);
+       
+       if (!adjustment) {
+               adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0,
+                                         0.0, 0.0, 0.0);
+       }
 
-  if (tx_dial->adjustment)
-    gtk_object_unref (GTK_OBJECT (tx_dial->adjustment));
+       gtk_tx_dial_set_adjustment (tx_dial, adjustment);
+       g_object_ref (G_OBJECT (tx_dial->adjustment));
 
-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+       return GTK_WIDGET (tx_dial);
 }
 
-GtkAdjustment*
-gtk_tx_dial_get_adjustment (GtkTxDial *tx_dial)
+static void gtk_tx_dial_destroy (GtkObject *object)
 {
-  g_return_val_if_fail (tx_dial != NULL, NULL);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (tx_dial), NULL);
+       GtkTxDial *tx_dial;
+
+       g_return_if_fail (object != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (object));
+       
+       tx_dial = GTK_TX_DIAL (object);
+
+       if (tx_dial->adjustment)
+               g_object_unref (G_OBJECT (tx_dial->adjustment));
+       
+       if (GTK_OBJECT_CLASS (parent_class)->destroy)
+               (*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
 
-  return tx_dial->adjustment;
+GtkAdjustment* gtk_tx_dial_get_adjustment (GtkTxDial *tx_dial)
+{
+       g_return_val_if_fail (tx_dial != NULL, NULL);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (tx_dial), NULL);
+       
+       return tx_dial->adjustment;
 }
 
-void
-gtk_tx_dial_set_update_policy (GtkTxDial        *tx_dial,
-                            GtkUpdateType  policy)
+void gtk_tx_dial_set_update_policy (GtkTxDial *tx_dial, GtkUpdateType policy)
 {
-  g_return_if_fail (tx_dial != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
+       g_return_if_fail (tx_dial != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
 
-  tx_dial->policy = policy;
+       tx_dial->policy = policy;
 }
 
-void
-gtk_tx_dial_set_adjustment (GtkTxDial      *tx_dial,
-                         GtkAdjustment *adjustment)
+void gtk_tx_dial_set_adjustment (GtkTxDial *tx_dial, GtkAdjustment *adjustment)
 {
-  g_return_if_fail (tx_dial != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
-
-  if (tx_dial->adjustment)
-    {
-      gtk_signal_disconnect_by_data (GTK_OBJECT (tx_dial->adjustment),
-                                    (gpointer) tx_dial);
-      gtk_object_unref (GTK_OBJECT (tx_dial->adjustment));
-    }
+       g_return_if_fail (tx_dial != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
+       
+       if (tx_dial->adjustment) {
+               g_signal_handlers_disconnect_matched(G_OBJECT(tx_dial->adjustment),
+                       G_SIGNAL_MATCH_DATA, 0, 0, 0, 0,
+                       (gpointer) tx_dial);
+               g_object_unref (G_OBJECT (tx_dial->adjustment));
+       }
+       
+       tx_dial->adjustment = adjustment;
+       g_object_ref (G_OBJECT (tx_dial->adjustment));
 
-  tx_dial->adjustment = adjustment;
-  gtk_object_ref (GTK_OBJECT (tx_dial->adjustment));
+       g_signal_connect (G_OBJECT (adjustment), "changed",
+                         (GtkSignalFunc) gtk_tx_dial_adjustment_changed,
+                         (gpointer) tx_dial);
+       g_signal_connect (G_OBJECT (adjustment), "value_changed",
+                         (GtkSignalFunc) gtk_tx_dial_adjustment_value_changed,
+                         (gpointer) tx_dial);
 
-  gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
-                     (GtkSignalFunc) gtk_tx_dial_adjustment_changed,
-                     (gpointer) tx_dial);
-  gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
-                     (GtkSignalFunc) gtk_tx_dial_adjustment_value_changed,
-                     (gpointer) tx_dial);
+       tx_dial->old_value = adjustment->value;
+       tx_dial->old_lower = adjustment->lower;
+       tx_dial->old_upper = adjustment->upper;
+       tx_dial->old_range = adjustment->upper - adjustment->lower;
 
-  tx_dial->old_value = adjustment->value;
-  tx_dial->old_lower = adjustment->lower;
-  tx_dial->old_upper = adjustment->upper;
-  tx_dial->old_range = adjustment->upper - adjustment->lower;
-  
-  calc_image(adjustment->value,tx_dial->old_image);
+       calc_image(adjustment->value,tx_dial->old_image);
 
-  gtk_tx_dial_update (tx_dial);
+       gtk_tx_dial_update (tx_dial);
 }
 
-static void
-gtk_tx_dial_realize (GtkWidget *widget)
+static void gtk_tx_dial_realize (GtkWidget *widget)
 {
-  GtkTxDial *tx_dial;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (widget));
-
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-  tx_dial = GTK_TX_DIAL (widget);
-
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (widget) | 
-    GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | 
-    GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
-    GDK_POINTER_MOTION_HINT_MASK;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.colormap = gtk_widget_get_colormap (widget);
-
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-  widget->window = gdk_window_new (widget->parent->window,
-                                  &attributes,
-                                  attributes_mask);
-
-  gdk_window_set_user_data (widget->window, widget);
-  widget->style = gtk_style_attach (widget->style, widget->window);
-  gtk_widget_set_style(widget, gtk_widget_get_default_style());
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-
-  gdk_window_set_background (widget->window, 
-                             &widget->style->base[GTK_STATE_NORMAL]); 
-  gtk_widget_shape_combine_mask (widget, knob_mask, 0,0);
+       GtkTxDial *tx_dial;
+       GdkWindowAttr attributes;
+       gint attributes_mask;
+       
+       g_return_if_fail (widget != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (widget));
+       
+       GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       attributes.x = widget->allocation.x;
+       attributes.y = widget->allocation.y;
+       attributes.width = widget->allocation.width;
+       attributes.height = widget->allocation.height;
+       attributes.wclass = GDK_INPUT_OUTPUT;
+       attributes.window_type = GDK_WINDOW_CHILD;
+       attributes.event_mask = gtk_widget_get_events (widget) | 
+               GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | 
+               GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
+               GDK_POINTER_MOTION_HINT_MASK;
+       attributes.visual = gtk_widget_get_visual (widget);
+       attributes.colormap = gtk_widget_get_colormap (widget);
+       
+       attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+       widget->window = gdk_window_new (widget->parent->window,
+                                                                       &attributes,
+                                                                       attributes_mask);
+       
+       gdk_window_set_user_data (widget->window, widget);
+       widget->style = gtk_style_attach (widget->style, widget->window);
+       gtk_widget_set_style(widget, gtk_widget_get_default_style());
+       gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+       
+       gdk_window_set_background (widget->window, &widget->style->base[GTK_STATE_NORMAL]); 
+       gtk_widget_shape_combine_mask (widget, knob_mask, 0,0);
 }
 
-static void 
-gtk_tx_dial_size_request (GtkWidget      *widget,
-                      GtkRequisition *requisition)
+static void gtk_tx_dial_size_request(GtkWidget *widget, GtkRequisition *requisition)
 {
-  requisition->width = KNOB_SIZE;
-  requisition->height = KNOB_SIZE;
+       requisition->width = KNOB_SIZE;
+       requisition->height = KNOB_SIZE;
 }
 
-static void
-gtk_tx_dial_size_allocate (GtkWidget     *widget,
-                       GtkAllocation *allocation)
+static void gtk_tx_dial_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (widget));
-  g_return_if_fail (allocation != NULL);
-
-  widget->allocation = *allocation;
-  tx_dial = GTK_TX_DIAL (widget);
-
-  if (GTK_WIDGET_REALIZED (widget))
-    {
-
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width, allocation->height);
-     tx_dial->xofs=(allocation->width-KNOB_SIZE)/2;
-     tx_dial->yofs=(allocation->height-KNOB_SIZE)/2;
-    }
+       GtkTxDial *tx_dial;
+       
+       g_return_if_fail (widget != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (widget));
+       g_return_if_fail (allocation != NULL);
+       
+       widget->allocation = *allocation;
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       if (GTK_WIDGET_REALIZED (widget)) {
+               gdk_window_move_resize (widget->window,
+                                 allocation->x, allocation->y,
+                                 allocation->width, allocation->height);
+               
+               tx_dial->xofs=(allocation->width-KNOB_SIZE)/2;
+               tx_dial->yofs=(allocation->height-KNOB_SIZE)/2;
+       }
 }
 
-inline void
-gtk_tx_dial_draw (GtkTxDial *tx_dial, GtkWidget *widget)
+inline void gtk_tx_dial_draw (GtkTxDial *tx_dial, GtkWidget *widget)
 {
        if (GTK_WIDGET_DRAWABLE (widget)) {
-               gdk_draw_pixmap(widget->window, widget->style->bg_gc[GTK_WIDGET_STATE(widget)],
-                        knob_pixmaps[tx_dial->old_image], 0, 0, tx_dial->xofs, tx_dial->yofs, KNOB_SIZE, KNOB_SIZE);
+               gdk_pixbuf_render_to_drawable(knob_pixmaps[tx_dial->old_image], 
+                               widget->window,  widget->style->bg_gc[GTK_WIDGET_STATE(widget)],
+                               0, 0, tx_dial->xofs, tx_dial->yofs,
+                               KNOB_SIZE, KNOB_SIZE, GDK_RGB_DITHER_NORMAL, 0, 0);
        }                
 }
 
-static gint
-gtk_tx_dial_expose (GtkWidget  *widget,
-                GdkEventExpose *event)
+static gint gtk_tx_dial_expose (GtkWidget *widget, GdkEventExpose *event)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  if (event->count > 0)
-    return FALSE;
-  
-  tx_dial = GTK_TX_DIAL (widget);
-
-  gtk_tx_dial_draw(tx_dial, widget);
+       GtkTxDial *tx_dial;
+       
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       if (event->count > 0)
+       return FALSE;
+       
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       gtk_tx_dial_draw(tx_dial, widget);
                  
-  return FALSE;
+       return FALSE;
 }
 
-static gint
-gtk_tx_dial_button_press (GtkWidget      *widget,
-                      GdkEventButton *event)
+static gint gtk_tx_dial_button_press (GtkWidget *widget, GdkEventButton *event)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  tx_dial = GTK_TX_DIAL (widget);
-
-  tx_dial->x = event->x;
-  tx_dial->y = event->y;    
-  
-  if (!tx_dial->button)
-    {
-      gtk_grab_add (widget);
-
-      tx_dial->button = event->button;
-    }
-
-  return FALSE;
+       GtkTxDial *tx_dial;
+       
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       tx_dial->x = event->x;
+       tx_dial->y = event->y;    
+       
+       if (!tx_dial->button) {
+               gtk_grab_add (widget);
+               tx_dial->button = event->button;
+       }
+       
+       return FALSE;
 }
 
-static gint
-gtk_tx_dial_button_release (GtkWidget  *widget,
-                         GdkEventButton *event)
+static gint gtk_tx_dial_button_release (GtkWidget *widget, GdkEventButton *event)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  tx_dial = GTK_TX_DIAL (widget);
-
-  if (tx_dial->button == event->button)
-    {
-      gtk_grab_remove (widget);
-
-      tx_dial->button = 0;
-
-      if (tx_dial->policy == GTK_UPDATE_DELAYED)
-       gtk_timeout_remove (tx_dial->timer);
-      
-      if ((tx_dial->policy != GTK_UPDATE_CONTINUOUS) &&
-         (tx_dial->old_value != tx_dial->adjustment->value))
-       gtk_signal_emit_by_name (GTK_OBJECT (tx_dial->adjustment),
-                                "value_changed");
-    }
-
-  return FALSE;
+       GtkTxDial *tx_dial;
+       
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       if (tx_dial->button == event->button) {
+               gtk_grab_remove (widget);
+               tx_dial->button = 0;
+               
+               if (tx_dial->policy == GTK_UPDATE_DELAYED)
+                       gtk_timeout_remove (tx_dial->timer);
+               
+               if ((tx_dial->policy != GTK_UPDATE_CONTINUOUS) &&
+                       (tx_dial->old_value != tx_dial->adjustment->value))
+                       g_signal_emit_by_name (G_OBJECT (tx_dial->adjustment),
+                       "value_changed");
+       }
+       
+       return FALSE;
 }
 
-static gint
-gtk_tx_dial_motion_notify (GtkWidget      *widget,
-                        GdkEventMotion *event)
+static gint gtk_tx_dial_motion_notify (GtkWidget *widget, GdkEventMotion *event)
 {
-  GtkTxDial *tx_dial;
-  GdkModifierType mods;
-  gint x, y, mask;
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  tx_dial = GTK_TX_DIAL (widget);
-
-  if (tx_dial->button != 0)
-    {
-      x = event->x;
-      y = event->y;
-
-      if (event->is_hint || (event->window != widget->window))
-       gdk_window_get_pointer (widget->window, &x, &y, &mods);
-
-      switch (tx_dial->button)
-       {
-       case 1:
-         mask = GDK_BUTTON1_MASK;
-         break;
-       case 2:
-         mask = GDK_BUTTON2_MASK;
-         break;
-       case 3:
-         mask = GDK_BUTTON3_MASK;
-         break;
-       default:
-         mask = 0;
-         break;
+       GtkTxDial *tx_dial;
+       GdkModifierType mods;
+       gint x, y, mask;
+       
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (widget), FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       tx_dial = GTK_TX_DIAL (widget);
+       
+       if (tx_dial->button != 0) {
+               x = event->x;
+               y = event->y;
+               
+               if (event->is_hint || (event->window != widget->window))
+                       gdk_window_get_pointer (widget->window, &x, &y, &mods);
+               
+               switch (tx_dial->button) {
+                       case 1:
+                               mask = GDK_BUTTON1_MASK;
+                               break;
+                       case 2:
+                               mask = GDK_BUTTON2_MASK;
+                               break;
+                       case 3:
+                               mask = GDK_BUTTON3_MASK;
+                               break;
+                       default:
+                               mask = 0;
+               }
+               
+               if (mods & mask)
+                       gtk_tx_dial_update_mouse (tx_dial, x,y);
        }
-
-      if (mods & mask)
-       gtk_tx_dial_update_mouse (tx_dial, x,y);
-    }
-
-  return FALSE;
+       
+       return FALSE;
 }
 
-static gint
-gtk_tx_dial_timer (GtkTxDial *tx_dial)
+static gint gtk_tx_dial_timer (GtkTxDial *tx_dial)
 {
-  g_return_val_if_fail (tx_dial != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_DIAL (tx_dial), FALSE);
-
-  if (tx_dial->policy == GTK_UPDATE_DELAYED)
-    gtk_signal_emit_by_name (GTK_OBJECT (tx_dial->adjustment),
-                            "value_changed");
-
-  return FALSE;
+       g_return_val_if_fail (tx_dial != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_DIAL (tx_dial), FALSE);
+       
+       if (tx_dial->policy == GTK_UPDATE_DELAYED)
+               g_signal_emit_by_name (G_OBJECT (tx_dial->adjustment),
+                                "value_changed");
+       
+       return FALSE;
 }
 
-static void
-gtk_tx_dial_update_mouse (GtkTxDial *tx_dial, gint x, gint y)
+static void gtk_tx_dial_update_mouse (GtkTxDial *tx_dial, gint x, gint y)
 {
-  gdouble dx, dy, d;
-  gfloat old_value;
-  gfloat new_value;
-  gint image;
-
-  g_return_if_fail (tx_dial != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
-
-  dx=x-tx_dial->x;
-  dy=tx_dial->y-y;
-
-  tx_dial->x=x;
-  tx_dial->y=y;
-
-  //if (fabs(dx) > fabs(dy)) d=dx; else d=dy;
-  d=dx+dy;
-  
-  d/=200.0;
-
-  old_value=tx_dial->adjustment->value;    
-    
-  new_value=old_value + d*tx_dial->old_range;
-  
-  if (new_value>tx_dial->old_upper) new_value=tx_dial->old_upper;
-  else if (new_value<tx_dial->old_lower) new_value=tx_dial->old_lower;
-  tx_dial->adjustment->value=new_value;
-    
-  if (tx_dial->adjustment->value != old_value)
-    {
-      if (tx_dial->policy == GTK_UPDATE_CONTINUOUS)
-       {
-         gtk_signal_emit_by_name (GTK_OBJECT (tx_dial->adjustment),
+       gdouble dx, dy, d;
+       gfloat old_value, new_value;
+       gint image;
+       
+       g_return_if_fail (tx_dial != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
+       
+       dx=x-tx_dial->x;
+       dy=tx_dial->y-y;
+       tx_dial->x=x;
+       tx_dial->y=y;
+       
+       d=dx+dy;
+       d/=200.0;
+       
+       old_value=tx_dial->adjustment->value;    
+       new_value=old_value + d*tx_dial->old_range;
+       
+       if (new_value>tx_dial->old_upper) 
+               new_value=tx_dial->old_upper;
+       else if (new_value<tx_dial->old_lower) 
+               new_value=tx_dial->old_lower;
+       
+       tx_dial->adjustment->value=new_value;
+       
+       if (tx_dial->adjustment->value != old_value) {
+               if (tx_dial->policy == GTK_UPDATE_CONTINUOUS)   {
+                       g_signal_emit_by_name (G_OBJECT (tx_dial->adjustment),
                                   "value_changed");
+               } else {
+                       calc_image(tx_dial->adjustment->value, image);
+               
+                       if (image!=tx_dial->old_image) {
+                               tx_dial->old_image=image;
+                               gtk_tx_dial_draw(tx_dial, GTK_WIDGET(tx_dial));
+                       }
+               
+                       if (tx_dial->policy == GTK_UPDATE_DELAYED) {
+                               if (tx_dial->timer)
+                                       gtk_timeout_remove (tx_dial->timer);
+               
+                                       tx_dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
+                                                (GtkFunction) gtk_tx_dial_timer,
+                                                (gpointer) tx_dial);
+                       }
+               }
        }
-      else
-       {
-         calc_image(tx_dial->adjustment->value, image);
-
-         if (image!=tx_dial->old_image)
-         {
-                tx_dial->old_image=image;
-//              gtk_widget_draw (GTK_WIDGET(tx_dial), NULL);
-                gtk_tx_dial_draw(tx_dial, GTK_WIDGET(tx_dial));
-         }
-
-         if (tx_dial->policy == GTK_UPDATE_DELAYED)
-           {
-             if (tx_dial->timer)
-               gtk_timeout_remove (tx_dial->timer);
-
-             tx_dial->timer = gtk_timeout_add (SCROLL_DELAY_LENGTH,
-                                            (GtkFunction) gtk_tx_dial_timer,
-                                            (gpointer) tx_dial);
-           }
-       }
-    }
 }
 
-static void
-gtk_tx_dial_update (GtkTxDial *tx_dial)
+static void gtk_tx_dial_update (GtkTxDial *tx_dial)
 {
-  gfloat new_value;
-  gint image;
-  
-  g_return_if_fail (tx_dial != NULL);
-  g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
-
-  new_value = tx_dial->adjustment->value;
-  
-  if (new_value < tx_dial->adjustment->lower)
-    new_value = tx_dial->adjustment->lower;
-
-  if (new_value > tx_dial->adjustment->upper)
-    new_value = tx_dial->adjustment->upper;
-
-  if (new_value != tx_dial->adjustment->value)
-    {
-      tx_dial->adjustment->value = new_value;
-      gtk_signal_emit_by_name (GTK_OBJECT (tx_dial->adjustment), "value_changed");
-    }
-    
-     calc_image(new_value, image);
-     if (image!=tx_dial->old_image)
-     {
-                tx_dial->old_image=image;
-                gtk_tx_dial_draw(tx_dial, GTK_WIDGET(tx_dial));
-     }
-
-//  gtk_widget_draw (GTK_WIDGET(tx_dial), NULL);
+       gfloat new_value;
+       gint image;
+       
+       g_return_if_fail (tx_dial != NULL);
+       g_return_if_fail (GTK_IS_TX_DIAL (tx_dial));
+       
+       new_value = tx_dial->adjustment->value;
+       
+       if (new_value < tx_dial->adjustment->lower)
+               new_value = tx_dial->adjustment->lower;
+       
+       if (new_value > tx_dial->adjustment->upper)
+               new_value = tx_dial->adjustment->upper;
+       
+       if (new_value != tx_dial->adjustment->value) {
+               tx_dial->adjustment->value = new_value;
+               g_signal_emit_by_name (G_OBJECT (tx_dial->adjustment), "value_changed");
+       }
+       
+       calc_image(new_value, image);
+       
+       if (image!=tx_dial->old_image) {
+               tx_dial->old_image=image;
+               gtk_tx_dial_draw(tx_dial, GTK_WIDGET(tx_dial));
+       }
 }
 
-static void
-gtk_tx_dial_adjustment_changed (GtkAdjustment *adjustment,
+static void gtk_tx_dial_adjustment_changed (GtkAdjustment *adjustment,
                              gpointer       data)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_if_fail (adjustment != NULL);
-  g_return_if_fail (data != NULL);
-
-  tx_dial = GTK_TX_DIAL (data);
-
-  if ((tx_dial->old_value != adjustment->value) ||
-      (tx_dial->old_lower != adjustment->lower) ||
-      (tx_dial->old_upper != adjustment->upper))
-    {
-      tx_dial->old_value = adjustment->value;
-      tx_dial->old_lower = adjustment->lower;
-      tx_dial->old_upper = adjustment->upper;
-      tx_dial->old_range = adjustment->upper-adjustment->lower;
-      
-//      calc_image(adjustment->value, tx_dial->old_image)
-//              gtk_tx_dial_draw(tx_dial, GTK_WIDET(tx_dial));
-      gtk_tx_dial_update (tx_dial);
-      
-    }
+       GtkTxDial *tx_dial;
+       
+       g_return_if_fail (adjustment != NULL);
+       g_return_if_fail (data != NULL);
+       
+       tx_dial = GTK_TX_DIAL (data);
+       
+       if ((tx_dial->old_value != adjustment->value) ||
+               (tx_dial->old_lower != adjustment->lower) ||
+               (tx_dial->old_upper != adjustment->upper)) {
+               tx_dial->old_value = adjustment->value;
+               tx_dial->old_lower = adjustment->lower;
+               tx_dial->old_upper = adjustment->upper;
+               tx_dial->old_range = adjustment->upper-adjustment->lower;
+               
+               gtk_tx_dial_update (tx_dial);
+       }
 }
 
-static void
-gtk_tx_dial_adjustment_value_changed (GtkAdjustment *adjustment,
-                                   gpointer       data)
+static void gtk_tx_dial_adjustment_value_changed (GtkAdjustment *adjustment, gpointer data)
 {
-  GtkTxDial *tx_dial;
-
-  g_return_if_fail (adjustment != NULL);
-  g_return_if_fail (data != NULL);
-
-  tx_dial = GTK_TX_DIAL (data);
-
-  if (tx_dial->old_value != adjustment->value)
-    {
-      gtk_tx_dial_update (tx_dial);
-
-      tx_dial->old_value = adjustment->value;
-    }
+       GtkTxDial *tx_dial;
+       
+       g_return_if_fail (adjustment != NULL);
+       g_return_if_fail (data != NULL);
+       
+       tx_dial = GTK_TX_DIAL (data);
+       
+       if (tx_dial->old_value != adjustment->value) {
+               gtk_tx_dial_update (tx_dial);
+               tx_dial->old_value = adjustment->value;
+       }
 }
-/* example-end */
-#endif
index f671d4c7ffa5a30a04a7f7e7142bbe35e4fad75c..82dbe2795f7ef8c6a669d6cf584b4632fb58d2f8 100644 (file)
@@ -23,7 +23,6 @@
     Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 */    
 
-
 #ifndef __GTK_TX_DIAL_H__
 #define __GTK_TX_DIAL_H__
 
 #include <config.h>
 #endif
 
-#ifdef USE_DIAL
-
 #include <gdk/gdk.h>
 #include <gtk/gtkadjustment.h>
 #include <gtk/gtkwidget.h>
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-
 #define GTK_TX_DIAL(obj)              GTK_CHECK_CAST (obj, gtk_tx_dial_get_type (), GtkTxDial)
 #define GTK_TX_DIAL_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_tx_dial_get_type (), GtkTxDialClass)
 #define GTK_IS_TX_DIAL(obj)       GTK_CHECK_TYPE (obj, gtk_tx_dial_get_type ())
 
-
 typedef struct _GtkTxDial        GtkTxDial;
 typedef struct _GtkTxDialClass   GtkTxDialClass;
 
-struct _GtkTxDial
-{
-  GtkWidget widget;
-
-  /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
-  guint policy : 2;
-
-  /* Button currently pressed or 0 if none */
-  guint8 button;
-
-  /* ID of update timer, or 0 if none */
-  guint32 timer;
-
-  /* Old values from adjustment stored so we know when something changes */
-  gfloat old_value;
-  gfloat old_lower;
-  gfloat old_upper;
-  gfloat old_range;
-
-  /* The adjustment object that stores the data for this tx_dial */
-  GtkAdjustment *adjustment;
-  
-  gint x, y;
-  gint xofs, yofs;
-  
-  gint old_image;
+struct _GtkTxDial {
+       GtkWidget widget;
+       
+       /* update policy (GTK_UPDATE_[CONTINUOUS/DELAYED/DISCONTINUOUS]) */
+       guint policy : 2;
+       
+       /* Button currently pressed or 0 if none */
+       guint8 button;
+       
+       /* ID of update timer, or 0 if none */
+       guint32 timer;
+       
+       /* Old values from adjustment stored so we know when something changes */
+       gfloat old_value;
+       gfloat old_lower;
+       gfloat old_upper;
+       gfloat old_range;
+       
+       /* The adjustment object that stores the data for this tx_dial */
+       GtkAdjustment *adjustment;
+       
+       gint x, y;
+       gint xofs, yofs;
+       
+       gint old_image;
 };
 
-struct _GtkTxDialClass
-{
-  GtkWidgetClass parent_class;
+struct _GtkTxDialClass {
+       GtkWidgetClass parent_class;
 };
 
+GtkWidget* gtk_tx_dial_new (GtkAdjustment *adjustment);
+GType gtk_tx_dial_get_type (void);
+GtkAdjustment* gtk_tx_dial_get_adjustment (GtkTxDial *tx_dial);
+void gtk_tx_dial_set_update_policy (GtkTxDial *tx_dial, GtkUpdateType policy);
+void gtk_tx_dial_set_adjustment (GtkTxDial *tx_dial, GtkAdjustment *adjustment);
 
-GtkWidget*     gtk_tx_dial_new                (GtkAdjustment *adjustment);
-guint         gtk_tx_dial_get_type            (void);
-GtkAdjustment* gtk_tx_dial_get_adjustment         (GtkTxDial      *tx_dial);
-void          gtk_tx_dial_set_update_policy      (GtkTxDial      *tx_dial,
-                                               GtkUpdateType  policy);
-
-void          gtk_tx_dial_set_adjustment         (GtkTxDial      *tx_dial,
-                                               GtkAdjustment *adjustment);
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
-
 #endif /* __GTK_TX_DIAL_H__ */
-/* example-end */
-#endif
index 1239258cf31b06f4a0befb534386f2626b5d8e14..db32c2113c8e52c7b0e9417cfb8ad42b5346a0ff 100644 (file)
@@ -139,6 +139,7 @@ void apply_options(GtkWidget *dialog) {
        globals.compress_set_files=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "compress_set_files")))==TRUE);        
        globals.prelis=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "prelisten_enabled")))==TRUE);
        globals.restore_midi_connections=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "reconnect_enabled")))==TRUE);
+       globals.quit_confirm=(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "quit_confirm")))==TRUE);
        
        /* update colors */
        std::list<vtt_class *>::iterator vtt;
@@ -462,12 +463,13 @@ void init_tx_options(GtkWidget *dialog) {
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "compress_set_files")), globals.compress_set_files);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "prelisten_enabled")), globals.prelis);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "reconnect_enabled")), globals.restore_midi_connections);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(lookup_widget(dialog, "quit_confirm")), globals.quit_confirm);
 }
 
 void create_options()
 {
        opt_dialog=create_tx_options();
-       //gtk_widget_hide(lookup_widget(opt_dialog, "jack_driver"));    
+       tX_set_icon(opt_dialog);
        init_tx_options(opt_dialog);
        gtk_widget_show(opt_dialog);
 }
@@ -507,9 +509,7 @@ GdkFont *GPL_font=NULL;
 
 void show_about(int nag)
 {
-       GtkWidget *window, *pwid;
-       GdkBitmap *mask;
-       GtkStyle *style;
+       GtkWidget *window;
        GtkWidget *btn;
        GtkWidget *box;
        GtkWidget *hbox;
@@ -517,7 +517,7 @@ void show_about(int nag)
        GtkWidget *sep;
        GtkWidget *text;
        GtkWidget *scroll;
-       GdkPixmap *pmap=NULL;
+       GtkWidget *iwid;
        
        /* Only raise the window if it's already open... */
        if (about)  {
@@ -528,24 +528,13 @@ void show_about(int nag)
        /* Create the window... */
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_container_set_border_width(GTK_CONTAINER(window), 5);
-       gtk_window_set_title(GTK_WINDOW (window), "terminatorX - About");
-       gtk_window_set_position(GTK_WINDOW (window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW (window), TRUE);
-       gtk_window_set_policy(GTK_WINDOW (window), TRUE, TRUE, FALSE);  
-       
-       /*
-       gtk_window_set_wmclass(GTK_WINDOW(window), "terminatorX", "tX_about");
-       g_object_set (G_OBJECT (window), "type", GTK_WINDOW_TOPLEVEL, NULL);
-       gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
-       gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
        gtk_window_set_title(GTK_WINDOW(window), "terminatorX - About");
-       gtk_window_set_decorated(GTK_WINDOW(window), nag ? TRUE : FALSE);
-       */
-       
+       gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
+       gtk_window_set_modal(GTK_WINDOW(window), TRUE);
+       gtk_window_set_resizable(GTK_WINDOW(window), nag ? TRUE: FALSE);
+
        GdkPixbuf *image=gdk_pixbuf_new_from_xpm_data((const char **)logo_xpm);
-       gdk_pixbuf_render_pixmap_and_mask(image, &pmap, &mask, 0);
-       
-       pwid = gtk_pixmap_new( pmap, mask );
+       iwid = gtk_image_new_from_pixbuf(image);
        
        if (nag) {
                GtkWidget *box=gtk_vbox_new(FALSE, 2);
@@ -553,7 +542,7 @@ void show_about(int nag)
                GtkWidget *label;
                
                gtk_container_add(GTK_CONTAINER(window), box);
-               gtk_box_pack_start(GTK_BOX(box), pwid, WID_FIX);
+               gtk_box_pack_start(GTK_BOX(box), iwid, WID_FIX);
                gtk_box_pack_start(GTK_BOX(box), box2, WID_FIX);
                
                label=gtk_label_new(PACKAGE" release "VERSION);
@@ -568,13 +557,13 @@ void show_about(int nag)
                
                gtk_widget_show(box2);
                gtk_widget_show(box);
-               gtk_widget_show(pwid);
+               gtk_widget_show(iwid);
 
                gtk_window_set_decorated(GTK_WINDOW(window), FALSE);            
                gtk_widget_show(window);
        } else {
                box=gtk_vbox_new(FALSE, 5);
-               add_about_wid_fix(pwid);
+               add_about_wid_fix(iwid);
                
                sep=gtk_hseparator_new();
                add_about_wid_fix(sep);
@@ -651,7 +640,7 @@ void show_about(int nag)
                gtk_text_buffer_insert_with_tags_by_name(tbuffer, &iter, license, -1, "courier", NULL);
                gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
                gtk_text_view_set_right_margin(GTK_TEXT_VIEW(text), 5);
-               gtk_widget_set_usize(GTK_WIDGET(text), 640, 180);
+               gtk_widget_set_size_request(GTK_WIDGET(text), 700, 220);
                gtk_widget_show(text);          
                
                gtk_box_pack_start(GTK_BOX(hbox), scroll, WID_DYN);
@@ -668,25 +657,24 @@ void show_about(int nag)
                gtk_container_add(GTK_CONTAINER(window), box);
                gtk_widget_show(box);
                
-               gtk_signal_connect(GTK_OBJECT(btn), "clicked", (GtkSignalFunc) destroy_about, NULL);            
-               gtk_signal_connect(GTK_OBJECT(window), "delete-event", (GtkSignalFunc) destroy_about, NULL);            
+               g_signal_connect(G_OBJECT(btn), "clicked", (GtkSignalFunc) destroy_about, NULL);                
+               g_signal_connect(G_OBJECT(window), "delete-event", (GtkSignalFunc) destroy_about, NULL);                
        }
        gtk_widget_show(window);        
-       tX_set_icon(window, "tX About");
+       tX_set_icon(window);
        
        while (gtk_events_pending()) gtk_main_iteration();
                
        about=window;
 }
 
-GdkPixbuf *tX_window_icon=NULL;
+static GdkPixbuf *tX_window_icon=NULL;
 
-void tX_set_icon(GtkWidget *widget, char *name)
+void tX_set_icon(GtkWidget *widget)
 {      
        if (!tX_window_icon) {
                tX_window_icon=gdk_pixbuf_new_from_inline(-1, tX_icon, FALSE, NULL);
        }
 
        gtk_window_set_icon(GTK_WINDOW(widget), tX_window_icon);
-       gdk_window_set_icon_name(widget->window, name); 
 }
index 570d728c6969106788d343600623b1e3c6bb8c92..61b39b51816daeb0784a49b9d3f70658dcb92d19 100644 (file)
@@ -31,6 +31,6 @@ extern void display_options();
 extern void show_about(int nag);
 extern void destroy_about();
 extern void init_tx_options(GtkWidget *dialog);
-extern void tX_set_icon(GtkWidget *widget, char *);
+extern void tX_set_icon(GtkWidget *widget);
 extern void apply_options(GtkWidget *);
 #endif
index c439c18d03bac9e9dd0d94b1e33d8561e982555d..05707cd16957eeffe537b9fe68f9dc55a5daa446 100644 (file)
@@ -151,7 +151,7 @@ void *engine_thread_entry(void *engine_void) {
        
 #ifdef USE_JACK
        /* Create the client now, so the user has something to connect to. */
-       tX_jack_client *jack_client=tX_jack_client::get_instance();
+       tX_jack_client::get_instance();
 #endif 
        
        engine->loop();
index 37f6740162212a34e9da8ac503e669d076fa222a..2a24cb8235a0c76c02e222d3d0f56c32db3621aa 100644 (file)
@@ -29,7 +29,8 @@ tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, tX_seqpar * sp, bool t
        f2s();
        if (l) label=gtk_label_new(l);
        dial=gtk_tx_dial_new(adj);
-       entry=gtk_entry_new_with_max_length(5);
+       entry=gtk_entry_new();
+       gtk_entry_set_max_length(GTK_ENTRY(entry), 5);
        gtk_entry_set_text(GTK_ENTRY(entry), sval);
        ignore_adj=0;
        
@@ -51,14 +52,13 @@ tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, tX_seqpar * sp, bool t
        gtk_widget_show(mainbox);
        gtk_widget_show(eventbox);
        
-       gtk_signal_connect(GTK_OBJECT(entry), "activate", (GtkSignalFunc) tX_extdial::f_entry, (void *) this);
-       gtk_signal_connect(GTK_OBJECT(adj), "value_changed", (GtkSignalFunc) tX_extdial::f_adjustment, (void *) this);
+       g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(tX_extdial::f_entry), (void *) this);
+       g_signal_connect(G_OBJECT(adj), "value_changed", G_CALLBACK(tX_extdial::f_adjustment), (void *) this);
        
        if (sp) {
-               gtk_signal_connect(GTK_OBJECT(dial), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);
-               gtk_signal_connect(GTK_OBJECT(entry), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);                    
-               gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);                 
-               //if (l) gtk_signal_connect(GTK_OBJECT(label), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);   
+               g_signal_connect(G_OBJECT(dial), "button_press_event", G_CALLBACK(tX_seqpar::tX_seqpar_press), sp);
+               g_signal_connect(G_OBJECT(entry), "button_press_event", G_CALLBACK(tX_seqpar::tX_seqpar_press), sp);                    
+               g_signal_connect(G_OBJECT(eventbox), "button_press_event", G_CALLBACK(tX_seqpar::tX_seqpar_press), sp);                 
        }
 }
 
index c7a552444bdeeceb1099ca41062ecdd38e447728..fc60d0c5c48435fc1061e6ebfff03800e910ec8e 100644 (file)
@@ -66,51 +66,48 @@ static gint gtk_tx_flash_expose (GtkWidget *widget, GdkEventExpose *event);
 
 static GtkWidgetClass *parent_class = NULL;
 
-guint
-gtk_tx_flash_get_type ()
+GType gtk_tx_flash_get_type ()
 {
-  static guint tx_flash_type = 0;
-
-  if (!tx_flash_type)
-    {
-      GtkTypeInfo tx_flash_info =
-      {
-       "GtkTxFlash",
-       sizeof (GtkTxFlash),
-       sizeof (GtkTxFlashClass),
-       (GtkClassInitFunc) gtk_tx_flash_class_init,
-       (GtkObjectInitFunc) gtk_tx_flash_init,
-       /* reserved */ NULL,
-       /* reserved */ NULL,
-       /* reserved */ NULL
-      };
-
-      tx_flash_type = gtk_type_unique (gtk_widget_get_type (), &tx_flash_info);
+       static GType tx_flash_type = 0;
+
+       if (!tx_flash_type) {
+               static const GTypeInfo tx_flash_info = {
+                       sizeof (GtkTxFlashClass),
+                       NULL,
+                       NULL,
+                       (GClassInitFunc) gtk_tx_flash_class_init, 
+                       NULL,
+                       NULL,
+                       sizeof (GtkTxFlash),
+               0,
+                       (GInstanceInitFunc) gtk_tx_flash_init,
+               };
+
+               tx_flash_type = g_type_register_static(GTK_TYPE_WIDGET, "GtkTxFlash", &tx_flash_info, 0);
     }
-
-  return tx_flash_type;
+       
+       return tx_flash_type;
 }
 
-static void
-gtk_tx_flash_class_init (GtkTxFlashClass *gclass)
+static void gtk_tx_flash_class_init (GtkTxFlashClass *gclass)
 {
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
-
-  object_class = (GtkObjectClass*) gclass;
-  widget_class = (GtkWidgetClass*) gclass;
-
-  parent_class = gtk_type_class (gtk_widget_get_type ());
-
-  object_class->destroy = gtk_tx_flash_destroy;
-
-  widget_class->realize = gtk_tx_flash_realize;
-  widget_class->expose_event = gtk_tx_flash_expose;
-  widget_class->size_request = gtk_tx_flash_size_request;
-  widget_class->size_allocate = gtk_tx_flash_size_allocate;
-//  widget_class->button_press_event = gtk_tx_flash_button_press;
-//  widget_class->button_release_event = gtk_tx_flash_button_release;
-//  widget_class->motion_notify_event = gtk_tx_flash_motion_notify;
+       GtkObjectClass *object_class;
+       GtkWidgetClass *widget_class;
+       
+       object_class = (GtkObjectClass*) gclass;
+       widget_class = (GtkWidgetClass*) gclass;
+       
+       parent_class = gtk_type_class (gtk_widget_get_type ());
+       
+       object_class->destroy = gtk_tx_flash_destroy;
+       
+       widget_class->realize = gtk_tx_flash_realize;
+       widget_class->expose_event = gtk_tx_flash_expose;
+       widget_class->size_request = gtk_tx_flash_size_request;
+       widget_class->size_allocate = gtk_tx_flash_size_allocate;
+       //widget_class->button_press_event = gtk_tx_flash_button_press;
+       //widget_class->button_release_event = gtk_tx_flash_button_release;
+       //widget_class->motion_notify_event = gtk_tx_flash_motion_notify;
 }
 
 enum {
@@ -152,8 +149,7 @@ void gtk_tx_flash_update_colors(GtkTxFlash *tx)
        tx->colors_allocated=1;
 }
 
-static void
-gtk_tx_flash_init (GtkTxFlash *tx_flash)
+static void gtk_tx_flash_init (GtkTxFlash *tx_flash)
 {
        GdkColormap *priv;
        
@@ -164,70 +160,61 @@ gtk_tx_flash_init (GtkTxFlash *tx_flash)
        gtk_tx_flash_update_colors(tx_flash);
 }
 
-GtkWidget*
-gtk_tx_flash_new ()
+GtkWidget* gtk_tx_flash_new ()
 {
-  GtkTxFlash *tx_flash;
-
-  tx_flash = gtk_type_new (gtk_tx_flash_get_type ());
-
-  return GTK_WIDGET (tx_flash);
+       GtkTxFlash *tx_flash;
+       
+       tx_flash = (GtkTxFlash *)g_object_new(gtk_tx_flash_get_type (), NULL);  
+       return GTK_WIDGET (tx_flash);
 }
 
-static void
-gtk_tx_flash_destroy (GtkObject *object)
+static void gtk_tx_flash_destroy (GtkObject *object)
 {
-  g_return_if_fail (object != NULL);
-  g_return_if_fail (GTK_IS_TX_FLASH (object));
-
-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+       g_return_if_fail (object != NULL);
+       g_return_if_fail (GTK_IS_TX_FLASH (object));
+       
+       if (GTK_OBJECT_CLASS (parent_class)->destroy)
+               (*GTK_OBJECT_CLASS (parent_class)->destroy) (object);
 }
 
-static void
-gtk_tx_flash_realize (GtkWidget *widget)
+static void gtk_tx_flash_realize (GtkWidget *widget)
 {
-  GtkTxFlash *tx_flash;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX_FLASH (widget));
-
-  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-  tx_flash = GTK_TX_FLASH (widget);
-
-  attributes.x = widget->allocation.x;
-  attributes.y = widget->allocation.y;
-  attributes.width = widget->allocation.width;
-  attributes.height = widget->allocation.height;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = gtk_widget_get_events (widget) | 
-    GDK_EXPOSURE_MASK;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.colormap = gtk_widget_get_colormap (widget);
-  
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
-
-  widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
-
-  widget->style = gtk_style_attach (widget->style, widget->window);
-
-  gdk_window_set_user_data (widget->window, widget);
-
-  gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+       GtkTxFlash *tx_flash;
+       GdkWindowAttr attributes;
+       gint attributes_mask;
+       
+       g_return_if_fail (widget != NULL);
+       g_return_if_fail (GTK_IS_TX_FLASH (widget));
+       
+       GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+       tx_flash = GTK_TX_FLASH (widget);
+       
+       attributes.x = widget->allocation.x;
+       attributes.y = widget->allocation.y;
+       attributes.width = widget->allocation.width;
+       attributes.height = widget->allocation.height;
+       attributes.wclass = GDK_INPUT_OUTPUT;
+       attributes.window_type = GDK_WINDOW_CHILD;
+       attributes.event_mask = gtk_widget_get_events (widget) | 
+               GDK_EXPOSURE_MASK;
+       attributes.visual = gtk_widget_get_visual (widget);
+       attributes.colormap = gtk_widget_get_colormap (widget);
+       attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+       
+       widget->window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
+       widget->style = gtk_style_attach (widget->style, widget->window);
+       
+       gdk_window_set_user_data (widget->window, widget);
+       gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
 }
 
-static void 
-gtk_tx_flash_size_request (GtkWidget *widget, GtkRequisition *requisition)
+static void gtk_tx_flash_size_request(GtkWidget *widget, GtkRequisition *requisition)
 {
        requisition->width = TX_FLASH_DEFAULT_SIZE_X;
        requisition->height = TX_FLASH_DEFAULT_SIZE_Y;
 }
 
-static void
-gtk_tx_flash_prepare (GtkWidget *widget)
+static void gtk_tx_flash_prepare(GtkWidget *widget)
 {
        GtkTxFlash *tx_flash;
 
@@ -246,195 +233,159 @@ gtk_tx_flash_prepare (GtkWidget *widget)
        tx_flash->max=0;
 }
 
-static void
-gtk_tx_flash_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+static void gtk_tx_flash_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
 {
-  GtkTxFlash *tx_flash;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX_FLASH (widget));
-  g_return_if_fail (allocation != NULL);
-
-  widget->allocation = *allocation;
-
-  gtk_tx_flash_prepare(widget);
-
-  if (GTK_WIDGET_REALIZED (widget))
-    {
-      tx_flash = GTK_TX_FLASH (widget);
-
-      gdk_window_move_resize (widget->window,
-                             allocation->x, allocation->y,
-                             allocation->width, allocation->height);
-
-    }
+       GtkTxFlash *tx_flash;
+       
+       g_return_if_fail (widget != NULL);
+       g_return_if_fail (GTK_IS_TX_FLASH (widget));
+       g_return_if_fail (allocation != NULL);
+       
+       widget->allocation = *allocation;
+       
+       gtk_tx_flash_prepare(widget);
+       
+       if (GTK_WIDGET_REALIZED (widget)) {
+               tx_flash = GTK_TX_FLASH (widget);
+               
+               gdk_window_move_resize (widget->window,
+                                 allocation->x, allocation->y,
+                                 allocation->width, allocation->height);
+       }
 }
 
 static void gtk_tx_flash_paint_yourself(GtkWidget *widget)
 {
-  GtkTxFlash *tx_flash;
-  gint i, x11, x12,x21, x22, y;
-  int long_level;
-
-  tx_flash = GTK_TX_FLASH (widget);
-
-  gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
-  
-  gdk_draw_rectangle(widget->window, widget->style->fg_gc[widget->state], 1, 0, 0, widget->allocation.width,widget->allocation.height); 
-
-  gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM_HALF]);
-
-  x12=DMINIX+S_MINIX;
-  x21=widget->allocation.width-1-x12;
-
-  for (i=0, y=widget->allocation.height-DY; i<=tx_flash->levels; y-=DLEVEL, i++)
-  {
-       if (i==0)
-       {
-               long_level=1;
-       }
-       else if (i==tx_flash->red_level-1)
-       {
-               long_level=1;
-       }
-       else if (i==tx_flash->red_level)
-       {
-               long_level=1;
-               gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_LOUD_HALF]);
-       }
-       else if (i==tx_flash->levels)
-       {
-               long_level=1;
-       }
-       else long_level=0;
+       GtkTxFlash *tx_flash;
+       gint i, x11, x12,x21, x22, y;
+       int long_level;
        
-       if (long_level)
-       {
-               x11=x12-L_MINIX;
-               x22=x21+L_MINIX;
-       }
-       else
-       {
-               x11=x12-S_MINIX;
-               x22=x21+S_MINIX;                
-       }
+       tx_flash = GTK_TX_FLASH (widget);
+       
+       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
+       
+       gdk_draw_rectangle(widget->window, widget->style->fg_gc[widget->state], 1, 0, 0, widget->allocation.width,widget->allocation.height); 
+       
+       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM_HALF]);
        
-       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], x11, y, x12, y);
-       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], x21, y, x22, y);
-  }
+       x12=DMINIX+S_MINIX;
+       x21=widget->allocation.width-1-x12;
+       
+       for (i=0, y=widget->allocation.height-DY; i<=tx_flash->levels; y-=DLEVEL, i++) {
+               if (i==0) {
+                       long_level=1;
+               } else if (i==tx_flash->red_level-1) {
+                       long_level=1;
+               } else if (i==tx_flash->red_level) {
+                       long_level=1;
+                       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_LOUD_HALF]);
+               } else if (i==tx_flash->levels) {
+                       long_level=1;
+               } else long_level=0;
+               
+               if (long_level) {
+                       x11=x12-L_MINIX;
+                       x22=x21+L_MINIX;
+               } else {
+                       x11=x12-S_MINIX;
+                       x22=x21+S_MINIX;                
+               }
+               
+               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], x11, y, x12, y);
+               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], x21, y, x22, y);
+       }
 }
 
 static gint gtk_tx_flash_expose (GtkWidget *widget, GdkEventExpose *event)
 {
-
-  g_return_val_if_fail (widget != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_TX_FLASH (widget), FALSE);
-  g_return_val_if_fail (event != NULL, FALSE);
-
-  if (event->count > 0)
-    return FALSE;
-
-  gtk_tx_flash_prepare(widget);
-  gtk_tx_flash_paint_yourself(widget);  
-
-  return FALSE;
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (GTK_IS_TX_FLASH (widget), FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       if (event->count > 0)
+               return FALSE;
+       
+       gtk_tx_flash_prepare(widget);
+       gtk_tx_flash_paint_yourself(widget);  
+       
+       return FALSE;
 } 
 
-void
-gtk_tx_flash_set_level(GtkWidget *widget, f_prec new_value)
+void gtk_tx_flash_set_level(GtkWidget *widget, f_prec new_value)
 {
-  GtkTxFlash *tx_flash;
-  gint i, y;
-  int new_level;
-  int red=0;
-
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_TX_FLASH (widget));
-
-  tx_flash = GTK_TX_FLASH (widget);
-
-  new_level=(int) (new_value/tx_flash->level_value);
-  
-  if (new_level>tx_flash->levels) new_level=tx_flash->levels;
-  
-//  printf ("%f, %i, %i\n", tx_flash->level_value,new_level, tx_flash->last_level);
-  
-
-  if (new_level>tx_flash->max)
-  {
-       tx_flash->max=new_level;
-       tx_flash->max_cycles=MAX_MAX_CYCLES;
-  }
-  else
-  {
-       tx_flash->max_cycles--;
-  }
-  
-  if (tx_flash->max_cycles <= 0)
-  {    
-       y=widget->allocation.height-(DY+(tx_flash->max)*DLEVEL);
-       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
-       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
-
-       if (tx_flash->max>0)
-       {
-               tx_flash->max--;
-               y+=DLEVEL;
-               if (tx_flash->max>tx_flash->red_level)
-               {
-                       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_LOUD]);
-               }
-               else
-               {
-                       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM]);
-               }
-               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);   
+       GtkTxFlash *tx_flash;
+       gint i, y;
+       int new_level;
+       int red=0;
+       
+       g_return_if_fail (widget != NULL);
+       g_return_if_fail (GTK_IS_TX_FLASH (widget));
+       
+       tx_flash = GTK_TX_FLASH (widget);
+       
+       new_level=(int) (new_value/tx_flash->level_value);
+       
+       if (new_level>tx_flash->levels) 
+               new_level=tx_flash->levels;
+       
+       if (new_level>tx_flash->max) {
+               tx_flash->max=new_level;
+               tx_flash->max_cycles=MAX_MAX_CYCLES;
+       } else {
+               tx_flash->max_cycles--;
        }
-  }
-
-  if (new_level==tx_flash->last_level) return;
-
-  if (new_level<tx_flash->last_level) // make it look more realistic
-  {
-       new_level=tx_flash->last_level*globals.flash_response;
-  }
-  
-  if (new_level>tx_flash->last_level)
-  {
-         gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM]);
-  
-         for (i=tx_flash->last_level, y=widget->allocation.height-(DY+tx_flash->last_level*DLEVEL); i<=new_level; y-=DLEVEL, i++)
-         {
-               if (!red)
-               {
-                       if (i>=tx_flash->red_level)
-                       {
+       
+       if (tx_flash->max_cycles <= 0) {
+               y=widget->allocation.height-(DY+(tx_flash->max)*DLEVEL);
+               gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
+               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
+               
+               if (tx_flash->max>0) {
+                       tx_flash->max--;
+                       y+=DLEVEL;
+                       if (tx_flash->max>tx_flash->red_level) {
                                gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_LOUD]);
-                               red=1;
+                       } else {
+                               gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM]);
                        }
+                       
+                       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);   
                }
-               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
-         }
-  }
-  else
-  {
-         gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
-
-         if (tx_flash->last_level==tx_flash->max)
-         {
-               i=tx_flash->last_level-1;
-         }
-         else
-         {
-               i=tx_flash->last_level;
-         }
-
-         for (y=widget->allocation.height-(DY+i*DLEVEL); i>new_level; y+=DLEVEL, i--)
-         {
-               gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
-         }
-  }
-  tx_flash->last_level=new_level;
+       }
+       
+       if (new_level==tx_flash->last_level) 
+               return;
+       
+       if (new_level<tx_flash->last_level) {
+               new_level=tx_flash->last_level*globals.flash_response;
+       }
+       
+       if (new_level>tx_flash->last_level) {
+               gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_NORM]);
+               
+               for (i=tx_flash->last_level, y=widget->allocation.height-(DY+tx_flash->last_level*DLEVEL); i<=new_level; y-=DLEVEL, i++) {
+                       if (!red) {
+                               if (i>=tx_flash->red_level) {
+                                       gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_LOUD]);
+                                       red=1;
+                               }
+                       }
+                       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
+               }
+       } else {
+               gdk_gc_set_foreground(widget->style->fg_gc[widget->state], &tx_flash->colors[COL_BG]);
+               
+               if (tx_flash->last_level==tx_flash->max) {
+                       i=tx_flash->last_level-1;
+               } else {
+                       i=tx_flash->last_level;
+               }
+               
+               for (y=widget->allocation.height-(DY+i*DLEVEL); i>new_level; y+=DLEVEL, i--) {
+                       gdk_draw_line(widget->window, widget->style->fg_gc[widget->state], tx_flash->x1, y, tx_flash->x2, y);
+               }
+       }
+       tx_flash->last_level=new_level;
 }
 
 void
index d893750575ec0836ef91f0e5f045583902d9835e..16ed9bb77af465b19ec83b7e1ac1d7a5b22f9832 100644 (file)
@@ -34,15 +34,14 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-#define GTK_TX_FLASH(obj)          GTK_CHECK_CAST (obj, gtk_tx_flash_get_type (), GtkTxFlash)
-#define GTK_TX_FLASH_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_tx_flash_get_type (), GtkTxFlashClass)
-#define GTK_IS_TX_FLASH(obj)       GTK_CHECK_TYPE (obj, gtk_tx_flash_get_type ())
+#define GTK_TX_FLASH(obj) GTK_CHECK_CAST (obj, gtk_tx_flash_get_type(), GtkTxFlash)
+#define GTK_TX_FLASH_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_tx_flash_get_type(), GtkTxFlashClass)
+#define GTK_IS_TX_FLASH(obj) GTK_CHECK_TYPE (obj, gtk_tx_flash_get_type())
 
-typedef struct _GtkTxFlash        GtkTxFlash;
-typedef struct _GtkTxFlashClass   GtkTxFlashClass;
+typedef struct _GtkTxFlash GtkTxFlash;
+typedef struct _GtkTxFlashClass GtkTxFlashClass;
 
-struct _GtkTxFlash
-{
+struct _GtkTxFlash {
        GtkWidget widget;
 
        GdkColor colors[5];     
@@ -58,16 +57,15 @@ struct _GtkTxFlash
        int max, max_cycles;
 };
 
-struct _GtkTxFlashClass
-{
+struct _GtkTxFlashClass {
        GtkWidgetClass parent_class;
 };
 
-GtkWidget*     gtk_tx_flash_new        ();
-guint         gtk_tx_flash_get_type (void);
-void           gtk_tx_flash_set_level (GtkWidget *widget, f_prec new_value);
-void           gtk_tx_flash_clear (GtkWidget *widget);
-void              gtk_tx_flash_update_colors(GtkTxFlash *tx);
+GtkWidget* gtk_tx_flash_new();
+GType gtk_tx_flash_get_type (void);
+void gtk_tx_flash_set_level (GtkWidget *widget, f_prec new_value);
+void gtk_tx_flash_clear (GtkWidget *widget);
+void gtk_tx_flash_update_colors(GtkTxFlash *tx);
 
 #ifdef __cplusplus
 }
index c6533253e486302f1f0726f2352bffc965dfe01e..00a71b7f83c9f2b9292ea7aafabba643aa164173 100644 (file)
@@ -248,6 +248,8 @@ create_tx_options (void)
   GtkWidget *compress_set_files;
   GtkWidget *label40;
   GtkWidget *reconnect_enabled;
+  GtkWidget *label57;
+  GtkWidget *quit_confirm;
   GtkWidget *label3;
   GtkWidget *dialog_action_area3;
   GtkWidget *pref_reset;
@@ -881,7 +883,7 @@ create_tx_options (void)
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 6), label52);
   gtk_label_set_justify (GTK_LABEL (label52), GTK_JUSTIFY_LEFT);
 
-  table3 = gtk_table_new (5, 2, FALSE);
+  table3 = gtk_table_new (6, 2, FALSE);
   gtk_widget_show (table3);
   gtk_container_add (GTK_CONTAINER (notebook1), table3);
   gtk_container_set_border_width (GTK_CONTAINER (table3), 4);
@@ -961,6 +963,20 @@ create_tx_options (void)
                     (GtkAttachOptions) (0), 0, 0);
   gtk_tooltips_set_tip (tooltips, reconnect_enabled, "When enabled soundfiles will be playedback when selected in a file dialog (before loading them).", NULL);
 
+  label57 = gtk_label_new ("Ask for \"Quit\" confirmation:");
+  gtk_widget_show (label57);
+  gtk_table_attach (GTK_TABLE (table3), label57, 0, 1, 5, 6,
+                    (GtkAttachOptions) (GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+  gtk_label_set_justify (GTK_LABEL (label57), GTK_JUSTIFY_LEFT);
+  gtk_misc_set_alignment (GTK_MISC (label57), 0, 0.5);
+
+  quit_confirm = gtk_check_button_new_with_mnemonic ("Enabled");
+  gtk_widget_show (quit_confirm);
+  gtk_table_attach (GTK_TABLE (table3), quit_confirm, 1, 2, 5, 6,
+                    (GtkAttachOptions) (GTK_FILL),
+                    (GtkAttachOptions) (0), 0, 0);
+
   label3 = gtk_label_new ("Misc");
   gtk_widget_show (label3);
   gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 7), label3);
@@ -1140,6 +1156,8 @@ create_tx_options (void)
   GLADE_HOOKUP_OBJECT (tx_options, compress_set_files, "compress_set_files");
   GLADE_HOOKUP_OBJECT (tx_options, label40, "label40");
   GLADE_HOOKUP_OBJECT (tx_options, reconnect_enabled, "reconnect_enabled");
+  GLADE_HOOKUP_OBJECT (tx_options, label57, "label57");
+  GLADE_HOOKUP_OBJECT (tx_options, quit_confirm, "quit_confirm");
   GLADE_HOOKUP_OBJECT (tx_options, label3, "label3");
   GLADE_HOOKUP_OBJECT_NO_REF (tx_options, dialog_action_area3, "dialog_action_area3");
   GLADE_HOOKUP_OBJECT (tx_options, pref_reset, "pref_reset");
index db22059dfd21b343b4281007acc18375c5211148..477f749e69f286aa5225e38bd303ba7a2609b234 100644 (file)
@@ -155,6 +155,7 @@ void set_global_defaults() {
        strcpy(globals.vu_meter_loud, "#FF0000");
        strcpy(globals.vu_meter_normal, "#00FF00");     
        globals.vu_meter_border_intensity=0.7;
+       globals.quit_confirm=1;
 }
 
 int load_globals_xml() {
@@ -251,6 +252,8 @@ int load_globals_xml() {
                        
                        restore_float("vu_meter_border_intensity", globals.vu_meter_border_intensity);
 
+                       restore_int("quit_confirm", globals.quit_confirm);
+
 #ifdef USE_ALSA_MIDI_IN
                        if (!elementFound && (xmlStrcmp(cur->name, (xmlChar *) "midi_connections")==0)) {
                                if (globals.restore_midi_connections) {
@@ -352,7 +355,6 @@ void store_globals() {
                store_string("last_path", globals.current_path);
                store_int("restore_midi_connections", globals.restore_midi_connections);
 
-
                store_string("wav_display_bg_focus", globals.wav_display_bg_focus);
                store_string("wav_display_bg_no_focus", globals.wav_display_bg_no_focus);
                store_string("wav_display_fg_focus", globals.wav_display_fg_focus);
@@ -366,6 +368,8 @@ void store_globals() {
                        
                store_float("vu_meter_border_intensity", globals.vu_meter_border_intensity);
 
+               store_int("quit_confirm", globals.quit_confirm);
+               
 #ifdef USE_ALSA_MIDI_IN
                tX_midiin_store_connections(rc, indent);
 #endif         
index 4d51db43c1c176b189c318ccfd1bab9c64cf9f96..c701aa2c5218a8d9c2d213e8b546b1ca96cd6bae 100644 (file)
@@ -161,6 +161,7 @@ typedef struct {
        char vu_meter_normal[8];
        double vu_meter_border_intensity;
        
+       int quit_confirm;
 } tx_global;
 
 extern tx_global globals;
index 3641407a8400ebd84dfff20680574a3c227bf3c8..96ac333c4aeb30d0bc4116be27b5525b7b7eb520 100644 (file)
@@ -182,22 +182,18 @@ char ** knob_pixs[MAX_KNOB_PIX]={
         knob49_xpm,     
        };
 
-GdkPixmap *knob_pixmaps[MAX_KNOB_PIX];
+GdkPixbuf *knob_pixmaps[MAX_KNOB_PIX];
 GdkBitmap *knob_mask;
-
-void load_knob_pixs(GtkWidget *wid_for_style)
+       
+void load_knob_pixs()
 {
        int i;
-       GtkStyle *style;
-       
-       style = gtk_widget_get_style(wid_for_style);
-       
-       for (i=0; i<MAX_KNOB_PIX; i++)
-       {
-               knob_pixmaps[i]=gdk_pixmap_create_from_xpm_d(wid_for_style->window, &knob_mask,
-                                        &style->bg[GTK_STATE_NORMAL],
-                                        (gchar **) knob_pixs[i]);
+
+       for (i=0; i<MAX_KNOB_PIX; i++) {
+               knob_pixmaps[i]=gdk_pixbuf_new_from_xpm_data((const char **) knob_pixs[i]);
        }
+       
+       gdk_pixbuf_render_pixmap_and_mask(knob_pixmaps[0], NULL, &knob_mask, 1);
 }
 
 #endif
index 3080842a3be1eb7812bd81f701e0cae5a7c691b6..b3f232383b02dd21eb9b9be685ff80d3bf36e893 100644 (file)
@@ -46,9 +46,10 @@ extern "C" {
 #define KNOB_SIZE 31
 #endif
 
-extern GdkPixmap *knob_pixmaps[MAX_KNOB_PIX];
+extern GdkPixbuf *knob_pixmaps[MAX_KNOB_PIX];
 extern GdkBitmap *knob_mask;
-extern void load_knob_pixs(GtkWidget *);
+       
+extern void load_knob_pixs();
 
 #ifdef __cplusplus
 }
index b5d91885d4cb1c9f29b5bd1df396fb33f6cfda62..30376f2b37592d6faea0fabf89f2fc036c4d59d7 100644 (file)
@@ -302,14 +302,14 @@ GtkWidget * LADSPA_Class :: get_menu() {
                        item=gtk_menu_item_new_with_label(c->label);
                        GtkWidget *submenu=c->get_menu();
                        gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_show(item);
                }
        }
        
        if (subclasses.size() && plugins.size()) {
                item = gtk_menu_item_new();
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_set_sensitive (item, FALSE);
                gtk_widget_show (item);
        }
@@ -322,8 +322,8 @@ GtkWidget * LADSPA_Class :: get_menu() {
                
                sprintf(buffer, "%s - (%s, %li)", p->getName(), p->getLabel(), p->getUniqueID());
                item=gtk_menu_item_new_with_label(buffer);
-               gtk_menu_append(menu, item);
-               gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(menu_callback), p);            
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+               g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(menu_callback), p);             
                gtk_widget_show(item);
        }
        
index 865898e42acd64b9b4dfabefdbb5b46467a0c342..d2f369aea0afbaae6e04612fd8907844004d0355 100644 (file)
@@ -160,7 +160,7 @@ void ld_set_filename(char *name)
        if (ld_mode==TX_LOADDLG_MODE_MULTI)
        {
                setprog=(((float) ld_current)/((float) ld_count));
-               gtk_progress_bar_update(GTK_PROGRESS_BAR(ld_multi_p), setprog);
+               gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ld_multi_p), setprog);
                gtk_flush();            
        }
        gtk_flush();
@@ -174,7 +174,7 @@ void ld_set_progress(gfloat progress)
        
        if (progress!=ld_old_prog)
        {
-               gtk_progress_bar_update(GTK_PROGRESS_BAR(ld_single_p), progress);
+               gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(ld_single_p), progress);
                
                gtk_flush();
        }
index b31ac6548b10de9ad6d95fcedf9379fd0ebc1ffd..6297672d77d96a2959394aa842a2cb8306ade8dc 100644 (file)
@@ -99,9 +99,9 @@ GtkWidget *fullscreen_item;
 int rec_dont_care=0;
 gint update_tag;
 
-#define connect_entry(wid, func, ptr); gtk_signal_connect(GTK_OBJECT(wid), "activate", (GtkSignalFunc) func, (void *) ptr);
-#define connect_adj(wid, func, ptr); gtk_signal_connect(GTK_OBJECT(wid), "value_changed", (GtkSignalFunc) func, (void *) ptr);
-#define connect_button(wid, func, ptr); gtk_signal_connect(GTK_OBJECT(wid), "clicked", (GtkSignalFunc) func, (void *) ptr);
+#define connect_entry(wid, func, ptr); g_signal_connect(G_OBJECT(wid), "activate", (GtkSignalFunc) func, (void *) ptr);
+#define connect_adj(wid, func, ptr); g_signal_connect(G_OBJECT(wid), "value_changed", (GtkSignalFunc) func, (void *) ptr);
+#define connect_button(wid, func, ptr); g_signal_connect(G_OBJECT(wid), "clicked", (GtkSignalFunc) func, (void *) ptr);
 
 Window xwindow;
 #define WID_DYN TRUE, TRUE, 0
@@ -228,14 +228,14 @@ void mg_update_status()
                                found=1;
                                sscanf(buffer, "VmSize: %i kB", &mem);
                                sprintf(buffer, "%i", mem);
-                               gtk_label_set(GTK_LABEL(used_mem), buffer);
+                               gtk_label_set_text(GTK_LABEL(used_mem), buffer);
                        }
                }
        }
        fclose(procfs); 
        
        sprintf(buffer, "%i", vtt_class::vtt_amount);
-       gtk_label_set(GTK_LABEL(no_of_vtts), buffer);
+       gtk_label_set_text(GTK_LABEL(no_of_vtts), buffer);
 }
 
 GtkSignalFunc new_table(GtkWidget *, char *fn)
@@ -312,11 +312,12 @@ GtkSignalFunc cancel_load_tables(GtkWidget *wid)
 
 void load_tt_part(char * buffer)
 {
-       FILE *in;
        char idbuff[256];
        char wbuf[PATH_MAX];
        xmlDocPtr doc;
-       
+#ifdef ENABLE_TX_LEGACY
+       FILE *in;
+#endif 
        turn_audio_off();
        
        strcpy(globals.tables_filename, buffer);
@@ -419,9 +420,9 @@ GtkSignalFunc load_tables()
        
        load_dialog_win=load_dialog->window;
        
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(load_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_tables), NULL);
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(load_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_tables), NULL); 
-       gtk_signal_connect (GTK_OBJECT(load_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_load_tables), NULL);        
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(load_dialog)->ok_button), "clicked", G_CALLBACK(do_load_tables), NULL);
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(load_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_load_tables), NULL);  
+       g_signal_connect (G_OBJECT(load_dialog), "delete-event", G_CALLBACK(cancel_load_tables), NULL); 
        
        return NULL;
 }
@@ -540,9 +541,9 @@ GtkSignalFunc save_tables_as()
        
        save_dialog_win=save_dialog->window;
        
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_save_tables), NULL);
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(save_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_save_tables), NULL); 
-       gtk_signal_connect (GTK_OBJECT(save_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_save_tables), NULL);        
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(save_dialog)->ok_button), "clicked", G_CALLBACK(do_save_tables), NULL);
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(save_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_save_tables), NULL);  
+       g_signal_connect (G_OBJECT(save_dialog), "delete-event", G_CALLBACK(cancel_save_tables), NULL); 
 
        return NULL;
 }
@@ -699,9 +700,9 @@ GtkSignalFunc select_rec_file()
        
        rec_dialog_win=rec_dialog->window;
        
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(rec_dialog)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_rec), NULL);
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(rec_dialog)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_rec), NULL);  
-       gtk_signal_connect (GTK_OBJECT(rec_dialog), "delete-event", GTK_SIGNAL_FUNC(cancel_rec), NULL); 
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(rec_dialog)->ok_button), "clicked", G_CALLBACK(do_rec), NULL);
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(rec_dialog)->cancel_button), "clicked", G_CALLBACK (cancel_rec), NULL);   
+       g_signal_connect (G_OBJECT(rec_dialog), "delete-event", G_CALLBACK(cancel_rec), NULL);  
        
        return NULL;
 }
@@ -741,17 +742,19 @@ void grab_off()
 
 gboolean quit()
 {      
-       GtkWidget *dialog=gtk_message_dialog_new(GTK_WINDOW(main_window), 
-       GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
-       "Exit terminatorX and loose all unsaved data?");
-       
-       int res=gtk_dialog_run(GTK_DIALOG(dialog));
-       gtk_widget_destroy(dialog);
+       if (globals.quit_confirm) {
+               GtkWidget *dialog=gtk_message_dialog_new(GTK_WINDOW(main_window), 
+               GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+               "Exit terminatorX and loose all unsaved data?");
                
-       if (res!=GTK_RESPONSE_YES) {
-               return TRUE;
+               int res=gtk_dialog_run(GTK_DIALOG(dialog));
+               gtk_widget_destroy(dialog);
+                       
+               if (res!=GTK_RESPONSE_YES) {
+                       return TRUE;
+               }
        }
-
+       
        tX_shutdown=true;
        
        turn_audio_off();
@@ -903,6 +906,8 @@ GtkWidget *del_dialog=NULL;
 GCallback menu_delete_all_events(GtkWidget *, void *param)
 {      
        del_dialog=create_tx_del_mode();
+       tX_set_icon(del_dialog);
+       
        GtkWidget *label=lookup_widget(del_dialog, "delmode_label");
        
        menu_del_mode=ALL_EVENTS_ALL_TURNTABLES;
@@ -921,6 +926,8 @@ GCallback menu_delete_all_events_for_vtt(GtkWidget *, vtt_class *vtt)
        char label_str[512];
        
        del_dialog=create_tx_del_mode();
+       tX_set_icon(del_dialog);
+
        del_vtt=vtt;
        GtkWidget *label=lookup_widget(del_dialog, "delmode_label");
        
@@ -929,6 +936,8 @@ GCallback menu_delete_all_events_for_vtt(GtkWidget *, vtt_class *vtt)
        sprintf(label_str, "Delete <b>all</b> events for turntable <b>%s</b>.", vtt->name);
        gtk_label_set_markup(GTK_LABEL(label), label_str);
        gtk_widget_show(del_dialog);
+       
+       return NULL;
 }
 
 GCallback menu_delete_all_events_for_sp(GtkWidget *, tX_seqpar *sp)
@@ -941,6 +950,8 @@ GCallback menu_delete_all_events_for_sp(GtkWidget *, tX_seqpar *sp)
        char label_str[512];
        
        del_dialog=create_tx_del_mode();
+       tX_set_icon(del_dialog);
+       
        GtkWidget *label=lookup_widget(del_dialog, "delmode_label");
        
        menu_del_mode=ALL_EVENTS_FOR_SP;
@@ -948,6 +959,8 @@ GCallback menu_delete_all_events_for_sp(GtkWidget *, tX_seqpar *sp)
        sprintf(label_str, "Delete all <b>%s</b> events for turntable <b>%s</b>.", sp->get_name(), ((vtt_class *) sp->vtt)->name);
        gtk_label_set_markup(GTK_LABEL(label), label_str);
        gtk_widget_show(del_dialog);
+
+       return NULL;
 }
 
 static GtkWidget *table_menu=NULL;
@@ -991,11 +1004,15 @@ GCallback create_table_sequencer_menu(GtkWidget *widget, void *param)
        }
        
        gtk_menu_item_set_submenu(GTK_MENU_ITEM(table_menu_item), table_menu);
+       
+       return NULL;
 }
 
 GCallback toggle_confirm_events(GtkWidget *widget, void *dummy)
 {      
        globals.confirm_events=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
+       
+       return NULL;    
 }
 
 void create_master_menu() 
@@ -1261,7 +1278,8 @@ void create_mastergui(int x, int y)
        gtk_box_pack_start(GTK_BOX(control_box), dummy, WID_FIX);
        gtk_widget_show(dummy);
        
-       dummy=gtk_entry_new_with_max_length(12);
+       dummy=gtk_entry_new();
+       gtk_entry_set_max_length(GTK_ENTRY(dummy), 12);
        seq_entry=dummy;
        //gtk_widget_set_usize(dummy, 65, 20);
        gtk_entry_set_text(GTK_ENTRY(dummy), "00:00.00");
@@ -1273,9 +1291,9 @@ void create_mastergui(int x, int y)
        seq_adj=dumadj;
        connect_adj(dumadj, sequencer_move, NULL);      
        dummy=gtk_hscale_new(dumadj);
-       gtk_widget_set_usize(dummy, 65, 20);
+       gtk_widget_set_size_request(dummy, 65, 20);
        seq_slider=dummy;
-       gtk_signal_connect(GTK_OBJECT(seq_slider), "button-release-event", (GtkSignalFunc) seq_slider_released, NULL);
+       g_signal_connect(G_OBJECT(seq_slider), "button-release-event", (GtkSignalFunc) seq_slider_released, NULL);
        gtk_scale_set_draw_value(GTK_SCALE(dummy), FALSE);
        
        gui_set_tooltip(dummy, "Select the start position for the sequencer in song-time.");
@@ -1353,7 +1371,7 @@ void create_mastergui(int x, int y)
        dummy=gtk_vscale_new(dumadj);
        gtk_range_set_inverted(GTK_RANGE(dummy), TRUE);
        gtk_scale_set_draw_value(GTK_SCALE(dummy), False);
-       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &sp_master_volume);     
+       g_signal_connect(G_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &sp_master_volume); 
        
        gtk_box_pack_end(GTK_BOX(master_vol_box), dummy, WID_FIX);
        gtk_widget_show(dummy); 
@@ -1432,7 +1450,7 @@ void create_mastergui(int x, int y)
 
        new_table(NULL, NULL); // to give the user something to start with ;)
 
-       gtk_signal_connect (GTK_OBJECT(main_window), "delete-event", (GtkSignalFunc) quit, NULL);       
+       g_signal_connect (G_OBJECT(main_window), "delete-event", (GtkSignalFunc) quit, NULL);   
        
        if (globals.tooltips) gtk_tooltips_enable(gui_tooltips);
        else gtk_tooltips_disable(gui_tooltips);
@@ -1540,8 +1558,8 @@ void display_mastergui()
 {
        GtkWidget *top;
        gtk_widget_realize(main_window);
-       tX_set_icon(main_window, "terminatorX");
-       load_knob_pixs(main_window);
+       tX_set_icon(main_window);
+       load_knob_pixs();
        gtk_widget_show(main_window);
        fullscreen_setup();     
        top=gtk_widget_get_toplevel(main_window);
index cc95ee4325b46486148efd709c5eb2a7d404be06..5a2cb2f6208c5537f5dc03a04b31ed9aeea4ce52 100644 (file)
@@ -33,6 +33,7 @@
 #include "tX_vtt.h"
 #include "tX_glade_interface.h"
 #include "tX_glade_support.h"
+#include "tX_dialog.h"
 
 #ifdef USE_ALSA_MIDI_IN
 #include "tX_global.h"
@@ -297,10 +298,10 @@ tX_midiin::midi_binding_gui::midi_binding_gui ( GtkTreeModel* _model, tX_midiin*
        gtk_widget_show (close_button);
        gtk_box_pack_start (GTK_BOX (vbox1), close_button, FALSE, FALSE, 0);
        
-       gtk_signal_connect(GTK_OBJECT(bind_button), "clicked", (GtkSignalFunc) bind_clicked, (void *) this);
-       gtk_signal_connect(GTK_OBJECT(unbind_button), "clicked", (GtkSignalFunc) unbind_clicked, (void *) this);        
-       gtk_signal_connect(GTK_OBJECT(close_button), "clicked", (GtkSignalFunc) close_clicked, (void *) this);
-       gtk_signal_connect(GTK_OBJECT(window), "destroy", (GtkSignalFunc) close_clicked, (void *) this);
+       g_signal_connect(G_OBJECT(bind_button), "clicked", (GtkSignalFunc) bind_clicked, (void *) this);
+       g_signal_connect(G_OBJECT(unbind_button), "clicked", (GtkSignalFunc) unbind_clicked, (void *) this);    
+       g_signal_connect(G_OBJECT(close_button), "clicked", (GtkSignalFunc) close_clicked, (void *) this);
+       g_signal_connect(G_OBJECT(window), "destroy", (GtkSignalFunc) close_clicked, (void *) this);
        
        timer_tag = gtk_timeout_add( 100, (GtkFunction) timer, (void *) this);
        
@@ -408,6 +409,7 @@ void tX_midiin::set_midi_learn_sp(tX_seqpar *sp)
        if (!sp_to_learn) return;
        
        learn_dialog=create_tX_midilearn();
+       tX_set_icon(learn_dialog);
        GtkWidget *label=lookup_widget(learn_dialog, "midilabel");
        
        sprintf(buffer, "Learning MIDI mapping for <b>%s</b>\nfor turntable <b>%s</b>.\n\nWaiting for MIDI event...", sp->get_name(), sp->get_vtt_name());
@@ -437,7 +439,7 @@ gboolean tX_midiin::midi_learn_destroy(GtkWidget *widget, tX_midiin *midi)
 
 void tX_midiin::store_connections(FILE *rc, char *indent) 
 {
-       gzFile *rz;
+       gzFile *rz=NULL;
        
        tX_store("%s<midi_connections>\n", indent);
        strcat(indent, "\t");
index 76728606e5c886e2e5cd153ec5c0ec5e19599c86..f3d81e57d7a604aa90efb3839c95beeca9de7b6b 100644 (file)
@@ -80,7 +80,7 @@ tX_panel :: tX_panel (const char *name, GtkWidget *par)
        gtk_widget_show(clientframe);   
        gtk_widget_show(mainbox);
        
-       gtk_signal_connect(GTK_OBJECT(minbutton), "clicked", (GtkSignalFunc) tX_panel::minimize, (void *) this);
+       g_signal_connect(G_OBJECT(minbutton), "clicked", (GtkSignalFunc) tX_panel::minimize, (void *) this);
 }
 
 void tX_panel :: add_client_widget(GtkWidget *w)
index 08a4262d057482dc6a768e7f4f8794925481c764..22c5652bd83d6e1dca1919e332124cdf9c0c6791 100644 (file)
@@ -51,24 +51,11 @@ gchar ** tx_icons[]={ tx_audioengine_xpm, tx_power_xpm, tx_grab_xpm,
 
 GtkWidget *tx_pixmap_widget(int icon_id)
 {
-    GtkWidget *pixmapwid;
-    GdkPixmap *pixmap;
-    GdkBitmap *mask;
-    GtkStyle *style;
-
-       // printf("id: %i, addr: %08x\n", icon_id, tx_icons[icon_id]);
-
-    /* Get the style of the button to get the
-     * background color. */
-    style = gtk_widget_get_style(main_window);
+       GdkPixbuf *pixbuf=gdk_pixbuf_new_from_xpm_data((const char **) tx_icons[icon_id]);
+    GtkWidget *widget=gtk_image_new();
+       gtk_image_set_from_pixbuf(GTK_IMAGE(widget), pixbuf);
 
-    /* Now on to the xpm stuff */
-    pixmap = gdk_pixmap_create_from_xpm_d(main_window->window, &mask,
-                                        &style->bg[GTK_STATE_NORMAL],
-                                        (gchar **) tx_icons[icon_id]);
-    pixmapwid = gtk_pixmap_new (pixmap, mask);
-
-    return pixmapwid;
+    return widget;
 }
 
 GtkWidget *tx_xpm_label_box(int        icon_id, gchar *label_text, GtkWidget **labelwidget=(GtkWidget **) NULL)
@@ -118,4 +105,3 @@ extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle, GtkWid
        
        return(button);
 }
-
index 6aa96be2eda1e423b14d612580450afc4eec31b1..4751b75a8a9f7e228bbb48dbccaac0b20be5b834 100644 (file)
@@ -933,7 +933,7 @@ void tX_seqpar_vttfx_float :: create_widget()
        //myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value+tmp/10, max_value-tmp/10, tmp, tmp, tmp));
        myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value, max_value, tmp, tmp, tmp));
        mydial=new tX_extdial(label_name, myadj, this);
-       gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_float :: gtk_callback, this);
+       g_signal_connect(G_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_float :: gtk_callback, this);
        widget = mydial->get_widget();  
 }
 
@@ -973,9 +973,9 @@ void tX_seqpar_vttfx_int :: create_widget()
        tmpwid=gtk_spin_button_new(myadj,1.0,0);
        gtk_widget_show(tmpwid);
        gtk_box_pack_start(GTK_BOX(box), tmpwid, WID_DYN);
-       gtk_signal_connect(GTK_OBJECT(tmpwid), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
+       g_signal_connect(G_OBJECT(tmpwid), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
        
-       gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_int :: gtk_callback, this);
+       g_signal_connect(G_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_int :: gtk_callback, this);
 
     tmpwid=gtk_label_new(label_name);
        gtk_widget_show(tmpwid);
@@ -984,7 +984,7 @@ void tX_seqpar_vttfx_int :: create_widget()
        gtk_widget_show(box);
        
        widget=gtk_event_box_new();
-       gtk_signal_connect(GTK_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
+       g_signal_connect(G_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
        
        gtk_container_add(GTK_CONTAINER(widget), box);
 }
@@ -1015,8 +1015,8 @@ void tX_seqpar_vttfx_bool :: create_widget()
        *fx_value=min_value;
        widget=gtk_check_button_new_with_label(label_name);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), 0);
-       gtk_signal_connect(GTK_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
-       gtk_signal_connect(GTK_OBJECT(widget), "clicked", (GtkSignalFunc) tX_seqpar_vttfx_bool :: gtk_callback, this);
+       g_signal_connect(G_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
+       g_signal_connect(G_OBJECT(widget), "clicked", (GtkSignalFunc) tX_seqpar_vttfx_bool :: gtk_callback, this);
 }
 
 tX_seqpar_vttfx_bool :: ~tX_seqpar_vttfx_bool()
@@ -1048,21 +1048,21 @@ gboolean tX_seqpar::tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gp
                
                GtkWidget *item=gtk_menu_item_new_with_label(sp->get_name());
                gtk_widget_set_sensitive(item, FALSE);
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_show(item);
                
                item = gtk_menu_item_new();
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_set_sensitive (item, FALSE);
                gtk_widget_show (item);
                
                item = gtk_menu_item_new_with_label("MIDI Learn");
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_show(item);
                g_signal_connect(item, "activate", (GCallback) tX_seqpar::learn_midi_binding, sp);              
 
                item = gtk_menu_item_new_with_label("Remove MIDI Binding");
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_show(item);          
 
                if (sp->bound_midi_event.type==tX_midievent::NONE) {
@@ -1072,17 +1072,17 @@ gboolean tX_seqpar::tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gp
 
                if (!sp->is_boolean) {
                        item = gtk_menu_item_new();
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_set_sensitive(item, FALSE);
                        gtk_widget_show(item);
                        
                        item = gtk_menu_item_new_with_label("Set Upper MIDI Bound");
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_show(item);
                        g_signal_connect(item, "activate", (GCallback) tX_seqpar::set_midi_upper_bound, sp);            
                        
                        item = gtk_menu_item_new_with_label("Reset Upper MIDI Bound");
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_show(item);                  
                        g_signal_connect(item, "activate", (GCallback) tX_seqpar::reset_midi_upper_bound, sp);          
                        
@@ -1091,12 +1091,12 @@ gboolean tX_seqpar::tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gp
                        }
                        
                        item = gtk_menu_item_new_with_label("Set Lower MIDI Bound");
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_show(item);
                        g_signal_connect(item, "activate", (GCallback) tX_seqpar::set_midi_lower_bound, sp);                                    
                        
                        item = gtk_menu_item_new_with_label("Reset Lower MIDI Bound");
-                       gtk_menu_append(menu, item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                        gtk_widget_show(item);          
                        g_signal_connect(item, "activate", (GCallback) tX_seqpar::reset_midi_lower_bound, sp);          
 
@@ -1106,12 +1106,12 @@ gboolean tX_seqpar::tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gp
                }
                
                item = gtk_menu_item_new();
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_set_sensitive (item, FALSE);
                gtk_widget_show (item);
                
                item = gtk_menu_item_new_with_label("Delete Sequencer Events");
-               gtk_menu_append(menu, item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
                gtk_widget_show(item);
                g_signal_connect(item, "activate", (GCallback) menu_delete_all_events_for_sp, sp);              
                                
index 7072e1368759d151e8cd60155838101d40526293..1cad9d93c65d1185a251e2172ef4cbf59a21958d 100644 (file)
@@ -51,6 +51,7 @@
 #include "tX_engine.h"
 #include "tX_glade_interface.h"
 #include "tX_glade_support.h"
+#include "tX_dialog.h"
 
 #ifdef USE_DIAL
 #include "tX_dial.h"
@@ -76,8 +77,7 @@ void nicer_filename(char *dest, char *source)
                fn=strrchr(temp, '.');
                if (fn) *fn=0;
                
-               if (strlen(temp) > globals.filename_length)
-               {
+               if (strlen(temp) > (unsigned int) globals.filename_length) {
                        temp[globals.filename_length-3]='.';
                        temp[globals.filename_length-2]='.';
                        temp[globals.filename_length-1]='.';
@@ -285,10 +285,10 @@ GtkSignalFunc load_file(GtkWidget *wid, vtt_class *vtt)
        
        vtt->gui.file_dialog=vtt->gui.fs->window;
        
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", GTK_SIGNAL_FUNC(do_load_file), vtt);
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", GTK_SIGNAL_FUNC (cancel_load_file), vtt);    
-       gtk_signal_connect (GTK_OBJECT(vtt->gui.fs), "delete-event", GTK_SIGNAL_FUNC(quit_load_file), vtt);     
-       gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "cursor_changed", GTK_SIGNAL_FUNC(trigger_prelis), vtt->gui.fs);            
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->ok_button), "clicked", G_CALLBACK(do_load_file), vtt);
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->cancel_button), "clicked", G_CALLBACK (cancel_load_file), vtt);     
+       g_signal_connect (G_OBJECT(vtt->gui.fs), "delete-event", G_CALLBACK(quit_load_file), vtt);      
+       g_signal_connect (G_OBJECT(GTK_FILE_SELECTION(vtt->gui.fs)->file_list), "cursor_changed", G_CALLBACK(trigger_prelis), vtt->gui.fs);             
        return NULL;
 }
 
@@ -535,14 +535,15 @@ void vg_adjust_pitch_vtt(GtkWidget *wid, vtt_class *vtt) {
        }
        
        vtt->gui.adjust_dialog=create_tx_adjust();
+       tX_set_icon(vtt->gui.adjust_dialog);
        gtk_widget_show(vtt->gui.adjust_dialog);
        
        GtkWidget *ok_button=lookup_widget(vtt->gui.adjust_dialog, "ok");
        GtkWidget *cancel_button=lookup_widget(vtt->gui.adjust_dialog, "cancel");
        
-       g_signal_connect(G_OBJECT(ok_button), "clicked", GTK_SIGNAL_FUNC(vg_do_pitch_adjust), vtt);
-       g_signal_connect(G_OBJECT(vtt->gui.adjust_dialog), "destroy", GTK_SIGNAL_FUNC(vg_delete_pitch_adjust), vtt);
-       g_signal_connect(G_OBJECT(cancel_button), "clicked", GTK_SIGNAL_FUNC(vg_cancel_pitch_adjust), vtt);
+       g_signal_connect(G_OBJECT(ok_button), "clicked", G_CALLBACK(vg_do_pitch_adjust), vtt);
+       g_signal_connect(G_OBJECT(vtt->gui.adjust_dialog), "destroy", G_CALLBACK(vg_delete_pitch_adjust), vtt);
+       g_signal_connect(G_OBJECT(cancel_button), "clicked", G_CALLBACK(vg_cancel_pitch_adjust), vtt);
 }
 
 void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
@@ -557,11 +558,11 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        GtkWidget *y_item;
        
        x_item=gtk_menu_item_new_with_label("X-axis (Left <-> Right)");
-       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu), x_item);
+       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu), x_item);
        gtk_widget_show(x_item);
 
        y_item=gtk_menu_item_new_with_label("Y-axis (Up <-> Down)");
-       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu), y_item);
+       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu), y_item);
        gtk_widget_show(y_item);
        
        vtt->gui.mouse_mapping_menu_x=gtk_menu_new();
@@ -572,9 +573,9 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        
        /* Filling the X menu */
        item = gtk_check_menu_item_new_with_label("Disable");
-       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu_x), item);
+       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu_x), item);
        gtk_widget_show(item);
-       gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(vg_xcontrol_dis), vtt);
+       g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(vg_xcontrol_dis), vtt);
        if (vtt->x_par==NULL) item_to_activate=item;
 
        list <tX_seqpar *> :: iterator sp;
@@ -582,9 +583,9 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        for (sp=tX_seqpar::all.begin(); sp!=tX_seqpar::all.end(); sp++) {
                if (((*sp)->is_mappable) && ((*sp)->vtt) == (void*) vtt) {
                        item=gtk_check_menu_item_new_with_label((*sp)->get_name());
-                       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu_x), item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu_x), item);
                        gtk_widget_show(item);
-                       gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(vg_xcontrol_set), (void*) (*sp));
+                       g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(vg_xcontrol_set), (void*) (*sp));
                        
                        if (vtt->x_par==(*sp)) item_to_activate=item;
                }
@@ -596,17 +597,17 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        item_to_activate=NULL;
        
        item = gtk_check_menu_item_new_with_label("Disable");
-       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu_y), item);
+       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu_y), item);
        gtk_widget_show(item);
-       gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(vg_ycontrol_dis), vtt);
+       g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(vg_ycontrol_dis), vtt);
        if (vtt->y_par==NULL) item_to_activate=item;
 
        for (sp=tX_seqpar::all.begin(); sp!=tX_seqpar::all.end(); sp++) {
                if (((*sp)->is_mappable) && ((*sp)->vtt) == (void*) vtt) {
                        item=gtk_check_menu_item_new_with_label((*sp)->get_name());
-                       gtk_menu_append(GTK_MENU(vtt->gui.mouse_mapping_menu_y), item);
+                       gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.mouse_mapping_menu_y), item);
                        gtk_widget_show(item);
-                       gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(vg_ycontrol_set), (void*) (*sp));
+                       g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(vg_ycontrol_set), (void*) (*sp));
                        
                        if (vtt->y_par==(*sp)) item_to_activate=item;
                }
@@ -619,7 +620,7 @@ void vg_mouse_mapping_pressed(GtkWidget *wid, vtt_class *vtt) {
        
        gtk_menu_popup (GTK_MENU(vtt->gui.mouse_mapping_menu), NULL, NULL, NULL, NULL, 0, 0);
 
-       gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
+       g_signal_emit_by_name(G_OBJECT(wid), "released", vtt);
 }
 
 void vg_file_button_pressed(GtkWidget *wid, vtt_class *vtt) {
@@ -628,28 +629,28 @@ void vg_file_button_pressed(GtkWidget *wid, vtt_class *vtt) {
                
                vtt->gui.file_menu=gtk_menu_new();
                item=gtk_menu_item_new_with_label("Load audio file");
-               gtk_menu_append(GTK_MENU(vtt->gui.file_menu), item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.file_menu), item);
                gtk_widget_show(item);
                
-               gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(load_file), vtt);
+               g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(load_file), vtt);
                
                item=gtk_menu_item_new_with_label("Edit audio file");
-               gtk_menu_append(GTK_MENU(vtt->gui.file_menu), item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.file_menu), item);
                gtk_widget_show(item);
 
-               gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(edit_vtt_buffer), vtt);
+               g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(edit_vtt_buffer), vtt);
 
                item=gtk_menu_item_new_with_label("Reload current audio file");
-               gtk_menu_append(GTK_MENU(vtt->gui.file_menu), item);
+               gtk_menu_shell_append(GTK_MENU_SHELL(vtt->gui.file_menu), item);
                gtk_widget_show(item);
 
-               gtk_signal_connect(GTK_OBJECT(item), "activate", GTK_SIGNAL_FUNC(reload_vtt_buffer), vtt);
+               g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(reload_vtt_buffer), vtt);
        }
        
        gtk_menu_popup(GTK_MENU(vtt->gui.file_menu), NULL, NULL, NULL, NULL, 0,0);
 
        /* gtk+ is really waiting for this.. */
-       gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
+       g_signal_emit_by_name(G_OBJECT(wid), "released", vtt);
 }
 
 void vg_adjust_zoom(GtkWidget *wid, vtt_class *vtt) {  
@@ -668,7 +669,7 @@ void fx_button_pressed(GtkWidget *wid, vtt_class *vtt)
        gtk_menu_popup (GTK_MENU(g->ladspa_menu), NULL, NULL, NULL, NULL, 0, 0);
 
        /* gtk+ is really waiting for this.. */
-       gtk_signal_emit_by_name(GTK_OBJECT(wid), "released", vtt);
+       g_signal_emit_by_name(G_OBJECT(wid), "released", vtt);
 }
 
 void gui_set_name(vtt_class *vtt, char *newname)
@@ -691,13 +692,13 @@ void gui_set_name(vtt_class *vtt, char *newname)
        }
 }
 
-#define connect_entry(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "activate", (GtkSignalFunc) func, (void *) vtt);
-#define connect_adj(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "value_changed", (GtkSignalFunc) func, (void *) vtt);
-#define connect_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "clicked", (GtkSignalFunc) func, (void *) vtt);
-#define connect_range(wid, func); gtk_signal_connect(GTK_OBJECT(gtk_range_get_adjustment(GTK_RANGE(g->wid))), "value_changed", (GtkSignalFunc) func, (void *) vtt);
-#define connect_scale_format(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "format-value", (GtkSignalFunc) func, (void *) vtt);
-#define connect_press_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "pressed", (GtkSignalFunc) func, (void *) vtt);
-#define connect_rel_button(wid, func); gtk_signal_connect(GTK_OBJECT(g->wid), "released", (GtkSignalFunc) func, (void *) vtt);
+#define connect_entry(wid, func); g_signal_connect(G_OBJECT(g->wid), "activate", G_CALLBACK(func), (void *) vtt);
+#define connect_adj(wid, func); g_signal_connect(G_OBJECT(g->wid), "value_changed", G_CALLBACK(func), (void *) vtt);
+#define connect_button(wid, func); g_signal_connect(G_OBJECT(g->wid), "clicked", G_CALLBACK(func), (void *) vtt);
+#define connect_range(wid, func); g_signal_connect(G_OBJECT(gtk_range_get_adjustment(GTK_RANGE(g->wid))), "value_changed", G_CALLBACK(func), (void *) vtt);
+#define connect_scale_format(wid, func); g_signal_connect(G_OBJECT(g->wid), "format-value", G_CALLBACK(func), (void *) vtt);
+#define connect_press_button(wid, func); g_signal_connect(G_OBJECT(g->wid), "pressed", G_CALLBACK(func), (void *) vtt);
+#define connect_rel_button(wid, func); g_signal_connect(G_OBJECT(g->wid), "released", G_CALLBACK(func), (void *) vtt);
 
 GtkWidget *vg_create_fx_bar(vtt_class *vtt, vtt_fx *effect, int showdel);
 
@@ -750,15 +751,15 @@ void gui_connect_signals(vtt_class *vtt)
                        drop_types, n_drop_types,
                        GDK_ACTION_COPY);
                                                
-       gtk_signal_connect (GTK_OBJECT (g->file), "drag_data_received",
-                       GTK_SIGNAL_FUNC(drop_file), (void *) vtt);
+       g_signal_connect (G_OBJECT (g->file), "drag_data_received",
+                       G_CALLBACK(drop_file), (void *) vtt);
 
        gtk_drag_dest_set (GTK_WIDGET (g->display), (GtkDestDefaults) (GTK_DEST_DEFAULT_MOTION |GTK_DEST_DEFAULT_HIGHLIGHT |GTK_DEST_DEFAULT_DROP),
                        drop_types, n_drop_types,
                        GDK_ACTION_COPY);
                                                
-       gtk_signal_connect (GTK_OBJECT (g->display), "drag_data_received",
-                       GTK_SIGNAL_FUNC(drop_file), (void *) vtt);
+       g_signal_connect (G_OBJECT (g->display), "drag_data_received",
+                       G_CALLBACK(drop_file), (void *) vtt);
        
 }
        
@@ -883,11 +884,12 @@ void build_vtt_gui(vtt_class *vtt)
        tX_panel *p=new tX_panel("Main", g->control_subbox);
        g->main_panel=p;
                        
-       g->name = gtk_entry_new_with_max_length(256);   
+       g->name = gtk_entry_new();
+       gtk_entry_set_max_length(GTK_ENTRY(g->name), 256);
        gtk_entry_set_text(GTK_ENTRY(g->name), vtt->name);
        p->add_client_widget(g->name);
        gui_set_tooltip(g->name, "Enter the turntable's name here.");
-       gtk_widget_set_usize(g->name, 40, g->name->requisition.height);
+       gtk_widget_set_size_request(g->name, 40, g->name->requisition.height);
        
        g->del=gtk_button_new_with_label("Delete");
        gui_set_tooltip(g->del, "Click here to annihilate this turntable. All events recorded for this turntable will be erased, too.");
@@ -909,8 +911,8 @@ void build_vtt_gui(vtt_class *vtt)
        g->stop=gtk_button_new_with_label("Stop.");
        gui_set_tooltip(g->stop, "Stop this turntable's playback.");
        p->add_client_widget(g->stop);
-       gtk_signal_connect(GTK_OBJECT(g->trigger), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);         
-       gtk_signal_connect(GTK_OBJECT(g->stop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);            
+       g_signal_connect(G_OBJECT(g->trigger), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);             
+       g_signal_connect(G_OBJECT(g->stop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);                
        
        g->autotrigger=gtk_check_button_new_with_label("Auto");
        p->add_client_widget(g->autotrigger);
@@ -921,7 +923,7 @@ void build_vtt_gui(vtt_class *vtt)
        p->add_client_widget(g->loop);
        gui_set_tooltip(g->loop, "Enable this option to make the turntable loop the audio data.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->loop), vtt->loop);
-       gtk_signal_connect(GTK_OBJECT(g->loop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_loop);               
+       g_signal_connect(G_OBJECT(g->loop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_loop);           
        
        g->sync_master=gtk_check_button_new_with_label("Master");
        p->add_client_widget(g->sync_master);
@@ -932,13 +934,13 @@ void build_vtt_gui(vtt_class *vtt)
        p->add_client_widget(g->sync_client);
        gui_set_tooltip(g->sync_client, "If enabled this turntable will be (re-)triggerd in relation to the sync-master turntable.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->sync_client), vtt->is_sync_client);
-       gtk_signal_connect(GTK_OBJECT(g->sync_client), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_client); 
+       g_signal_connect(G_OBJECT(g->sync_client), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_client);     
        
        g->cycles=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->sync_cycles, 0, 10.0, 1,1,1));
        dummy=gtk_spin_button_new(g->cycles, 1.0, 0);
        p->add_client_widget(dummy);
        gui_set_tooltip(dummy, "Determines how often a sync-client turntable gets triggered. 0 -> this turntable will be triggered with every trigger of the sync-master table, 1 -> the table will be triggered every 2nd master trigger and so on.");
-       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_cycles);  
+       g_signal_connect(G_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_cycles);      
 
        gtk_box_pack_start(GTK_BOX(g->control_subbox), p->get_widget(), WID_FIX);
 
@@ -958,7 +960,7 @@ void build_vtt_gui(vtt_class *vtt)
        gui_set_tooltip(g->lp_enable, "Click here to enable the built-in lowpass effect.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->lp_enable), vtt->lp_enable);
        p->add_client_widget(vg_create_fx_bar(vtt, vtt->lp_fx, 0));
-       gtk_signal_connect(GTK_OBJECT(g->lp_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable);     
+       g_signal_connect(G_OBJECT(g->lp_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable); 
 
        p->add_client_widget(g->lp_enable);
 
@@ -991,7 +993,7 @@ void build_vtt_gui(vtt_class *vtt)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->ec_enable), vtt->ec_enable);
        p->add_client_widget(g->ec_enable);
        gui_set_tooltip(g->ec_enable, "Enable the built-in echo effect.");
-       gtk_signal_connect(GTK_OBJECT(g->ec_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable);     
+       g_signal_connect(G_OBJECT(g->ec_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable); 
 
        g->ec_length=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_length, 0, 1, 0.1, 0.01, 0.001));
        g->ec_feedback=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_feedback, 0, 1, 0.1, 0.01, 0.001));
@@ -1043,13 +1045,13 @@ void build_vtt_gui(vtt_class *vtt)
 
        g->mute=gtk_check_button_new_with_label("M");
        gtk_box_pack_start(GTK_BOX(tempbox3), g->mute, WID_FIX);
-       gtk_signal_connect(GTK_OBJECT(g->mute),"clicked", (GtkSignalFunc) mute_volume, vtt);
+       g_signal_connect(G_OBJECT(g->mute),"clicked", (GtkSignalFunc) mute_volume, vtt);
        gtk_widget_show(g->mute);
        gui_set_tooltip(g->mute, "Mute this turntable's mixer output.");
 
        g->solo=gtk_check_button_new_with_label("S");
        gtk_box_pack_start(GTK_BOX(tempbox3), g->solo, WID_FIX);
-       gtk_signal_connect(GTK_OBJECT(g->solo),"clicked", (GtkSignalFunc) solo_vtt, vtt);
+       g_signal_connect(G_OBJECT(g->solo),"clicked", (GtkSignalFunc) solo_vtt, vtt);
        gtk_widget_show(g->solo);
        gui_set_tooltip(g->solo, "Allow only this and other solo-switched turntabels' signal to be routed to the mixer.");
 
@@ -1063,7 +1065,7 @@ void build_vtt_gui(vtt_class *vtt)
        dummy=gtk_vscale_new(GTK_ADJUSTMENT(g->volume)); 
        gtk_scale_set_draw_value(GTK_SCALE(dummy), False);
        gui_set_tooltip(dummy, "Adjust this turntable's volume.");
-       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_volume);       
+       g_signal_connect(G_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_volume);   
 
        gtk_box_pack_start(GTK_BOX(tempbox2), dummy, WID_FIX);
        gtk_widget_show(dummy);
@@ -1128,7 +1130,7 @@ GtkWidget *vg_create_fx_bar(vtt_class *vtt, vtt_fx *effect, int showdel)
                gtk_box_pack_end(GTK_BOX(box), button, WID_FIX);
                gtk_widget_show(pixmap);
                gtk_widget_show(button);
-               gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) fx_kill, (void *) effect);
+               g_signal_connect(G_OBJECT(button), "clicked", (GtkSignalFunc) fx_kill, (void *) effect);
        }
 
        button=gtk_button_new();
@@ -1137,7 +1139,7 @@ GtkWidget *vg_create_fx_bar(vtt_class *vtt, vtt_fx *effect, int showdel)
        gtk_box_pack_end(GTK_BOX(box), button, WID_FIX);
        gtk_widget_show(pixmap);
        gtk_widget_show(button);
-       gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) fx_down, (void *) effect);
+       g_signal_connect(G_OBJECT(button), "clicked", (GtkSignalFunc) fx_down, (void *) effect);
 
        button=gtk_button_new();
        pixmap=tx_pixmap_widget(TX_ICON_FX_UP);
@@ -1145,7 +1147,7 @@ GtkWidget *vg_create_fx_bar(vtt_class *vtt, vtt_fx *effect, int showdel)
        gtk_box_pack_end(GTK_BOX(box), button, WID_FIX);
        gtk_widget_show(pixmap);
        gtk_widget_show(button);
-       gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) fx_up, (void *) effect);
+       g_signal_connect(G_OBJECT(button), "clicked", (GtkSignalFunc) fx_up, (void *) effect);
        
        gtk_widget_show(box);
        
@@ -1214,7 +1216,7 @@ void vg_create_fx_gui(vtt_class *vtt, vtt_fx_ladspa *effect, LADSPA_Plugin *plug
                        p->add_client_widget((*sp)->get_widget());
        }
 
-       gtk_signal_connect(GTK_OBJECT(p->get_labelbutton()), "clicked", (GtkSignalFunc) vg_show_fx_info, (void *) effect);
+       g_signal_connect(G_OBJECT(p->get_labelbutton()), "clicked", (GtkSignalFunc) vg_show_fx_info, (void *) effect);
        gui_set_tooltip(p->get_labelbutton(), "Click here to learn more about this plugin.");
        effect->set_panel_widget(p->get_widget());
        effect->set_panel(p);
@@ -1238,7 +1240,7 @@ void gui_hide_control_panel(vtt_class *vtt, bool hide) {
        if (hide) {
                gtk_widget_hide(vtt->gui.control_box);
                vtt->gui.control_minimized_panel_bar_button=tx_xpm_button_new(TX_ICON_MIN_CONTROL, vtt->name, 0, &vtt->gui.control_minimized_panel_bar_label);
-               gtk_signal_connect(GTK_OBJECT(vtt->gui.control_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_control_panel, vtt);
+               g_signal_connect(G_OBJECT(vtt->gui.control_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_control_panel, vtt);
                gtk_widget_show(vtt->gui.control_minimized_panel_bar_button);
                add_to_panel_bar(vtt->gui.control_minimized_panel_bar_button);
        } else {
@@ -1253,7 +1255,7 @@ void gui_hide_audio_panel(vtt_class *vtt, bool hide) {
        if (hide) {
                gtk_widget_hide(vtt->gui.audio_box);
                vtt->gui.audio_minimized_panel_bar_button=tx_xpm_button_new(TX_ICON_MIN_AUDIO, vtt->name, 0, &vtt->gui.audio_minimized_panel_bar_label);
-               gtk_signal_connect(GTK_OBJECT(vtt->gui.audio_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_audio_panel, vtt);              
+               g_signal_connect(G_OBJECT(vtt->gui.audio_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_audio_panel, vtt);          
                gtk_widget_show(vtt->gui.audio_minimized_panel_bar_button);
                add_to_panel_bar(vtt->gui.audio_minimized_panel_bar_button);
        } else {
index 61e3821f8bda0acf9756ea9562d72c95360a43bf..77cc8f92f508f287a9394cd1237cdf3298e6bf09 100644 (file)
 
 #include <math.h>
 
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include "tX_widget.h"
 #include "tX_types.h"
 #include "tX_global.h"
 #include <malloc.h>
 #include <stdlib.h>
+#include <string.h>
 
 #ifndef WIN32
 #include <unistd.h>
@@ -57,23 +58,24 @@ static GtkWidgetClass *parent_class = NULL;
 
 /* widget "methods" */
 
-guint gtk_tx_get_type() {
-       static guint tx_type = 0;
-       
-       if (!tx_type) {
-               GtkTypeInfo tx_info = {
-               "GtkTx",
-               sizeof(GtkTx),
-               sizeof(GtkTxClass),
-               (GtkClassInitFunc) gtk_tx_class_init,
-               (GtkObjectInitFunc) gtk_tx_init,
-               /* reserved */ NULL,
-               /* reserved */ NULL,
-               /* reserved */ NULL
-       };
-       
-        tx_type = gtk_type_unique(gtk_widget_get_type(), &tx_info);
-       }
+GType gtk_tx_get_type() {
+       static GType tx_type = 0;
+
+       if (!tx_type) {
+               static const GTypeInfo tx_info = {
+                       sizeof (GtkTxClass),
+                       NULL,
+                       NULL,
+                       (GClassInitFunc) gtk_tx_class_init, 
+                       NULL,
+                       NULL,
+                       sizeof (GtkTx),
+               0,
+                       (GInstanceInitFunc) gtk_tx_init,
+               };
+
+               tx_type = g_type_register_static(GTK_TYPE_WIDGET, "GtkTx", &tx_info, 0);
+    }
        
        return tx_type;
 }
@@ -162,7 +164,7 @@ static void gtk_tx_init(GtkTx * tx) {
 GtkWidget *gtk_tx_new(int16_t * wavdata, int wavsamples) {
        GtkTx *tx;
 
-       tx = gtk_type_new(gtk_tx_get_type());
+       tx = (GtkTx *) g_object_new(gtk_tx_get_type (), NULL);
 
        tx->data = wavdata;
        tx->samples = wavsamples;
@@ -392,14 +394,14 @@ void gtk_tx_set_zoom(GtkTx *tx, f_prec zoom) {
        
        tx->zoom=zoom;
        gtk_tx_prepare(wid);
-       gtk_widget_queue_draw_area(wid, 0, 0, wid->allocation.width, wid->allocation.height);
+       gtk_widget_queue_draw(wid);
 }
 
 static void gtk_tx_update(GtkTx * tx) {
        g_return_if_fail(tx != NULL);
        g_return_if_fail(GTK_IS_TX(tx));
 
-       gtk_widget_draw(GTK_WIDGET(tx), NULL);
+       gtk_widget_queue_draw(GTK_WIDGET(tx));
 }
 
 void gtk_tx_update_pos_display(GtkTx * tx, int sample, int mute) {
index 94b59ed544236ac0392273117ef734f5e2e07de4..a5e6e91818b7b1d0bed3a59548ec7c881f757a69 100644 (file)
@@ -87,7 +87,7 @@ struct _GtkTxClass {
 };
 
 GtkWidget* gtk_tx_new  (int16_t *wavdata, int wavsamples);
-guint gtk_tx_get_type  (void);
+GType gtk_tx_get_type  (void);
 void gtk_tx_set_data  (GtkTx *tx, int16_t *wavdata, int wavsamples);
 void gtk_tx_cleanup_pos_display (GtkTx *tx);
 void   gtk_tx_update_pos_display  (GtkTx *tx, int sample, int mute);
index 3162c2d9df7d4088974507de6b0d74de0fa6024c..b4d2722b8e2729136f417932696f7116d7af1b8a 100644 (file)
            <widget class="GtkTable" id="table3">
              <property name="border_width">4</property>
              <property name="visible">True</property>
-             <property name="n_rows">5</property>
+             <property name="n_rows">6</property>
              <property name="n_columns">2</property>
              <property name="homogeneous">False</property>
              <property name="row_spacing">2</property>
                  <property name="y_options"></property>
                </packing>
              </child>
+
+             <child>
+               <widget class="GtkLabel" id="label57">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">Ask for &quot;Quit&quot; confirmation:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">5</property>
+                 <property name="bottom_attach">6</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkCheckButton" id="quit_confirm">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">Enabled</property>
+                 <property name="use_underline">True</property>
+                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                 <property name="active">False</property>
+                 <property name="inconsistent">False</property>
+                 <property name="draw_indicator">True</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">5</property>
+                 <property name="bottom_attach">6</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
            </widget>
            <packing>
              <property name="tab_expand">False</property>