/[rdesktop]/sourceforge.net/trunk/rdesktop/uiports/qtwin.cpp
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/uiports/qtwin.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 879 by jsorg71, Sun Apr 3 05:40:15 2005 UTC revision 880 by jsorg71, Mon Apr 4 02:06:24 2005 UTC
# Line 72  static char g_servername[128]; Line 72  static char g_servername[128];
72  static char g_title[128] = "";  static char g_title[128] = "";
73  static int g_flags = RDP_LOGON_NORMAL;  static int g_flags = RDP_LOGON_NORMAL;
74    
75    #ifdef WITH_RDPSND
76    extern int g_dsp_busy;
77    extern int g_dsp_fd;
78    static int g_rdpsnd = 0;
79    static QSocketNotifier * g_SoundNotifier = 0;
80    #endif
81    
82  /* qt globals */  /* qt globals */
83  static QSocketNotifier * g_SocketNotifier;  static QSocketNotifier * g_SocketNotifier = 0;
84  static QApplication * g_App;  static QApplication * g_App = 0;
85  static QMyMainWindow * g_MW;  static QMyMainWindow * g_MW = 0;
86  static QMyScrollView * g_SV;  static QMyScrollView * g_SV = 0;
87  static QPixmap * g_BS;  static QPixmap * g_BS = 0;
88  static QPixmap * g_DS;  static QPixmap * g_DS = 0;
89  static QPainter * g_P1;  static QPainter * g_P1 = 0;
90  static QPainter * g_P2;  static QPainter * g_P2 = 0;
91  static QColor g_Color1;  static QColor g_Color1;
92  static QColor g_Color2;  static QColor g_Color2;
93    
# Line 462  void QMyMainWindow::dataReceived() Line 469  void QMyMainWindow::dataReceived()
469    {    {
470      g_SV->close();      g_SV->close();
471    }    }
472    #ifdef WITH_RDPSND
473      if (g_dsp_busy)
474      {
475        if (g_SoundNotifier == 0)
476        {
477          g_SoundNotifier = new QSocketNotifier(g_dsp_fd, QSocketNotifier::Write,
478                                                g_MW);
479          g_MW->connect(g_SoundNotifier, SIGNAL(activated(int)), g_MW,
480                        SLOT(soundSend()));
481        }
482        else
483        {
484          if (!g_SoundNotifier->isEnabled())
485          {
486            g_SoundNotifier->setEnabled(true);
487          }
488        }
489      }
490    #endif
491    }
492    
493    /******************************************************************************/
494    void QMyMainWindow::soundSend()
495    {
496    #ifdef WITH_RDPSND
497      g_SoundNotifier->setEnabled(false);
498      wave_out_play();
499      if (g_dsp_busy)
500      {
501        g_SoundNotifier->setEnabled(true);
502      }
503    #endif
504  }  }
505    
506  //*****************************************************************************  //*****************************************************************************
# Line 561  int ui_create_window(void) Line 600  int ui_create_window(void)
600  //*****************************************************************************  //*****************************************************************************
601  void ui_main_loop(void)  void ui_main_loop(void)
602  {  {
603    #ifdef WITH_RDPSND
604      // init sound
605      if (g_rdpsnd)
606      {
607        rdpsnd_init();
608      }
609    #endif
610    // connect    // connect
611    if (!rdp_connect(g_servername, g_flags, "", "", "", ""))    if (!rdp_connect(g_servername, g_flags, "", "", "", ""))
612    {    {
# Line 1488  void out_params(void) Line 1534  void out_params(void)
1534    fprintf(stderr, "QT uiport by Jay Sorg\n");    fprintf(stderr, "QT uiport by Jay Sorg\n");
1535    fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");    fprintf(stderr, "See http://www.rdesktop.org/ for more information.\n\n");
1536    fprintf(stderr, "Usage: qtrdesktop [options] server\n");    fprintf(stderr, "Usage: qtrdesktop [options] server\n");
1537    fprintf(stderr, "   -g: desktop geometry (WxH)\n");    fprintf(stderr, "   -g WxH: desktop geometry\n");
1538    fprintf(stderr, "   -4: use RDP version 4\n");    fprintf(stderr, "   -4: use RDP version 4\n");
1539    fprintf(stderr, "   -5: use RDP version 5 (default)\n");    fprintf(stderr, "   -5: use RDP version 5 (default)\n");
1540    fprintf(stderr, "   -t: tcp port)\n");    fprintf(stderr, "   -t 3389: tcp port)\n");
1541    fprintf(stderr, "   -a: connection colour depth\n");    fprintf(stderr, "   -a 8|16|24: connection colour depth\n");
1542    fprintf(stderr, "   -T: window title\n");    fprintf(stderr, "   -T title: window title\n");
1543    fprintf(stderr, "   -P: use persistent bitmap caching\n");    fprintf(stderr, "   -P: use persistent bitmap caching\n");
1544    fprintf(stderr, "   -0: attach to console\n");    fprintf(stderr, "   -0: attach to console\n");
1545    fprintf(stderr, "   -z: enable rdp compression\n");    fprintf(stderr, "   -z: enable rdp compression\n");
1546      fprintf(stderr, "   -r sound: enable sound\n");
1547    fprintf(stderr, "\n");    fprintf(stderr, "\n");
1548  }  }
1549    
# Line 1719  int parse_parameters(int in_argc, char * Line 1766  int parse_parameters(int in_argc, char *
1766      {      {
1767        g_flags |= RDP_COMPRESSION;        g_flags |= RDP_COMPRESSION;
1768      }      }
1769        else if (strcmp(in_argv[i], "-r") == 0)
1770        {
1771          if (strcmp(in_argv[i + 1], "sound") == 0)
1772          {
1773    #ifdef WITH_RDPSND
1774            g_rdpsnd = 1;
1775    #endif
1776          }
1777        }
1778    }    }
1779    return 1;    return 1;
1780  }  }

Legend:
Removed from v.879  
changed lines
  Added in v.880

  ViewVC Help
Powered by ViewVC 1.1.26