Problem building wx gui

Help
2005-10-27
2012-09-15
  • Nobody/Anonymous

    Hi,
    I'm having problem building moreamp 0.1.14. It compiles fine if I don't enable the wx gui. I use the following configure line:

    ./configure --prefix=/usr --with-mad=system --with-lame=system --with-id3tag=system --with-vorbis=system --with-flac=system --with-faad=system --with-faac=system --with-mp4v2=system --with-mp4v2enc=system --with-portaudio=system --with-cdparanoia=system

    I solved some compilation problems but some remains.

    maWriteMp4.c compiles once I replaced the line:
    g_MP4hFile = MP4Create(g_outputfile, 0, 0, 0);
    by:
    g_MP4hFile = MP4Create(g_outputfile, 0, 0);

    maControls.cpp compiles once I replaced the line:
    SetLabel("");
    by:
    SetLabel(_T(""));

    maGUI.cpp doesn't compile. I get the following errors:
    http://www.astro.umontreal.ca/~belanger/orig_error.log
    After correcting the "error: conversion from 'const char [1]' to 'wxString' is ambiguous" errors by putting the strings in _T(), I get the following errors:
    http://www.astro.umontreal.ca/~belanger/patch_error.log
    The changes I made to the original code can be reproduced with this patch:
    http://www.astro.umontreal.ca/~belanger/moreamp.patch

    If that helps, I'm using gcc 4.0.2, wxgtk 2.6.2 and gtk2 2.8.6.
    I was having similar errors with gcc 3.4.3 so it's probably an issue with wxgtk.

    If you need more information, please ask.
    Thanks.

     
    • Nobody/Anonymous

      1. I cannnot repoduce it anymore. I didn't modify the lines 971 and 976. As long as 'UseKeyboard' is off, there is no disappearing windows.

      2. Screenshots:
        gtk1 wx widgets:
        http://www.astro.umontreal.ca/~belanger/main_wxgtk1widget.gif
        http://www.astro.umontreal.ca/~belanger/equalizer_wxgtk1widget.gif
        gtk2 wx widgets:
        http://www.astro.umontreal.ca/~belanger/main_wxgtk2widget.gif
        http://www.astro.umontreal.ca/~belanger/equalizer_wxgtk2widget.gif
        I prefer the maSliders.
        As for the check boxes, I like the normal GTK checkbox better than the maCheckBox for the gtk2 build. However, the gtk1 build has the best looking checkboxes (whether standard gtk or maCheckBox). That's my personal opinion. A configure option would be nice, especially for gtk2 builds.

      3. I am not using wxX11 (it is not on my system). I guess that GTK changed that. The spin controls are also funny-looking because of the "extra field".

      4. A while ago, I wanted to compile moreamp with wxX11 but I couldn't compile wxX11 2.6.x.

      5. The PKGBUILD isn't affected by that because it contains the sources url. It will work as long as the sources are left on the server and not moved/renamed.

      Eric (aka Snowman)

       
      • pmisteli

        pmisteli - 2005-11-11

        I have posted MoreAmp-0.1.15. It has fixes for some of these problems and --with-wxcheckboxes and --with-wxsliders configure options.

        I will have to get GTK+2 to fix the other problems.

        Thanks again.
        pmisteli

         
    • Nobody/Anonymous

      Thanks for reporting these problems and for the logs and patches.

      1. The libmp4v2 version included in the faad2-2.0 release (and in the moreamp libs dir) is not the latest version. Later versions of libmp4v2, which I'm guessing is what is installed on your system, have a different prototype for MP4Create(), and MP4_CREATE_EXTENSIBLE_FORMAT defined, in mp4.h.

      Future (0.1.15+) releases of moreamp will have this change in maWriteMp4.c in :

      if defined(MP4_CREATE_EXTENSIBLE_FORMAT)

      g_MP4hFile = MP4Create(g_outputfile, 0, 0);
      

      else

      g_MP4hFile = MP4Create(g_outputfile, 0, 0, 0);
      

      endif

      1. Moreamp does not support unicode.

      I am guessing your wx was built with the --enable-unicode configure option.

      Do you need unicode support ?

      If you don't already have a non-unicode wx installed, you need to build one.

      I built wxgtk for gtk1 from a 'build_gtk' dir with '../configure --with-gtk=1 --disable-shared -without-odbc`, which created '/usr/local/lib/wx/include/gtk-ansi-release-static-2.6/wx/setup.h', etc. and link '/usr/local/bin/wx-config -> /usr/local/lib/wx/config/gtk-ansi-release-static-2.6'.
      If '--with-gtk' is omitted the default is gtk2.

      When multiple wx builds are installed you select one with the wx-config link (you may need to sudo) e.g.
      ln -sfv /usr/local/lib/wx/config/gtk2-ansi-release-static-2.6 /usr/local/bin/wx-config

      This affects other projects that use wx, not just moreamp.

      1. Incidentally, the mp4v2enc moreamp configure option to enable mp4 encoding does not take a '=system' value. Use either --with-mp4v2enc or --without-mp4v2enc; if not specified the default is with-mp4v2enc.

      pmisteli

       
    • Nobody/Anonymous

      Thanks for the prompt response.

      1. Exactly. I have libmp4v2 1.3

      2. This was the problem. Even if a non-unicode wx was installed, the unicode version was used. I solved it by selecting (export WANT_WXGTK=gtk2) the non-unicode wx before compilation. Moreamp now builds fine with just maWriteMp4.c patched for the reasons discussed above.

      However, there are some run-time issues.
      First, it doesn't work in FVWM. The main window doesn't get displayed. A blank window is displayed for a fraction of a second and both the equalizer and song list windows are displayed and seen to behave well. It could be a problem specific to FVWM, though. I ran moreamp in several WM and only FVWM has this problem.
      Also, The text labels are crowded and sometimes overwrite each other. Also, the check boxes are funny-looking.
      http://www.astro.umontreal.ca/~belanger/main.gif
      http://www.astro.umontreal.ca/~belanger/equalizer.gif
      Strangely enough, moreamp looks better in XFCE4 so it might be some config issue.
      http://www.astro.umontreal.ca/~belanger/equalizer_xfce4.gif
      http://www.astro.umontreal.ca/~belanger/main_xfce4.gif

      BTW, I get this warning error: "Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html".
      The faq says:
      "Why does "ps -aux" complain about a bogus '-'?
      According to the POSIX and UNIX standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named "x". If that user doesn't exist, then ps will assume you really meant "ps aux". The warning is given to gently break you of a habit that will cause you trouble if a user named "x" were created. "

      I will report here any new developpment.

      1. Thanks for the hint. It now builds with mp4 encoding.
       
      • Nobody/Anonymous

        Thanks for the screenshots.

        1. The main window disappearing under FVWM may be the same as a known problem that has a conditional workaround which you can enable on your platform :

        Change two lines in maGUI.cpp, line 971 and line 976, from
        #if defined(MAKEYBOARD) && defined (WXGTK) && defined(MACUNIX)
        to
        #if defined(MAKEYBOARD) && defined (WXGTK) && defined(MAUNIX)

        Future versions (0.1.15+) of moreamp will include this change.

        If that doesn't help then experimenting may give some clues :
        Under a wm where moreamp works, close all but the main window, turn off the 'Multiple Instances' and 'Use Keyboard' settings, position the main window in the center of the screen, resize it some, save the settings, quit, then start moreamp under FVWM to see if anything changed.

        1. Maybe your wm allows you to set preferences for system fonts, which wx may pick up.

        In that respect wx-2.6 differs from wx-2.4 and on Mac and I had to set font size in moreamp with a MASETFONT macro that is enabled by line

        if defined(MAOSX) && defined(WXMAC) && (MAGUIWX == 6) // wx-2.6.1

        in three places in the sources : line 70 of maControls.h, and lines 842 and 1008 of maGUI.cpp.

        You can enable this macro on your (any) platform by changing these three lines to

        if (1) // defined(MAOSX) && defined(WXMAC) && (MAGUIWX == 6) // wx-2.6.1

        then moreamp will try to use the size set at line 1011 of maGUI.cpp (g_mafont.SetPointSize(11)).

        I say try because I'm not sure what GetFont(wxSYS_DEFAULT_GUI_FONT) returns for each platform. Other choices are wxSYS_OEM_FIXED_FONT, wxSYS_ANSI_FIXED_FONT, wxSYS_ANSI_VAR_FONT, wxSYS_SYSTEM_FONT, wxSYS_DEVICE_DEFAULT_FONT, wxSYS_DEFAULT_PALETTE and wxSYS_SYSTEM_FIXED_FONT; on my RedHat9 system, with mwm, they all look the same : fixed and too wide. But the original build, without MASETFONT enabled, looks fine.

        Also, MASETFONT is not applied to all text in moreamp.

        1. Thanks for the ps warning. Future versions of moreamp will have 'ps xc' instead of 'ps -xc' at lines 180 and 183 of maUtils.c.

        2. Keep an eye on maLog.txt for possible error messages.

        3. A build with gtk1 instead of gtk+2 may also be interesting.

        pmisteli

         
    • Nobody/Anonymous

      1. The change to the code that you suggested does display the main window. Howeve, if I use the 'Show' menu to hide/display the list or equalizer, the main window will disappear.
        I have also tried the hint about changing the settings in a working WM. It does solve the problem of the main window disappearing when hiding/displaying the other windows. However, the main window disappear when loading a song.
        I have found that using the --with-keyboard=no option solve all these problems.

      2. I solved that by setting my x-server dpi. BTW, the changes you suggested didn't change anything.

      3. No problem.

      4. I didn't saw any relevant messages. If you need more information concerning issue #1, please ask.

      5. Yes, indeed. Screenshots:
        GTK 1:
        http://www.astro.umontreal.ca/~belanger/main_gtk1.gif
        http://www.astro.umontreal.ca/~belanger/equalizer_gtk1.gif
        GTK 2:
        http://www.astro.umontreal.ca/~belanger/main_gtk2.gif
        http://www.astro.umontreal.ca/~belanger/equalizer_gtk2.gif
        I prefer the gtk1 build. The on/off state of the check boxes are easier to see.

      6. I also maintain a moreamp PKGBUILD for the Arch Linux distribution:
        http://aur.archlinux.org/packages.php?do_Details=1&ID=710
        It permit users to easily build a package that they can afterward install on their system.

      Eric (aka Snowman)

       
      • Nobody/Anonymous

        1. Maybe you could give me more details as to how you get the problem of the main window disappearing when loading a song, as I cannot reproduce it on my platform. I set 'UseKeyboard' off, the list window on and on 'List', save settings, restart moreamp and press 'Play'. Is that what you are doing ?

        For the other cases of the main window disappearing (when the 'UseKeyboard' setting is on) I have implemented a different workaround in release 0.1.15, but it is not a quick change to apply to 0.1.14. I should be posting 0.1.15 within a week or so.

        1. You can get normal GTK checkboxes by changing line 178 of maGUI.cpp
          from
          #define MACHECKBOX maCheckBox // wxCheckBox
          to
          #define MACHECKBOX wxCheckBox // maCheckBox

        and adding conditions around line 5860:

        if(MACHECKBOX == maCheckBox)

            ((MACHECKBOX *)cb)->LabelShow();
        

        endif

        and around line 5843:

        if(MACHECKBOX == maCheckBox)

            ((MACHECKBOX *)cb)->LabelHide();
        

        endif

        The maCheckBoxes are colored so that 'abnormal' settings stand out as red.

        You can also get normal sliders with (line 179)

        define MASLIDER wxSlider // maSlider

        but without changing other code they will be inverted (max value at bottom instead of at top).

        If these changes seem important they could become configure options in future releases.

        1. Your GTK+2 spin controls look like my X11 spin controls, square instead of pointed as with GTK1. Did GTK change this or are you somehow using wxX11 ?

        Also, the spin controls in one of your previous screen dumps seemed to have an extra field displaying the numerical value. I thought that was what you meant was funny-looking, not the checkboxes.

        1. Builds with wxX11 instead of wxGTK may also be interesting, although wx doc says wxX11 is still Beta. I have only tried wxX11-2.4.2.

        2. I am not familiar with PKGBUILD but I was wondering how you are affected when I post a new release (I don't remove previous releases but I don't show them in the SourceForge project file list).

        pmisteli

         
        • Nobody/Anonymous

          Actually, if you want the normal GTK checkboxes (2. above), change line 178 as shown but instead of adding the conditions shown around lines 5843 and 5860 just comment the two lines out :

          // ((MACHECKBOX *)cb)->LabelShow();

          // ((MACHECKBOX *)cb)->LabelHide();

          because the test "#if(MACHECKBOX == maCheckBox)" is always false...

          pmisteli

           

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks