Menu

qtmm 2.0 compiling using Qt version 5.4.1 - necessary steps

2015-05-20
2015-05-20
  • Tom Kuschel

    Tom Kuschel - 2015-05-20

    The program qtmm works flawlessly compiled on Arch Linux 64bit
    on my Asus EeePC 1018P
    g++ (GCC) 4.9.2 20150304 (prerelease), linux kernel 4.0.3-1-ARCH
    % qmake --version
    QMake version 3.0
    Using Qt version 5.4.1 in /usr/lib

    There are four necessary steps of changing source files due to get a binary compiled:


    1. Add a line to the end of the Qt project file qtmm.pro :
    2. QT += widgets
      
    3. Change the include line at the beginning of
    4. main.cpp :
      FROM

      #include <QtGui/QApplication>
      

      TO

      #include <QtWidgets/QApplication>
      
    5. Change two lines in the file mainwindow.cpp because the class QAudioFormat changed the member channels setFrequency() and setChannels() are obsolete, instead use setSampleRate() and channelCount()
    6. mainwindow.cpp :
      FROM

       audioFormat.setFrequency(22050);
       audioFormat.setChannels(1);
      

      TO

       audioFormat.setSampleRate(22050);
       audioFormat.setChannelCount(1);
      
    7. Change both lines in the file
    8. audiobuffer.cpp :

      FROM

       const int sampleBytes = m_format.channels() * channelBytes;
      

      TO

       const int sampleBytes = m_format.channelCount() * channelBytes;
      

      AND FROM

       for(int j = 0; j < m_format.channels(); ++j) {
      

      TO

       for(int j = 0; j < m_format.channelCount(); ++j) {
      

      Compile sources in a terminal with:
      qmake
      make

      73 Tom, oe1tkt

     
  • Anonymous

    Anonymous - 2016-06-18
    Post awaiting moderation.

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.