Set default margin and spacing for Layout

This change aims to get a foothold that spaces in a layout.
Current margin/spacing values are temporary,
actual values should be adjusted according to a layout.

Signed-off-by: Ikkei Shimomura (tea) <Ikkei.Shimomura@gmail.com>
Change MetronomeBar base class to QFrame

Now MetronomeBar class use QFrame's border instead of QPainter::drawRect.
This make border cusomizable from stylesheet.

Signed-off-by: Ikkei Shimomura (tea) <Ikkei.Shimomura@gmail.com>
Use palette color

This change make MetronomeBar widget style customizable.
The stylesheet support had platform dependence.
But this is still usable, Qt has palette mechanism to change colors.

Signed-off-by: Ikkei Shimomura (tea) <Ikkei.Shimomura@gmail.com>
Switch from unlink(2) to remove(3) in njclient.cpp

The build fails on non-Windows platforms due to a unlink(2) call in
njclient.cpp without including unistd.h.  It is not clear why this build
failure never appeared before but it was introduced in commit
71503ffdde2cd15f835f2acc968ce65105a27774 "Replace JNL_Connection with
QTcpSocket" when the jnetlib header was no longer included.

Since njclient.cpp already includes stdio.h, use the standard C
remove(3) function instead of POSIX unlink(2).  This way we avoid more
platform-specific #ifdefs.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add missing unistd.h includes to wahjamsrv

A recent glibc update exposed missing header includes and the wahjamsrv
build is now failing.  The fix is easy: include unistd.h in the
appropriate files for POSIX hosts.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Fix "Mute" checkbox

The ChannelTreeWidget has a bug where user indices are not updated when
users leave or join the server.  Make sure to store the user index so
the mute checkbox mutes the correct user!

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Remove unused audioStreamer declarations

Wahjam uses PortAudio for cross-platform audio and no longer has
platform-specific audioStreamers (e.g. WDM KS, ALSA, CoreAudio).  Remove
these old declarations, they are never used.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Remove audio buffer files

Let NJClient delete temporary .ogg files.  It is useful to keep them
around for debugging or post-jam mixing.  For now it's most
user-friendly to delete them so we don't silently fill up the user's
harddisk.  In the future we may introduce a setting where the user can
keep jams saved.

Also fix the logic of printing a "Disconnected" message.  It should not
depend on whether or not to delete the session directory.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Remove "Boost (+3dB)" checkbox

The "Boost (+3dB)" feature increases the playback volume of the
metronome or local channel.  The idea was to help the metronome or
user's instrument cut through the mix.

This patch removes the feature because it is rarely used and can confuse
users who believe it increases their remote volume.  Only the local
playback volume is increased, remote users do not hear louder volume.

Instead of manipulating local volume, jams work best when each user
tries to fit into the mix.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Remove explicit -lwsock32 on Windows

The JNL networking library has been replaced in favor of Qt's network
module.  It is no longer necessary to explicitly link against WinSock.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Use pkg-config for library dependencies

Libraries may be built in different ways, making hardcoded LIBS
incompatible across different systems.  The pkg-config(1) tool is
designed as a layer of indirection which reports the LIBS and CFLAGS
requirements of installed libraries.

Use pkg-config(1) to determine libvorbis and PortAudio details.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Log qDebug() and friends to file

Capture qDebug(), qWarning(), qCritical(), and qFatal() output to a
file.  End users should include this log file with bug reports.

Under Linux the log file is located in:

  ~/.local/share/data/Wahjam\ Project/Wahjam/log.txt

Under Windows the log file is location in:

  C:\Documents and Settings\username\Local Settings\Application Data\Wahjam Project\Wahjam\log.txt

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Log system information on startup

Log operating system information and the Qt version.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Move PortAudio initialization to audiostream_pa.cpp

Keep PortAudio code in audiostream_pa.cpp instead of spreading it over
several source files.  This makes it easier for us to add PortAudio
device logging in a later patch.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Add PortAudio device logging

Log all PortAudio host APIs and devices on startup.  This information is
useful for debugging audio problems.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Rename "qtclient" binary to "wahjam"

Support for the legacy clients (curses, Windows, Mac OS X) has been gone
for a while.  The only client is the cross-platform Qt client.  Call the
binary "wahjam" so packaging scripts don't need to duplicate this step
after the binary has been built.

Note we still use the qtclient.pro project file.  Eventually we should
move to a global project file for wahjam, wahjamsrv, and other build
targets.  In the meantime there is no need to rename the project file.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Fix initializer list order in njclient.cpp

It is good practice to keep initializer lists ordered the same way as
the member variables are declared.  This is because C++ constructors
initialize in order of member variable declarations, regardless of the
initializer list order.  Keeping the order consistent prevents confusing
constructor bugs.

This patch fixes a gcc 4.7.1 warning due to initializer list order.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Fix incorrect format specifier in njclient.cpp

The return value of ftell(3) is long int, not int.  Use %ld instead of
%d in the format string.

This fixes a gcc 4.7.1 warning due to the incorrect format specifier.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Drop unused local in RemoteDownload::Write()

It's safe to remove the unused ftell() result in
RemoteDownload::Write().

This fixes a gcc 4.7.1 unused variable warning.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Fix false positive uninitialized variable warning

gcc 4.7.1 warns that theuser can be uninitialized in
NJClient::processMessage().  This is actually a false positive because
theuser will only be used if the username lookup succeeded and x <
m_remoteusers.GetSize().  gcc's analysis is not deep enough to notice.

Fix this warning by initializing theuser to NULL.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>