298 Commits

Author SHA1 Message Date
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
739fc21cfd player: return interpolated value as double
The heavy lifting was already done in double precision, so just
return the full value to the user without truncating to float.
2012-10-19 17:10:57 +02:00
Erik Faye-Lund
7c43db7385 Merge branch 'work/io-callback' 2012-09-11 19:55:46 +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
fe0c5ebec2 editor: remove useless build-configs 2012-04-10 18:31:50 +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
217bed5131 player: implement io-callbacks for loading tracks
Some demos use datafiles; let's allow these to easily work by
adding a callback-interface for loading tracks.

The callbacks are only present in player-mode, because tracks
aren't loaded from disk in client-mode.
2011-04-25 23:48:49 +02:00
Erik Faye-Lund
65c5c62e89 Merge branch 'work/dot-rocket' 2011-04-18 22:14:38 +02:00
Erik Faye-Lund
3f7a4a7fca dotrocket: add example
Create a rudimentary C# example using DX11 for rendering and XAudio2
for sound (through SlimDX). The player is hacky due to what seems to
be issues with either the implementation or documentation of XAudio2
and/or SlimDX' intergration of it.
2011-04-18 22:00:13 +02:00
Anders Knive Lassen
a5e224713a contrib: add .net bindings
DotRocket is a C++/CLI assembly that binds the C-api to Managed
objects for .NET.
2011-04-16 13:47:31 +02: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
b3825514b2 player: amiga-support
Proper Amiga-suport is supplied by using the AmiTCP stack when
USE_AMITCP is enabled. Add explicit OpenLibrary/CloseLibrary
calls, for those people who don't link against auto-opening
libs ala VBCC's auto.s.

Add a typedef for uint32_t (needed for network communication)
for Motorola 68k platforms.

Also add a SAS/C support for the 'inline' keyword.

Thanks to Aske Simon Christensen for help with the SAS/C support.
2011-03-21 22:13:30 +01:00
Erik Faye-Lund
dbe3cc7dcf player: reorganize compatibility checks
The current layout of the compatibility checks makes is a bit
tricky to reuse parts of a platforms quirk-arounds when adding
compiler-support.

Reorganize into three sections:
- inline support
- CRT features
- socket-stack
2011-03-17 00:54:32 +01:00
Erik Faye-Lund
4c8769c630 player: close socket on socket-error
While we're at it, make sure we always delete all the data before
trying to re-request. This we won't get out of sync on socket-error
at that particular location.
2011-01-26 22:23:45 +01:00
Erik Faye-Lund
94a88abab0 player: merge sync_connect and purge_and_rerequest
This function has only one call-site, and is trivial. Inline it
into it's caller instead.
2011-01-26 22:23:32 +01:00
Erik Faye-Lund
0c8cc404ff player: be consistent, return -1 on error
Previously some functions returned 1 and some returned -1 on
error. There were also two internal functions that returned 0
on error and 1 on 0 on success. Fix this, and make sure we
always return -1 on error and 0 on success.
2011-01-26 22:22:04 +01:00
Erik Faye-Lund
55f2508283 player: add some comments
The code is horribly undocumented as is. Try to improve this by
adding some comments in the most important parts.
2011-01-26 21:41:28 +01: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
5efe69d845 player: catch malloc-failures
There were a couple of places where malloc-failures (out-of-memory,
really) weren't caught. This isn't a big deal on modern operating
systems, but is worth dealing with on low-end platforms.

Failures to add/delete keys should count as socket-errors, because
they cause the editor and client to become out of sync.
2011-01-26 21:20:38 +01:00
Erik Faye-Lund
e3ee8c2432 Merge branch 'work/for-master' into work/example-fixes
Conflicts:
	example_bass/example_bass.cpp
2011-01-26 00:16:27 +01:00
Erik Faye-Lund
98a6974cc9 example_bass: use BASS_STREAM_PRESCAN
When seeking in MP3s, BASS needs the BASS_STREAM_PRESCAN-flag to enable
accurate seeking.

While our example uses OGG Vorbis instead of MP3, it doesn't hurt to set
the flag, and leaves one less bug-source for people who base their code
of the example.
2011-01-26 00:13:54 +01:00
Erik Faye-Lund
0cf8728242 makefile: support building example_bass
Add the juice needed to make example_bass buildable from the Makefile.

This should be compatible with MinGW and Linux.
2011-01-26 00:13:53 +01:00
Erik Faye-Lund
0b1ca80464 example_bass: fix compilation on 64bit linux
HSTREAM is a DWORD on 64-bit linux, so let's just pass the address
of the stack-allocated object instead.
2011-01-26 00:13:47 +01:00
Erik Faye-Lund
8a49fd3c05 player: fix potential buffer overflow
Previously, sync_track_path could either overflow it's 'temp'
buffer by one byte, or (even worse) end up not zero-terminating
it.

Correct the code by explicitly zero-terminating the result of
strncpy, and reducing the lenght-parameter to strncat.
2011-01-25 23:39:06 +01:00
Erik Faye-Lund
1044584639 player: fixup some constness 2011-01-25 23:39:06 +01:00
Erik Faye-Lund
c570d58962 player: remove useless include 2011-01-25 23:39:05 +01:00
Erik Faye-Lund
9324a1180b player: unify loader-code a bit
Unify the interface for load_track_data() and request_track_data(),
as they essentially perform the same task, but for different
compile-time configurations.
2011-01-25 23:39:05 +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
5bfd04f55b player: pass callback directly to sync_update
sync_update is the only code-path that can end up calling any of the
callbacks, so there's no need to store it in the device.

This is a breaking change, so all users needs to update their code
accordingly.
2011-01-25 04:10:39 +01:00
Erik Faye-Lund
a3da5fe361 Merge branch 'rk/example-opengl' 2011-01-15 16:29:43 +01:00
Erik Faye-Lund
2b86c31b5a makefile: add all object files to archive
For some reason I haven't noticed until now that the Makefile
only added the first object-file to the library. Fix that.
2011-01-14 00:40:13 +01:00
Erik Faye-Lund
81e4455f16 contrib: remove broken c++-wrapper 2011-01-14 00:38:43 +01:00