CVS: rdesktop/uiports makefile_qt,1.2,1.3 qtwin.cpp,1.9,1.10 qtwin.h,1.1,1.2

Jay Sorg <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop/uiports
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30044

Modified Files:
	makefile_qt qtwin.cpp qtwin.h 
Log Message:
added sound

Index: makefile_qt
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/uiports/makefile_qt,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** makefile_qt	13 Mar 2005 06:38:42 -0000	1.2
--- makefile_qt	4 Apr 2005 02:06:24 -0000	1.3
***************
*** 4,9 ****
  #
  CC = g++
! CPPFLAGS = -O2 -Wall -I/usr/local/qt/include
! RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o
  LD2FLAGS = -L/usr/local/qt/lib -L/usr/X11R6/lib
  LDFLAGS = -lcrypto -lqt -lXext -lX11 -lm
--- 4,9 ----
  #
  CC = g++
! CPPFLAGS = -O2 -Wall -I/usr/local/qt/include -DWITH_RDPSND
! RESTOBJ = ../tcp.o ../iso.o ../mcs.o ../secure.o ../rdp.o ../rdp5.o ../orders.o ../cache.o ../mppc.o ../licence.o ../bitmap.o ../channels.o ../pstcache.o ../rdpsnd.o ../rdpsnd_oss.o
  LD2FLAGS = -L/usr/local/qt/lib -L/usr/X11R6/lib
  LDFLAGS = -lcrypto -lqt -lXext -lX11 -lm

Index: qtwin.cpp
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/uiports/qtwin.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** qtwin.cpp	3 Apr 2005 05:40:15 -0000	1.9
--- qtwin.cpp	4 Apr 2005 02:06:24 -0000	1.10
***************
*** 73,85 ****
  static int g_flags = RDP_LOGON_NORMAL;
  
  /* qt globals */
! static QSocketNotifier * g_SocketNotifier;
! static QApplication * g_App;
! static QMyMainWindow * g_MW;
! static QMyScrollView * g_SV;
! static QPixmap * g_BS;
! static QPixmap * g_DS;
! static QPainter * g_P1;
! static QPainter * g_P2;
  static QColor g_Color1;
  static QColor g_Color2;
--- 73,92 ----
  static int g_flags = RDP_LOGON_NORMAL;
  
+ #ifdef WITH_RDPSND
+ extern int g_dsp_busy;
+ extern int g_dsp_fd;
+ static int g_rdpsnd = 0;
+ static QSocketNotifier * g_SoundNotifier = 0;
+ #endif
+ 
  /* qt globals */
! static QSocketNotifier * g_SocketNotifier = 0;
! static QApplication * g_App = 0;
! static QMyMainWindow * g_MW = 0;
! static QMyScrollView * g_SV = 0;
! static QPixmap * g_BS = 0;
! static QPixmap * g_DS = 0;
! static QPainter * g_P1 = 0;
! static QPainter * g_P2 = 0;
  static QColor g_Color1;
  static QColor g_Color2;
***************
*** 463,466 ****
--- 470,505 ----
      g_SV->close();
    }
+ #ifdef WITH_RDPSND
+   if (g_dsp_busy)
+   {
+     if (g_SoundNotifier == 0)
+     {
+       g_SoundNotifier = new QSocketNotifier(g_dsp_fd, QSocketNotifier::Write,
+                                             g_MW);
+       g_MW->connect(g_SoundNotifier, SIGNAL(activated(int)), g_MW,
+                     SLOT(soundSend()));
+     }
+     else
+     {
+       if (!g_SoundNotifier->isEnabled())
+       {
+         g_SoundNotifier->setEnabled(true);
+       }
+     }
+   }
+ #endif
+ }
+ 
+ /******************************************************************************/
+ void QMyMainWindow::soundSend()
+ {
+ #ifdef WITH_RDPSND
+   g_SoundNotifier->setEnabled(false);
+   wave_out_play();
+   if (g_dsp_busy)
+   {
+     g_SoundNotifier->setEnabled(true);
+   }
+ #endif
  }
  
***************
*** 562,565 ****
--- 601,611 ----
  void ui_main_loop(void)
  {
+ #ifdef WITH_RDPSND
+   // init sound
+   if (g_rdpsnd)
+   {
+     rdpsnd_init();
+   }
+ #endif
    // connect
    if (!rdp_connect(g_servername, g_flags, "", "", "", ""))
***************
*** 1489,1501 ****
    fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
    fprintf(stderr, "Usage: qtrdesktop [options] server\n");
!   fprintf(stderr, "   -g: desktop geometry (WxH)\n");
    fprintf(stderr, "   -4: use RDP version 4\n");
    fprintf(stderr, "   -5: use RDP version 5 (default)\n");
!   fprintf(stderr, "   -t: tcp port)\n");
!   fprintf(stderr, "   -a: connection colour depth\n");
!   fprintf(stderr, "   -T: window title\n");
    fprintf(stderr, "   -P: use persistent bitmap caching\n");
    fprintf(stderr, "   -0: attach to console\n");
    fprintf(stderr, "   -z: enable rdp compression\n");
    fprintf(stderr, "\n");
  }
--- 1535,1548 ----
    fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
    fprintf(stderr, "Usage: qtrdesktop [options] server\n");
!   fprintf(stderr, "   -g WxH: desktop geometry\n");
    fprintf(stderr, "   -4: use RDP version 4\n");
    fprintf(stderr, "   -5: use RDP version 5 (default)\n");
!   fprintf(stderr, "   -t 3389: tcp port)\n");
!   fprintf(stderr, "   -a 8|16|24: connection colour depth\n");
!   fprintf(stderr, "   -T title: window title\n");
    fprintf(stderr, "   -P: use persistent bitmap caching\n");
    fprintf(stderr, "   -0: attach to console\n");
    fprintf(stderr, "   -z: enable rdp compression\n");
+   fprintf(stderr, "   -r sound: enable sound\n");
    fprintf(stderr, "\n");
  }
***************
*** 1720,1723 ****
--- 1767,1779 ----
        g_flags |= RDP_COMPRESSION;
      }
+     else if (strcmp(in_argv[i], "-r") == 0)
+     {
+       if (strcmp(in_argv[i + 1], "sound") == 0)
+       {
+ #ifdef WITH_RDPSND
+         g_rdpsnd = 1;
+ #endif
+       }
+     }
    }
    return 1;

Index: qtwin.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/uiports/qtwin.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** qtwin.h	16 Jun 2004 03:27:54 -0000	1.1
--- qtwin.h	4 Apr 2005 02:06:24 -0000	1.2
***************
*** 28,31 ****
--- 28,32 ----
    public slots:
      void dataReceived();
+     void soundSend();
  };
  



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.