Browse Source

Fix the types of a few function parameters.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4546 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 13 years ago
parent
commit
7173037afc
9 changed files with 59 additions and 58 deletions
  1. +2
    -2
      common/JackAPI.cpp
  2. +2
    -2
      common/JackClient.cpp
  3. +1
    -1
      common/JackClient.h
  4. +5
    -5
      common/JackMidiAPI.cpp
  5. +8
    -8
      common/JackTransportEngine.cpp
  6. +27
    -27
      common/JackTransportEngine.h
  7. +4
    -4
      common/jack/midiport.h
  8. +9
    -9
      common/jack/transport.h
  9. +1
    -0
      macosx/Jackdmp.xcodeproj/project.pbxproj

+ 2
- 2
common/JackAPI.cpp View File

@@ -214,7 +214,7 @@ extern "C"
jack_position_t *pos); jack_position_t *pos);
LIB_EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client); LIB_EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t *client);
LIB_EXPORT int jack_transport_reposition(jack_client_t *client, LIB_EXPORT int jack_transport_reposition(jack_client_t *client,
jack_position_t *pos);
const jack_position_t *pos);
LIB_EXPORT void jack_transport_start(jack_client_t *client); LIB_EXPORT void jack_transport_start(jack_client_t *client);
LIB_EXPORT void jack_transport_stop(jack_client_t *client); LIB_EXPORT void jack_transport_stop(jack_client_t *client);
LIB_EXPORT void jack_get_transport_info(jack_client_t *client, LIB_EXPORT void jack_get_transport_info(jack_client_t *client,
@@ -1626,7 +1626,7 @@ LIB_EXPORT jack_nframes_t jack_get_current_transport_frame(const jack_client_t*
} }
} }


LIB_EXPORT int jack_transport_reposition(jack_client_t* ext_client, jack_position_t* pos)
LIB_EXPORT int jack_transport_reposition(jack_client_t* ext_client, const jack_position_t* pos)
{ {
#ifdef __CLIENTDEBUG__ #ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_transport_reposition"); JackGlobals::CheckContext("jack_transport_reposition");


+ 2
- 2
common/JackClient.cpp View File

@@ -848,14 +848,14 @@ void JackClient::TransportLocate(jack_nframes_t frame)
GetEngineControl()->fTransport.RequestNewPos(&pos); GetEngineControl()->fTransport.RequestNewPos(&pos);
} }


int JackClient::TransportReposition(jack_position_t* pos)
int JackClient::TransportReposition(const jack_position_t* pos)
{ {
jack_position_t tmp = *pos; jack_position_t tmp = *pos;
jack_log("JackClient::TransportReposition pos = %ld", pos->frame); jack_log("JackClient::TransportReposition pos = %ld", pos->frame);
if (tmp.valid & ~JACK_POSITION_MASK) { if (tmp.valid & ~JACK_POSITION_MASK) {
return EINVAL; return EINVAL;
} else { } else {
GetEngineControl()->fTransport.RequestNewPos(pos);
GetEngineControl()->fTransport.RequestNewPos(&tmp);
return 0; return 0;
} }
} }


+ 1
- 1
common/JackClient.h View File

@@ -164,7 +164,7 @@ class SERVER_EXPORT JackClient : public JackClientInterface, public JackRunnable
virtual void TransportLocate(jack_nframes_t frame); virtual void TransportLocate(jack_nframes_t frame);
virtual jack_transport_state_t TransportQuery(jack_position_t* pos); virtual jack_transport_state_t TransportQuery(jack_position_t* pos);
virtual jack_nframes_t GetCurrentTransportFrame(); virtual jack_nframes_t GetCurrentTransportFrame();
virtual int TransportReposition(jack_position_t* pos);
virtual int TransportReposition(const jack_position_t* pos);
virtual void TransportStart(); virtual void TransportStart();
virtual void TransportStop(); virtual void TransportStop();




+ 5
- 5
common/JackMidiAPI.cpp View File

@@ -30,10 +30,10 @@ extern "C"
{ {
#endif #endif


LIB_EXPORT jack_nframes_t jack_midi_get_event_count(void* port_buffer);
LIB_EXPORT uint32_t jack_midi_get_event_count(void* port_buffer);


LIB_EXPORT int jack_midi_event_get(jack_midi_event_t* event, LIB_EXPORT int jack_midi_event_get(jack_midi_event_t* event,
void* port_buffer, jack_nframes_t event_index);
void* port_buffer, uint32_t event_index);


LIB_EXPORT void jack_midi_clear_buffer(void* port_buffer); LIB_EXPORT void jack_midi_clear_buffer(void* port_buffer);


@@ -54,7 +54,7 @@ extern "C"
using namespace Jack; using namespace Jack;


LIB_EXPORT LIB_EXPORT
jack_nframes_t jack_midi_get_event_count(void* port_buffer)
uint32_t jack_midi_get_event_count(void* port_buffer)
{ {
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer; JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (!buf || !buf->IsValid()) { if (!buf || !buf->IsValid()) {
@@ -64,7 +64,7 @@ jack_nframes_t jack_midi_get_event_count(void* port_buffer)
} }


LIB_EXPORT LIB_EXPORT
int jack_midi_event_get(jack_midi_event_t *event, void* port_buffer, jack_nframes_t event_index)
int jack_midi_event_get(jack_midi_event_t *event, void* port_buffer, uint32_t event_index)
{ {
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer; JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (!buf || !buf->IsValid()) { if (!buf || !buf->IsValid()) {
@@ -143,7 +143,7 @@ int jack_midi_event_write(void* port_buffer,
} }


LIB_EXPORT LIB_EXPORT
jack_nframes_t jack_midi_get_lost_event_count(void* port_buffer)
uint32_t jack_midi_get_lost_event_count(void* port_buffer)
{ {
JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer; JackMidiBuffer *buf = (JackMidiBuffer*)port_buffer;
if (buf && buf->IsValid()) if (buf && buf->IsValid())


+ 8
- 8
common/JackTransportEngine.cpp View File

@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.


You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -38,7 +38,7 @@ JackTransportEngine::JackTransportEngine(): JackAtomicArrayState<jack_position_t
{ {
fTransportState = JackTransportStopped; fTransportState = JackTransportStopped;
fTransportCmd = fPreviousCmd = TransportCommandStop; fTransportCmd = fPreviousCmd = TransportCommandStop;
fSyncTimeout = 10000000; /* 10 seconds default...
fSyncTimeout = 10000000; /* 10 seconds default...
in case of big netjack1 roundtrip */ in case of big netjack1 roundtrip */
fSyncTimeLeft = 0; fSyncTimeLeft = 0;
fTimeBaseMaster = -1; fTimeBaseMaster = -1;
@@ -112,8 +112,8 @@ void JackTransportEngine::MakeAllStartingLocating(JackClientInterface** table)
JackClientControl* control = client->GetClientControl(); JackClientControl* control = client->GetClientControl();
// Inactive clients don't have their process function called at all, so they must appear as already "rolling" for the transport.... // Inactive clients don't have their process function called at all, so they must appear as already "rolling" for the transport....
control->fTransportState = (control->fActive && control->fCallback[kRealTimeCallback]) ? JackTransportStarting : JackTransportRolling; control->fTransportState = (control->fActive && control->fCallback[kRealTimeCallback]) ? JackTransportStarting : JackTransportRolling;
control->fTransportSync = true;
control->fTransportTimebase = true;
control->fTransportSync = true;
control->fTransportTimebase = true;
jack_log("MakeAllStartingLocating ref = %ld", i); jack_log("MakeAllStartingLocating ref = %ld", i);
} }
} }
@@ -127,8 +127,8 @@ void JackTransportEngine::MakeAllStopping(JackClientInterface** table)
if (client) { if (client) {
JackClientControl* control = client->GetClientControl(); JackClientControl* control = client->GetClientControl();
control->fTransportState = JackTransportStopped; control->fTransportState = JackTransportStopped;
control->fTransportSync = false;
control->fTransportTimebase = false;
control->fTransportSync = false;
control->fTransportTimebase = false;
jack_log("MakeAllStopping ref = %ld", i); jack_log("MakeAllStopping ref = %ld", i);
} }
} }
@@ -142,8 +142,8 @@ void JackTransportEngine::MakeAllLocating(JackClientInterface** table)
if (client) { if (client) {
JackClientControl* control = client->GetClientControl(); JackClientControl* control = client->GetClientControl();
control->fTransportState = JackTransportStopped; control->fTransportState = JackTransportStopped;
control->fTransportSync = true;
control->fTransportTimebase = true;
control->fTransportSync = true;
control->fTransportTimebase = true;
jack_log("MakeAllLocating ref = %ld", i); jack_log("MakeAllLocating ref = %ld", i);
} }
} }


+ 27
- 27
common/JackTransportEngine.h View File

@@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.


You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -48,43 +48,43 @@ We have:
The current position can be read by clients. The current position can be read by clients.


We use a JackAtomicArrayState pattern that allows to manage several "next" states independantly. We use a JackAtomicArrayState pattern that allows to manage several "next" states independantly.
In jack1 implementation, transport code (jack_transport_cycle_end) was not called if the graph could not be locked (see jack_run_one_cycle). In jack1 implementation, transport code (jack_transport_cycle_end) was not called if the graph could not be locked (see jack_run_one_cycle).
Here transport cycle (CycleBegin, CycleEnd) has to run in the RT thread concurrently with code executed from the "command" thread. Here transport cycle (CycleBegin, CycleEnd) has to run in the RT thread concurrently with code executed from the "command" thread.
Each client maintains a state in it's shared memory area defined by: Each client maintains a state in it's shared memory area defined by:
- it's current transport state - it's current transport state
- a boolean that is "true" when slow-sync cb has to be called - a boolean that is "true" when slow-sync cb has to be called
- a boolean that is "true" when timebase cb is called with new_pos on - a boolean that is "true" when timebase cb is called with new_pos on
Several operations set the "slow-sync cb" flag to true: Several operations set the "slow-sync cb" flag to true:
- setting a new cb (client) - setting a new cb (client)
- activate (client) - activate (client)
- transport start (server) - transport start (server)
- new pos (server) - new pos (server)
Slow-sync cb calls stops when: Slow-sync cb calls stops when:
- the cb return true (client) - the cb return true (client)
- desactivate (client) - desactivate (client)
- transport stop (server) - transport stop (server)
Several operations set the "timebase cb" flag to true: Several operations set the "timebase cb" flag to true:
- setting a new cb (client) - setting a new cb (client)
- activate (client) - activate (client)
- transport start (server) ?? - transport start (server) ??
- new pos (server) - new pos (server)
Timebase cb "new_pos" argument calls stops when: Timebase cb "new_pos" argument calls stops when:
- after one cb call with "new_pos" argument true (client) - after one cb call with "new_pos" argument true (client)
- desactivate (client) - desactivate (client)
- release (client) - release (client)
- transport stop (server) - transport stop (server)
*/ */


class JackClientInterface; class JackClientInterface;
@@ -109,7 +109,7 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_posit
void MakeAllStartingLocating(JackClientInterface** table); void MakeAllStartingLocating(JackClientInterface** table);
void MakeAllStopping(JackClientInterface** table); void MakeAllStopping(JackClientInterface** table);
void MakeAllLocating(JackClientInterface** table); void MakeAllLocating(JackClientInterface** table);
void SyncTimeout(jack_nframes_t frame_rate, jack_nframes_t buffer_size); void SyncTimeout(jack_nframes_t frame_rate, jack_nframes_t buffer_size);


public: public:
@@ -128,22 +128,22 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_posit
{ {
return fTransportState; return fTransportState;
} }
void SetState(jack_transport_state_t state) void SetState(jack_transport_state_t state)
{ {
fTransportState = state; fTransportState = state;
} }
/* /*
\brief
\brief
*/ */
int ResetTimebase(int refnum); int ResetTimebase(int refnum);


/* /*
\brief
\brief
*/ */
int SetTimebaseMaster(int refnum, bool conditionnal); int SetTimebaseMaster(int refnum, bool conditionnal);
void GetTimebaseMaster(int& refnum, bool& conditionnal) void GetTimebaseMaster(int& refnum, bool& conditionnal)
{ {
refnum = fTimeBaseMaster; refnum = fTimeBaseMaster;
@@ -151,17 +151,17 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_posit
} }


/* /*
\brief
\brief
*/ */
void CycleBegin(jack_nframes_t frame_rate, jack_time_t time); void CycleBegin(jack_nframes_t frame_rate, jack_time_t time);


/* /*
\brief
\brief
*/ */
void CycleEnd(JackClientInterface** table, jack_nframes_t frame_rate, jack_nframes_t buffer_size); void CycleEnd(JackClientInterface** table, jack_nframes_t frame_rate, jack_nframes_t buffer_size);


/* /*
\brief
\brief
*/ */
void SetSyncTimeout(jack_time_t timeout) void SetSyncTimeout(jack_time_t timeout)
{ {
@@ -174,20 +174,20 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_posit
{ {
return (jack_unique_t)INC_ATOMIC(&fWriteCounter); return (jack_unique_t)INC_ATOMIC(&fWriteCounter);
} }
void RequestNewPos(jack_position_t* pos); void RequestNewPos(jack_position_t* pos);
jack_transport_state_t Query(jack_position_t* pos); jack_transport_state_t Query(jack_position_t* pos);
jack_nframes_t GetCurrentFrame(); jack_nframes_t GetCurrentFrame();


static void CopyPosition(jack_position_t* from, jack_position_t* to); static void CopyPosition(jack_position_t* from, jack_position_t* to);
bool GetNetworkSync() const bool GetNetworkSync() const
{ {
return fNetworkSync; return fNetworkSync;
} }
void SetNetworkSync(bool sync) void SetNetworkSync(bool sync)
{ {
fNetworkSync = sync; fNetworkSync = sync;


+ 4
- 4
common/jack/midiport.h View File

@@ -53,7 +53,7 @@ typedef struct _jack_midi_event
* @param port_buffer Port buffer from which to retrieve event. * @param port_buffer Port buffer from which to retrieve event.
* @return number of events inside @a port_buffer * @return number of events inside @a port_buffer
*/ */
jack_nframes_t
uint32_t
jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT; jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;




@@ -70,8 +70,8 @@ jack_midi_get_event_count(void* port_buffer) JACK_OPTIONAL_WEAK_EXPORT;
*/ */
int int
jack_midi_event_get(jack_midi_event_t *event, jack_midi_event_get(jack_midi_event_t *event,
void *port_buffer,
jack_nframes_t event_index) JACK_OPTIONAL_WEAK_EXPORT;
void *port_buffer,
uint32_t event_index) JACK_OPTIONAL_WEAK_EXPORT;




/** Clear an event buffer. /** Clear an event buffer.
@@ -158,7 +158,7 @@ jack_midi_event_write(void *port_buffer,
* @param port_buffer Port to receive count for. * @param port_buffer Port to receive count for.
* @returns Number of events that could not be written to @a port_buffer. * @returns Number of events that could not be written to @a port_buffer.
*/ */
jack_nframes_t
uint32_t
jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT; jack_midi_get_lost_event_count(void *port_buffer) JACK_OPTIONAL_WEAK_EXPORT;


/*@}*/ /*@}*/


+ 9
- 9
common/jack/transport.h View File

@@ -1,19 +1,19 @@
/* /*
Copyright (C) 2002 Paul Davis Copyright (C) 2002 Paul Davis
Copyright (C) 2003 Jack O'Quin Copyright (C) 2003 Jack O'Quin
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details. GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


*/ */
@@ -135,7 +135,7 @@ int jack_set_timebase_callback (jack_client_t *client,
* sync_callbacks until ready. This function is realtime-safe. * sync_callbacks until ready. This function is realtime-safe.
* *
* @see jack_transport_reposition, jack_set_sync_callback * @see jack_transport_reposition, jack_set_sync_callback
*
*
* @param client the JACK client structure. * @param client the JACK client structure.
* @param frame frame number of new transport position. * @param frame frame number of new transport position.
* *
@@ -170,7 +170,7 @@ jack_transport_state_t jack_transport_query (const jack_client_t *client,
* @param client the JACK client structure * @param client the JACK client structure
*/ */
jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT; jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JACK_OPTIONAL_WEAK_EXPORT;
/** /**
* Request a new transport position. * Request a new transport position.
* *
@@ -181,14 +181,14 @@ jack_nframes_t jack_get_current_transport_frame (const jack_client_t *client) JA
* sync_callbacks until ready. This function is realtime-safe. * sync_callbacks until ready. This function is realtime-safe.
* *
* @see jack_transport_locate, jack_set_sync_callback * @see jack_transport_locate, jack_set_sync_callback
*
*
* @param client the JACK client structure. * @param client the JACK client structure.
* @param pos requested new transport position. * @param pos requested new transport position.
* *
* @return 0 if valid request, EINVAL if position structure rejected. * @return 0 if valid request, EINVAL if position structure rejected.
*/ */
int jack_transport_reposition (jack_client_t *client, int jack_transport_reposition (jack_client_t *client,
jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;
const jack_position_t *pos) JACK_OPTIONAL_WEAK_EXPORT;


/** /**
* Start the JACK transport rolling. * Start the JACK transport rolling.
@@ -239,7 +239,7 @@ void jack_set_transport_info (jack_client_t *client,
jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT; jack_transport_info_t *tinfo) JACK_OPTIONAL_WEAK_EXPORT;


/*@}*/ /*@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif


+ 1
- 0
macosx/Jackdmp.xcodeproj/project.pbxproj View File

@@ -6170,6 +6170,7 @@
isa = PBXProject; isa = PBXProject;
buildConfigurationList = 4B699DD5097D427F00A18468 /* Build configuration list for PBXProject "Jackdmp" */; buildConfigurationList = 4B699DD5097D427F00A18468 /* Build configuration list for PBXProject "Jackdmp" */;
compatibilityVersion = "Xcode 2.4"; compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1; hasScannedForEncodings = 1;
knownRegions = ( knownRegions = (
English, English,


Loading…
Cancel
Save