154 Commits

Author SHA1 Message Date
mathieu _alkama_ m
cdba3c691a Cleaning unused files and fixing indentation 2015-12-13 10:57:56 +01:00
bstrr
cdad61d2bf Merge branch 'master' of https://github.com/kusma/rocket (squashing them altogether).
Squashed commits:
appveyor: build lib and examples

Make sure we build both in Release and Debug Client modes, to cover
a few combinations of build flags. (+174 squashed commits)
Squashed commits:
[19fd992] appveyor: x86 -> Win32
[b1dd199] vs2013: add project files

While we're at it, rename VS2008 project files to *.vs2008.* also.
[fd20f69] update .gitignore
[cee4008] editor: eliminate x64 size_t <-> int warnings
[042505a] README: add travis badge

In addition to appveyor, let's also display the build status for
travis-ci for the Linux and OSX builds.
[542e2f1] add a simple travis config

Build both libs and editor on Linux and OSX. No support for
uploading builds yet, though.
[86b9401] appveyor: clean up build-version number

We don't want build-numbers to be confused with release-version
numbers. So let's just make the appveyor-version be the build-number.
[ca8bb0b] README: add build-status

Since we're now using AppVeyor.com as a CI service for Windows, let's show the build-status.
[a26d79e] add appveyor build-config

This allows us to do automated builds of the editor using
AppVeyor.com, and will package up the built editor on success.

This allows people to download prebuilt editors instead of having
to install Qt and all the jazz.
[7054ce4] Compile fix: warnings for VS2012 (+x64) and up.
[84defcb] example_bass: silence OSX deprecation warning

Apple has marked gluPerspective and gluLookAt as deprecated, in
favour of GLKit's similar functionality. So to prevent needless
warnings, let's wrap those into an interface similar to the old
GLU functions, so we can keep the code portable.
[cf4b7c4] player: use ipv6 on linux and osx

Linux and OSX both support IPv6, so let's enable it on both.
[fc6828e] player: support IPv6

For IPv6, we need to use getaddrinfo instead of gethostbyname. This
also fixes some deprecation-warnings on VS2015, so yay.

Thanks to Niels J. de Wit <ndewit@gmail.com> for help with testing.
[9794849] player: disable MSVCRT deprecations and security warnings

Not everyone use our project files for building on MSVC, so let's
make sure these are always defined. This also show that we forgot
to define _CRT_NONSTDC_NO_DEPRECATE in some build-configurations,
leading to the need for the strdup-hack.
[579b073] player: prevent annoying warning on VS2012 and newer

Visual Studio 2012 and newer seems to have a peculiarity with it's
warning-generation for it's "strdup is reserved, use _strdup
instead"-warning, where it warns even if we use _strdup through a
macro called strdup.

This seems a bit nasty to fix at the core, but it seems we can just
side-step the issue alltogether, by using the NEED_STRDUP macro to
define our own version instead.

This has the side-effect of us using one less CRT function, which
the intro-people may or may not be happy about. But let's let them
weigh in on that if needed.
[00e4a4f] player: only define snprintf on older CRTs

Visual Studio 2012 and up provides snprintf under it's real name,
and Visual Studio 2015 does not allow redefining snprintf. So
let's just use the real name in those cases.
[177b837] player: num_keys is int, not size_t

num_keys is int, but is attempted read and written as size_t. This
breaks pretty badly on 64-bit architectures, so let's write it as
the integer it is.
[ddb8b89] fix missing newline in .gitignore
[3b71d6e] Gitignore for build directory under windows
[1696b59] README: update notes about compiling the example

This section was based on building the editor, but after the editor
was ported to Qt, this description got out-of-date. Update it so it
doesn't relate to qmake.
[719884f] editor: resolve document once

Mocking around with the document-getter many times in a method is
just nasty. Get it once, and work on a local reference instead.
[96502ee] editor: do not care about index when creating tracks

The only thing we want to do at this point is to get the track
itself, so let's go directly to the target.
[93367c4] editor: add and use invalidateAll helper

TrackView::invalidateAll is a bit different from viewport()->update()
in that it doesn't invalidate the track-names nor row-numbers. So
let's do that to get some more speed as well.
[91810aa] editor: tighter invalidation

A lot of these were written by a lazy coder, not bothering to use
the proper bounds when invalidating. Let's remedy that.
[12964bf] editor: simplify TrackView::invalidateTrack()

It can be implemented in terms of invalidateRange, so let's just
do that, as it's simpler.
[73d4180] README -> README.md

By using Markdown instead of simple text, we can get hyperlinks and
other nice features on the GitHub frontpage. So yeah, let's do that.
[e1100b7] TcpSocket doesn't need to know about the transport
[32e7158] player: set sin_zero to 0

sin_zero is required to be cleared to zero on some architectures,
so let's just follow what the spec says.

Noticed by Coverity.
[b0b7ab3] README: fix typo
[9cf1a20] editor: create helpers for processing commands
[2356e2e] editor: set constant stuff in TrackView constructor
[4cb3d93] example_bass: use -framework OpenGL on OSX

When linking on OS X, we need to use -framework OpenGL rather than
the Unix-style -lGL -lGLU when linking to OpenGL. Not sure why,
but yeah. This seems to work.
[deea924] example_bass: only avoid SDLmain on Windows
[d563701] example_bass: detect error in SDL_SetVideoMode
[8fb8e70] editor: set application icon on mac

contrib/logo.svg was simply converted using the online converter
at iconverticons.com
[b6d00d3] editor: separate between logical and physical coordinates
[04ea66e] editor: per-pixel horizontal scrolling

This feels a bit nicer.
[c1f7aed] editor: make invalidateTrack invalidate track-names

Previously, invalidateTrack only invalidated the track-data, but
this isn't correct. Some other invalidation seems to have kept
this problem under control, but this is about to change...
[4254149] editor: do not track windowTracks
[f53bfc1] editor: do not track width/height of TrackArea

We can ask the viewport about it instead.
[3d2d284] editor: use getTrackFromX helper

Instead of sprinkling the knowledge of what apears where aound in
the code, let's use a helper instead. This way, we can more easily
change widths of single tracks.
[e781e90] editor: use Qt's undo framework

Instead of hand-rolling our own systen, let's use Qt's built-in
one to reduce the amount of code.
[dc12bf0] editor: store everything needed in undo-commands
[6f9b867] editor: move document-implementation into source file
[cab6f83] editor: use QRect for selection
[e416b69] editor: simplify painting
[eeb9425] editor: factor out interpolation-pen selection
[d6d72b2] editor: factor out left-margin painting
[b269493] editor: use QLineEdit instead of hand-rolling one

We're editing a line of text, so it makes sense to use a QLineEdit
instead of hacking in editing into the control ourselves. This
gives the users a few neat extra-features, like copy-paste and
undo/redo on the editing itself, yay!

Work around QTBUG-4045, by stripping away group-separators.
[270b06d] editor: factor out the painting of a single track
[9acf92a] editor: factor out polynomial helper
[0176377] editor: mark main-window as modified if document is modified
[4a5dea4] editor: prevent editing when playing
[df0ebc3] editor: stop snooping in the players headers

We can't really change these due to alternative clients/editors
anyway. So there's no added maintainance in duplicating these
definitions - let's just do it to avoid having to care about
source-level interopability.

While we're at it, move the player-definitions to the only place
using them.
[f13d06c] player: remove sync_data structure

the separation between sync_data and sync_device was only needed
due to the reuse of the sync-data code in the editor. This isn't
the case any more, so let's get rid of it.
[0b2f29d] editor: use signals for internal communications

Instead of all these objects having to know about each other, use
Qt's signal/slot mechanism to notify each other. This allows us
to unmangle some dependencies, yay!
[c6f8765] editor: implement own structures

There's plenty of good reasons to keep the data-structures
separate between the editor and the player. For instance, it
allows us to move them in different directions, making the
editor-concepts more high-level and the player-concepts more
low-level.

Some ideas:
- Switch to cubic polynomials on the wire and in the player.
  This allows us to add more curve-types in the editor, without
  having to bother alternative implementations of the player
  with the details.
- Store multiple values "per row" in the editor to support
  incoming/outgoing values. This is useful for sudden changes
  at low row-per-beat settings.
- Use signals/slots per track in the editor to communicate
  changes to client.

Most of these ideas could probably be done without this change,
but they certainly become easier with.
[9b9c7e1] README: update mailing list

We've moved to Google Groups, so let's have the readme-file point people in the right direction.
[b029047] editor: superficial code-style clean-ups

This should be entirely non-functional changes.
[5ae18cc] editor: make space enter value

Previously we were discarding it. But let's be consistent with the
logic of the other keys instead.
[0e59993] player: only include socket-stuff for client-builds

While we're at it, move this to device.h instead of base.h to
reduce global complexity a bit.
[d6c7297] player: move stuff out from base.h

These are only really used in device.c, so let's just move these
helpers there.
[e13402e] editor: pimp the statusbar

Use OS-default layout, by adding permanent widgets and setting the
message separately. Also go for the OS-default look, by not styling
the panels.
[2b6b107] editor: do not paint interpolation-mode into the previous row
[2a1db67] player: build non-client variant from makefile
[95f2dc9] player: do not emulate inline as static

All our inline functions are already declared as static inline,
and multiple static declarations gives compiler errors. So let's
just define inline empty.
[1dbe74f] editor: do not autoscroll with zero-width trackview

This fixes a glitch where the edit-track is invisible when loading
documents from the command line.
[88858ea] licensing: do not track contributors

Tracking indevidual contributors in the source-code is a fool's
errand, and the code-repository already does this much more
accurately.

Replace individual names with "Contributors" to avoid having to
keep track. We were already missing alot of people anyway.
[2575a23] licensing: remove copyright statements from code

Keeping these up-to-date is a pain, and it's strictly speaking not
required. So let's just drop it, the git repository contains much
more accurate author-information.
[239982c] update .gitignore
[e14fd62] editor: handle font-changes the same way as palette-changes
[698cd56] editor: handle palette-changes
[0e8a5fe] editor: use Qt's built-in window-title management

This allows each platform to get the title styled in it's
traditional way.

Unfortunately, we also need to work around QTBUG-16507 for this
to work properly.
[5fc6a7e] editor: use icons from theme, if available
[aec19fc] editor: use QKeySequence::StandardKey

Each target-platform has it's own set of default key-bindings. Use
QKeySequence::StandardKey to get the OS-default behaviour.
[fcf4c89] player: add cast to quiet warning

GCC isn't extatic about these implicit casts, due to FILE* ->
void*. So let's be explicit to shut the compiler up a bit.
[7ce91f2] player: include stddef for size_t
[07bde3b] editor: remove recent-files that fail to load
[5439866] editor: support shrinking the recent-files list
[9e0af84] editor: create recent-file setter

Lift the logic out of MainWindow::setCurrentFileName, so it can
easily be reused.
[89ea468] editor: make save-before-exit dialog a child of mainwindow
[5bcce67] editor: do not swap tracks with ctrl+tab
[fc14ecd] editor: fix shift+tab navigation

This was broken when ported to Qt, as Qt has a separate key code
for shift-tab (Key_Backtab). When using that instead, we also get
the opportunity to clean up that nasty fakeEvent-hack. Yay.
[aaf7862] player: close socket on handshake-mismatch
[0ade8ba] editor: paint utf-8 track-names properly
[d45e8a6] editor: prefer standard header-guards

Pragmas are language extensions, so let's not depend on them. Use
"normal" header-guards instead.
[eadf051] editor: add missing include-guard
[e46dcaf] editor: remove needless includes

Now we only depend on Qt for the editor. No standard-lib includes
at all.
[4ea2d68] editor: use Q_ASSERT instead of assert
[b65b9b6] editor: use QMap for clientTracks
[b5cde44] editor: fixup a cast
[d599ac4] editor: QString for track-names
[01309e1] editor: use QByteArrays for WebSocket upgrade
[10b2ff9] editor: use qMin/qMax/qBound
[315c0ab] editor: use QByteArray for WebSocket buffer

Instead of using std::string, let's use QByteArray. While we're at
it, change some size_t's to int to avoid casts.
[ef20023] editor: use QVector rather than std::vector

Using the same implementation on all platforms leads to less
platform-surprises.
[15dfe6e] Bugfix TrackView::editPaste() to not read data from a dead object

mimeData->data(...) returns a QByteArray. Previously this object was
not stored anywhere, but instead a pointer to this array's raw data was
obtained. As the returned QByteArray was destructed immediately after
the pointer was fetched, the clipbuf pointer started to point to
an unused memory area. This caused paste to crash when the memory area
was overwritten by other parts of the program and garbage CopyEntry
objects were read.
[c793808] editor: use QByteArray instead of std::string

While we're at it, clean up some cruft.
[d4dc37d] editor: remove superfluous waitForReadyRead

We already wait if we fail on the first getChar()-call, so there's
no point in doing this here.
[7b8daec] editor: wait for data in a loop

The first packet of data might not be sufficient for our needs,
so make sure we wait until enough data has arrived. If an error
occurs, break out and let the reading code-do the clean-up.
[4b780b6] Wait for greetings data to arrive

Previously, if greetings data was not immediately readable from the
opened socket, the connection failed because only partial greetings were
received.
[03f229a] editor: clean up includes a tad
[09d72b4] editor: whoops, fix error-path
[cb4e62a] editor: remove exceptions from xml loading/saving

While we're at it, remove the double-reporting of failures.
[f44fa14] editor: use QApplication::arguments instead of argc/argv

Qt can take some debug-flags from the command-line. But if we also
parse the same command-line, we'll get confused about what those
flags were. So let's look at QApplication::arguments instead, as
it has those flags removed.
[fccf4bc] editor: use QList<int> for bookmarks

Keep a sorted list of bookmarks, using q(Upper/Lower)Bound to
access it. This is a perfectly reasonable way of doing
row-bookmarks without needing std::set.
[9e4cd49] editor: fix valgrind-warning

The initialization of the trackview did calculation based on
undefined values, which gave a Valgrind warning. In this case it
wasn't dangerous - the correct values would be recalculated once
the widget got resized as a response to becoming visible.

Let's just initialize these values to keep Valgrind happy.
[dea6659] editor: prefer qt-ism over stl-ism

Unfortunately, QSet doesn't provide upper/lower bounds, so let's
keep using std::set<> for bookmarks for now.
[becb073] editor: save settings to the right place on win32
[f0efcbb] DotRocket: remove superfluous semicolons
[2da1435] DotRocket: clean up brackets
[e563572] DotRocket: remove pointless forward-decls
[7133f18] DotRocket: remove pointless cast
[58d0985] DotRocket: put DeviceReference in the anonymous namespace
[13d2d9e] DotRocket: mark wrapper-functions as static
[c0e3d68] DotRocket: thread-safe callback-handling

Using gcroot instead should be thread-safe, by creating a native
wrapper-object that holds a reference, and using the data-channel
already present.
[d9e5862] DotRocket: silence a warning

While we're at it, rename a variable that was a victim of copypasta.
[15a7444] DotRocket: return double instead of float
[cab4bb0] player: do not redefine NOMINMAX if defined

It seems some versions of MinGW define NOMINMAX in the Windows
headers. To prevent redefinition-warnings, only define it if not
previously defined.
[8f6b469] editor: use Qt's sized integer instead of stdint.h

We get stdint.h included though include/base.h, but it's slightly
cleaner to not make this assumption. Qt already provides suitable
typedefs.
[d430ca7] makefile: clean example_bass executable
[459dc04] makefile: do not remove editor/Makefile twice
[297e12e] makefile: run qmake from the editor-subdir

Some versions/installations of qmake seems to have issues with
running from a different director than the .pro file is located
in when compiling resources, giving an error like:

<path-to-rcc>: File does not exist 'editor.qrc'

So let's just be straight forward and run qmake from the editor
subdir to side-step this.
[6cef381] update .gitignore
[9e7133b] makefile: build editor by default
[27d484a] makefile: do not delete pass -rf to $(RM)

The $(RM) macro already contains -f to prevent errors when a file
doesn't exits. And this list does not include directories, so -r
is just pointless.
[57ae795] makefile: mark all and clean as phony
[3f26cba] editor: fix gcc-warnings properly
[c9c5832] editor: use Qt for endian-conversions
[fdc6759] README: clarify that qmake is for the editor
[a8cd496] editor: move waitForReadyRead into ClientSocket::recv

We want our recv method to act like a blocking call, so let's
wait if there's not sufficient data available.
[72fb1f2] Prevent dereferencing NULL pointer in TcpSocket.disconnect
[c37690a] Close socket properly when a client disconnects
[2b4ceb0] Fix socket to wait for data after WebSocket upgrade
[38f29a8] editor: move server-code to signals and slots

This should make the editor spend less CPU time.
[9d541fc] editor: port network-code to Qt
[cee7ee9] editor: fixup recentfiles
[365c943] editor: only invalidate tracks if edit-track changed
[722c0f4] editor: port to Qt
[d6bb103] editor: fix int/size_t mismatch

As the editor currently only builds on 32-bit Windows, this is not
a real-world problem, as int and size_t are the same size.

However, this is about to change...
[a0e8c24] editor: fix member initialization order
[f83c802] editor: clean up statusbar-updates
[9fea725] editor: clean up input
[baa72fe] editor: wrap and merge row/track changed events
[5c7ade5] editor: wrap up current-value dirtying
[c3925a8] editor: drop custom window events
[e5ec393] editor: create a helper to set statusbar-text
[53ccde4] editor: use socket_poll-helper
[b037174] editor: move invalidation to helpers

Make it look like Qt to keep things simpler
[312645c] player: fix gcc warnings
[b962b71] editor: enable visual styles

To get a modern window, it isn't enough to simply state that some
manifest-dependencies exits, the manifest must be generated and
shipped as well.
[6ec866a] editor: clean up project
[c0a7374] rename sync_player.lib to librocket[-player][d].lib

This makes the UNIX version and the Windows version a bit more
similar, and allows a single batch-build without any copying
to create a complete binary release of the libs.
[eaa1f79] move librocket-stuff to lib-folder

While we're at it, move the sync_player.vcproj to lib/librocket.vcproj
as well.
[a82cb04] linux: build example_bass directly in it's source dir

That's where it's data-files are anyway.
[17ca559] add a gitignore-file
[6633249] move library to the lib-folder
[1616424] example: quiet warnings
[30c66d6] README: remove hyphen from "feed-back"
[b4c22e2] spelling: "key-frame" -> "key frame"
[cb9b964] README: fix broken alignment
[95f0bd0] editor: rename awkwardly named method

Rrename SyncDocument::getTrackOrderCount to getTrackCount. While
we're at it, move the implementation of some methods to the source
file.
[6e2be92] editor: remove commented-out code
[43b401e] editor: move horizontally with tab / shift-tab

Muscle memory is hard to overcome; support tracker-style
tab-movement.
[c77bbac] editor: do not pass a string to std::bad_alloc ctor

The C++ standard does not contain a definition of std::bad_alloc
that takes a string, this is something that older versions of
Visual Studio did as an extension. This is no longer available in
Visual Studio 2012, so let's just not pass any string to it.

Thanks to Xeche for noticing.
[2f921bc] sync: do not redefine inline as __inline for C++

Since the editor includes base.h, and the editor is written in C++,
checking for C99-support is not the right thing to do. So let's
just keep inline as inline in such cases.

This is needed when building the editor with Visual Studio 2012.

Thanks to Xeche for noticing.
[0e0dd68] editor: implement websocket close
[9b301cc] editor: implement websocket ping-pong
[6573ad4] editor: implement websocket support
[2cf28fb] editor: read a full line for the initial greeting

Stop either at newlines or after an exclamation mark, so we can
parse HTTP GET-requests for WebSockets.
[03d48c2] editor: remove unused flags
[9bf3489] editor: factor out tcp-code to a separate class
[c85e9f1] editor: barf on malformed track-name
[f892db9] Update sync/device.c

size_t is not necessarily an int (on OSX it isn't), so reading back sizeof(size_t) as opposed to sizeof(int) won't work. I take it it's a copy/paste bug :)

player: build non-client variant from makefile

editor: do not paint interpolation-mode into the previous row

editor: pimp the statusbar

Use OS-default layout, by adding permanent widgets and setting the
message separately. Also go for the OS-default look, by not styling
the panels.

player: move stuff out from base.h

These are only really used in device.c, so let's just move these
helpers there.

player: only include socket-stuff for client-builds

While we're at it, move this to device.h instead of base.h to
reduce global complexity a bit.

editor: make space enter value

Previously we were discarding it. But let's be consistent with the
logic of the other keys instead.

editor: superficial code-style clean-ups

This should be entirely non-functional changes.

README: update mailing list

We've moved to Google Groups, so let's have the readme-file point people in the right direction.

editor: implement own structures

There's plenty of good reasons to keep the data-structures
separate between the editor and the player. For instance, it
allows us to move them in different directions, making the
editor-concepts more high-level and the player-concepts more
low-level.

Some ideas:
- Switch to cubic polynomials on the wire and in the player.
  This allows us to add more curve-types in the editor, without
  having to bother alternative implementations of the player
  with the details.
- Store multiple values "per row" in the editor to support
  incoming/outgoing values. This is useful for sudden changes
  at low row-per-beat settings.
- Use signals/slots per track in the editor to communicate
  changes to client.

Most of these ideas could probably be done without this change,
but they certainly become easier with.

editor: use signals for internal communications

Instead of all these objects having to know about each other, use
Qt's signal/slot mechanism to notify each other. This allows us
to unmangle some dependencies, yay!

player: remove sync_data structure

the separation between sync_data and sync_device was only needed
due to the reuse of the sync-data code in the editor. This isn't
the case any more, so let's get rid of it.

editor: stop snooping in the players headers

We can't really change these due to alternative clients/editors
anyway. So there's no added maintainance in duplicating these
definitions - let's just do it to avoid having to care about
source-level interopability.

While we're at it, move the player-definitions to the only place
using them.

editor: prevent editing when playing

editor: mark main-window as modified if document is modified

editor: factor out polynomial helper

editor: factor out the painting of a single track

editor: use QLineEdit instead of hand-rolling one

We're editing a line of text, so it makes sense to use a QLineEdit
instead of hacking in editing into the control ourselves. This
gives the users a few neat extra-features, like copy-paste and
undo/redo on the editing itself, yay!

Work around QTBUG-4045, by stripping away group-separators.

editor: factor out left-margin painting

editor: factor out interpolation-pen selection

editor: simplify painting

editor: use QRect for selection

editor: move document-implementation into source file

editor: store everything needed in undo-commands

editor: use Qt's undo framework

Instead of hand-rolling our own systen, let's use Qt's built-in
one to reduce the amount of code.

editor: use getTrackFromX helper

Instead of sprinkling the knowledge of what apears where aound in
the code, let's use a helper instead. This way, we can more easily
change widths of single tracks.

editor: do not track width/height of TrackArea

We can ask the viewport about it instead.

editor: do not track windowTracks

editor: make invalidateTrack invalidate track-names

Previously, invalidateTrack only invalidated the track-data, but
this isn't correct. Some other invalidation seems to have kept
this problem under control, but this is about to change...

editor: per-pixel horizontal scrolling

This feels a bit nicer.

editor: separate between logical and physical coordinates

editor: set application icon on mac

contrib/logo.svg was simply converted using the online converter
at iconverticons.com

example_bass: detect error in SDL_SetVideoMode

example_bass: only avoid SDLmain on Windows

example_bass: use -framework OpenGL on OSX

When linking on OS X, we need to use -framework OpenGL rather than
the Unix-style -lGL -lGLU when linking to OpenGL. Not sure why,
but yeah. This seems to work.

editor: set constant stuff in TrackView constructor

editor: create helpers for processing commands

README: fix typo

player: set sin_zero to 0

sin_zero is required to be cleared to zero on some architectures,
so let's just follow what the spec says.

Noticed by Coverity.

TcpSocket doesn't need to know about the transport

README -> README.md

By using Markdown instead of simple text, we can get hyperlinks and
other nice features on the GitHub frontpage. So yeah, let's do that.

editor: simplify TrackView::invalidateTrack()

It can be implemented in terms of invalidateRange, so let's just
do that, as it's simpler.

editor: tighter invalidation

A lot of these were written by a lazy coder, not bothering to use
the proper bounds when invalidating. Let's remedy that.

editor: add and use invalidateAll helper

TrackView::invalidateAll is a bit different from viewport()->update()
in that it doesn't invalidate the track-names nor row-numbers. So
let's do that to get some more speed as well.

editor: do not care about index when creating tracks

The only thing we want to do at this point is to get the track
itself, so let's go directly to the target.

editor: resolve document once

Mocking around with the document-getter many times in a method is
just nasty. Get it once, and work on a local reference instead.

README: update notes about compiling the example

This section was based on building the editor, but after the editor
was ported to Qt, this description got out-of-date. Update it so it
doesn't relate to qmake.

Gitignore for build directory under windows

fix missing newline in .gitignore

player: num_keys is int, not size_t

num_keys is int, but is attempted read and written as size_t. This
breaks pretty badly on 64-bit architectures, so let's write it as
the integer it is.

player: only define snprintf on older CRTs

Visual Studio 2012 and up provides snprintf under it's real name,
and Visual Studio 2015 does not allow redefining snprintf. So
let's just use the real name in those cases.

player: prevent annoying warning on VS2012 and newer

Visual Studio 2012 and newer seems to have a peculiarity with it's
warning-generation for it's "strdup is reserved, use _strdup
instead"-warning, where it warns even if we use _strdup through a
macro called strdup.

This seems a bit nasty to fix at the core, but it seems we can just
side-step the issue alltogether, by using the NEED_STRDUP macro to
define our own version instead.

This has the side-effect of us using one less CRT function, which
the intro-people may or may not be happy about. But let's let them
weigh in on that if needed.

player: disable MSVCRT deprecations and security warnings

Not everyone use our project files for building on MSVC, so let's
make sure these are always defined. This also show that we forgot
to define _CRT_NONSTDC_NO_DEPRECATE in some build-configurations,
leading to the need for the strdup-hack.

player: support IPv6

For IPv6, we need to use getaddrinfo instead of gethostbyname. This
also fixes some deprecation-warnings on VS2015, so yay.

Thanks to Niels J. de Wit <ndewit@gmail.com> for help with testing.

player: use ipv6 on linux and osx

Linux and OSX both support IPv6, so let's enable it on both.

example_bass: silence OSX deprecation warning

Apple has marked gluPerspective and gluLookAt as deprecated, in
favour of GLKit's similar functionality. So to prevent needless
warnings, let's wrap those into an interface similar to the old
GLU functions, so we can keep the code portable.

Compile fix: warnings for VS2012 (+x64) and up.

add appveyor build-config

This allows us to do automated builds of the editor using
AppVeyor.com, and will package up the built editor on success.

This allows people to download prebuilt editors instead of having
to install Qt and all the jazz.

README: add build-status

Since we're now using AppVeyor.com as a CI service for Windows, let's show the build-status.

appveyor: clean up build-version number

We don't want build-numbers to be confused with release-version
numbers. So let's just make the appveyor-version be the build-number.

add a simple travis config

Build both libs and editor on Linux and OSX. No support for
uploading builds yet, though.

README: add travis badge

In addition to appveyor, let's also display the build status for
travis-ci for the Linux and OSX builds.

editor: eliminate x64 size_t <-> int warnings

update .gitignore

vs2013: add project files

While we're at it, rename VS2008 project files to *.vs2008.* also.

appveyor: x86 -> Win32

appveyor: build lib and examples

Make sure we build both in Release and Debug Client modes, to cover
a few combinations of build flags.
2015-12-13 10:05:08 +01:00
Daniel Collin
55ac22414a Merge branch 'master' of git://github.com/kusma/rocket 2013-01-09 09:39:34 +01:00
Daniel Collin
dc52c3626a Added generation of accelerator table 2013-01-08 12:20:31 +01:00
Erik Faye-Lund
d5b05fc778 editor: prevent warning on MSVC 2013-01-02 20:43:15 +01:00
Thor Arne Gald Semb
3338175675 editor: support loading from argv
It's sometimes useful to be able to load a rocket-file by dragging
it onto the editor executable, or even registering the editor as
an open-handler for the rocket-filetype

Support this by accepting an optional argument that specifies the
file to load.
2012-10-19 17:30:45 +02:00
Thor Arne Gald Semb
b46ce44f2b editor: obey ctrl+n 2012-10-19 17:15:51 +02:00
Erik Faye-Lund
148293dc25 editor: save tracks in the right order 2012-10-19 17:11:27 +02:00
Erik Faye-Lund
bdca635226 editor: save/load bookmarks
Beware of the hack: Loads track-tags from anywhere in the document
to retain backwards compatibility.
2012-04-16 19:05:02 +02:00
Erik Faye-Lund
c17de99f82 editor: change bookmark-browsing keys
Shift+PgUp/PgDn was a poor choice for bookmark-browsing keys, as
it's also useful for selecting sync-data for copy/paste.

Fix this by changing the hotkeys to Alt+PgUp/PgDn instead.
2012-04-16 19:05:01 +02:00
Erik Faye-Lund
b1d3320415 editor: fix border-case when finding prev bookmark
A typo made the finding of the previous bookmark when the current
row is located after the last bookmark to fail. Fix this by
replacing a call to std::set<int>::rend() with a call to
std::set<int>::rbegin().
2012-04-16 18:42:27 +02:00
Erik Faye-Lund
3f19324255 editor: support going to prev/next bookmark 2012-04-10 19:52:25 +02:00
Erik Faye-Lund
3a859b781e editor: add visual row-bookmarks 2012-04-10 19:52:13 +02:00
Erik Faye-Lund
2e53f4da00 editor: static-ism
There's no reason not to mark these symbols as static; let's do so.
2012-04-10 18:38:19 +02:00
Erik Faye-Lund
5b120b11f5 editor: const correctness 2012-04-10 18:31:48 +02:00
Erik Faye-Lund
96cc9e82a4 editor: do not ask for saving on new document
A new, unmodified document does not contain any interresting data,
let's not bother the user about saving before quitting in that
case.

fixup some code style while at it.
2012-04-10 18:31:46 +02:00
Erik Faye-Lund
b85a3bddcb edior: use document-getter more consistently 2012-04-10 18:31:39 +02:00
Erik Faye-Lund
8f94efbc62 player: add suport for Win64 builds
To make sure it works, add support to the example while we're at
it. Also fix compilation warnings.
2012-03-01 14:27:55 +01:00
Erik Faye-Lund
d8081fd63c editor: fix dialog return
return the status from EndDialog instead of a constant TRUE. This
is mostly about keeping the code "honest", it doesn't change
anything in reality.

Also fix up some code-style.
2011-04-05 10:01:45 +02:00
Erik Faye-Lund
6d56c23e00 editor: use Set/GetDlgItemInt
We previously rolled our own text <-> int conversion code for
the dialogs. Use winapi's built-in one instead.

While we're at it, fix some indentation and a return-code.
2011-04-05 09:58:44 +02:00
Erik Faye-Lund
341bf3b449 editor: initialize the correct field
biasSelectionDialogProc deals with IDC_BIASSELECTION_-stuff, not
IDC_SETROWS_-stuff. Initialize the edit-controller to 0 as expected.
2011-04-05 09:48:54 +02:00
Erik Faye-Lund
0a4d46d267 editor: fix compilation of debug build 2011-04-02 15:28:44 +02:00
Erik Faye-Lund
3178f22c2a editor: replace document when loading
Simplify the book-keeping a bit by simply creating a new document
when loading. Copy the ClientSocket to the new document to keep
client-state.
2011-03-29 20:24:41 +02:00
Erik Faye-Lund
9132474bdb editor: clear clientTracks on disconnection 2011-03-28 23:15:08 +02:00
Erik Faye-Lund
558dcf01fb editor: pass track-name to client-socket
This makes ClientSocket independent of the track-order in the
SyncDocument, and makes it easier to understand quite a bit
of the logic.
2011-03-28 23:12:25 +02:00
Erik Faye-Lund
55cdc24cef editor: move fileName inside SyncDocument 2011-03-28 22:59:44 +02:00
Erik Faye-Lund
8de60a4095 editor: error our gracefully when loading fails
If an error happens while loading, the old document should be left
intact. Ensure this by not modifying the document until all loading
code has been run.
2011-03-28 22:59:44 +02:00
Erik Faye-Lund
9724884884 editor: move all client stuff to socket-class
Rename NetworkSocket to ClientSocket, and put the client-specific
functionality in it.
2011-03-28 22:59:37 +02:00
Erik Faye-Lund
bc5fcca75f editor: propagate allocation-errors
This isn't really a big deal, but let's just propagate allocation
errors as std::bad_alloc exceptions.
2011-01-26 21:21:30 +01:00
Erik Faye-Lund
687df0876b protocol: make client-index implicit
This will enable us to unify the code in a later commit.

This is a protocol-breaking change, and means that matching editor
and player must be used.
2011-01-25 23:36:15 +01:00
Erik Faye-Lund
7590f5c6c6 Merge branch 'work/icon' 2010-11-23 22:00:33 +01:00
Erik Faye-Lund
8c842edff3 editor: add an application icon
The ICO was created from contrib/logo.svg by exporting a PNG from
Inkscape, and converting the PNG online at with iconverticons.com
2010-11-17 23:18:42 +01:00
Erik Faye-Lund
5318b90d7a editor: delete remote keys when creating new document 2010-11-13 14:06:26 +01:00
Erik Faye-Lund
2827d4b4dc editor: reorder file-list
Update the file-list in the order Visual Studio prefers it to be. This
reduces update-noise when adding files to the project.
2010-11-02 18:58:14 +01:00
Erik Faye-Lund
5bd6a515cf editor: clean up resource-header
Remove newlines to reduce noise from visual studio when updating
the resources.

Fix _APS_NEXT_RESOURCE_VALUE so 104 won't be generated, it already
exist.
2010-11-02 18:58:13 +01:00
Erik Faye-Lund
f2c12d1351 editor: do not use MFC header
afxres.h is MFC-ism, and is not included in Visual Studio Express 2008.
To avoid confusing the resource editor in other visual studio versions,
let's implement a minimal version ourselves.
2010-09-05 15:37:54 +02:00
Erik Faye-Lund
126fbe1c33 editor: prevent crash on early disconnection
With some really bad luck, it was possible to crash inside
std::string::resize() if the connection was disconnected
right after sending the GET_TRACK command.
2010-09-05 00:07:25 +02:00
Erik Faye-Lund
1d4e1bb795 gcc: fix compilation warnings 2010-09-04 14:32:24 +02:00
Erik Faye-Lund
68ae5f69a6 editor: style-nit 2010-08-29 23:43:10 +02:00
Erik Faye-Lund
6693c3f8f4 protocol: use network byte-order
The network code assumes that the client and server have the
same endianess. This isn't always the case, so let's change
it all to network byte-order.

This change is not backwards compatible, so old clients and
new editors (or vica verca) will not work together any more.
2010-08-29 23:43:10 +02:00
Erik Faye-Lund
163194e338 editor: increase warning level and fix warnings
While we're at it, let's fix-up some code-style errors.
2010-08-29 23:43:08 +02:00
Erik Faye-Lund
197f80010c editor: refactor command-processing 2010-07-26 13:02:19 +02:00
Erik Faye-Lund
e640a4ab6a editor: explicit C-declaration around sync/data.h
Trade an explicit extern "C" declaration for three
defined(__cplusplus) wrapped ones.
2010-07-06 23:03:37 +02:00
Erik Faye-Lund
47d8e9de6c editor: fix aborting save on exit 2010-07-05 19:07:02 +02:00
Erik Faye-Lund
1e94cd9975 Merge branch 'work/no-console' 2010-06-18 20:16:12 +02:00
Erik Faye-Lund
d68a38f451 editor: clean up error reporting 2010-06-18 20:09:01 +02:00
Erik Faye-Lund
12328ce6b8 editor: do not create a console window 2010-06-18 20:09:00 +02:00
Erik Faye-Lund
6ff7583935 editor: remove dead code
In 0e0b99e5, I accidentally committed some dead code. Remove it.
2010-06-18 20:08:24 +02:00
Erik Faye-Lund
31ec5064b2 editor: allow reordering tracks by dragging mouse
Previously the only way of reordering tracks were with an
obscure keyboard short-cut. Most users would expect to be
able to do this with the mouse, so we'll allow that.
2010-06-18 16:29:11 +02:00
Erik Faye-Lund
b5edcbe55d editor: make autoscrolling optional 2010-06-18 16:29:09 +02:00