Beispiel #1
0
//transport---------------------------------------------------------------------------
    void JackNetAdapter::DecodeTransportData()
    {
        //TODO : we need here to get the actual timebase master to eventually release it from its duty (see JackNetDriver)

        //is there a new transport state ?
        if (fSendTransportData.fNewState &&(fSendTransportData.fState != jack_transport_query(fClient, NULL))) {
            switch (fSendTransportData.fState)
            {
                case JackTransportStopped :
                    jack_transport_stop(fClient);
                    jack_info("NetMaster : transport stops");
                    break;

                case JackTransportStarting :
                    jack_transport_reposition(fClient, &fSendTransportData.fPosition);
                    jack_transport_start(fClient);
                    jack_info("NetMaster : transport starts");
                    break;

                case JackTransportRolling :
                    // TODO, we need to :
                    // - find a way to call TransportEngine->SetNetworkSync()
                    // - turn the transport state to JackTransportRolling
                    jack_info("NetMaster : transport rolls");
                    break;
            }
        }
    }
Beispiel #2
0
static PyObject* transport_start (PyObject* self, PyObject* args)
{
    pyjack_client_t * client = self_or_global_client(self);
    if(client->pjc == NULL) {
        PyErr_SetString(JackNotConnectedError, "Jack connection has not yet been established.");
        return NULL;
    }

    jack_transport_start (client->pjc);

    return Py_None;
}
Beispiel #3
0
void
Transport::start ( void )
{
//    MESSAGE( "Starting transport" );
    if ( _record_button->value() )
    {
        rolling = true;
        update_record_state();
    }

    jack_transport_start( client );
}
Beispiel #4
0
void JackOutput::play()
{
	Preferences* P = Preferences::get_instance();
	if ( P->m_bJackTransportMode == Preferences::USE_JACK_TRANSPORT ||
		 P->m_bJackMasterMode == Preferences::USE_JACK_TIME_MASTER
		 ) {
		if ( client ) {
			INFOLOG( "jack_transport_start()" );
			jack_transport_start( client );
		}
	} else {
		m_transport.m_status = TransportInfo::ROLLING;
	}
}
Beispiel #5
0
static void cbox_jackio_control_transport(struct cbox_io_impl *impl, gboolean roll, uint32_t pos)
{
    struct cbox_jack_io_impl *jii = (struct cbox_jack_io_impl *)impl;

    if (jii->debug_transport)
        g_message("JACK transport: control(op=%s, pos=%d)\n", roll ? "roll" : "stop", (int)pos);

    jack_transport_state_t state = jack_transport_query(jii->client, NULL);    
    if (roll && state == JackTransportStopped)
        jack_transport_start(jii->client);
    if (!roll && state != JackTransportStopped)
        jack_transport_stop(jii->client);
    
    if (pos != (uint32_t)-1)
        jack_transport_locate(jii->client, pos);
}
static gboolean
gst_jack_ring_buffer_start (GstRingBuffer * buf)
{
  GstJackAudioSrc *src;

  src = GST_JACK_AUDIO_SRC (GST_OBJECT_PARENT (buf));

  GST_DEBUG_OBJECT (src, "start");

  if (src->transport & GST_JACK_TRANSPORT_MASTER) {
    jack_client_t *client;

    client = gst_jack_audio_client_get_client (src->client);
    jack_transport_start (client);
  }

  return TRUE;
}
Beispiel #7
0
static void on_jack_start( mlt_properties owner, mlt_properties properties )
{
	mlt_log_verbose( NULL, "%s\n", __FUNCTION__ );
	jack_client_t *jack_client = mlt_properties_get_data( properties, "jack_client", NULL );
	jack_transport_start( jack_client );
}
static void jack_transport_starter(jack_transport_t * x)
{
	jack_transport_start(x->x_jack_client);
	return;
}
Beispiel #9
0
static void com_play(char *arg)
{
	jack_transport_start(client);
}
Beispiel #10
0
static void do_jack(jack_client_t* client, char *button, int bk)
{
    black_keys = bk;

    // Jack Transport
    if (button[0] && (button[0] != button_prev_val[0])) //select :: Change octave
    {
        if (oct == 0) {
          oct = 1; //C6
          if (debug) printf("STAT: Changed base octave to C6\n");
        } else if (oct == 1) {
          oct = 2; //C7
          if (debug) printf("STAT: Changed base octave to C7\n");
        } else if (oct == 2) {
          oct = -2; //C3
          if (debug) printf("STAT: Changed base octave to C3\n");
        } else if (oct == -2) {
          oct = -1; //C4
          if (debug) printf("STAT: Changed base octave to C4\n");
        } else {
          oct = 0; //C5
          if (debug) printf("STAT: Changed base octave to C5\n");
        }
    }
    else if (button[3] && (button[3] != button_prev_val[3])) //start :: Start/Stop Transport
    {
        state = jack_transport_query(client, NULL);
        if (state) {
          jack_transport_stop(client);
          if (debug) printf("STAT: Transport stopped\n");
        } else {
          jack_transport_start(client);
          if (debug) printf("STAT: Transport started\n");
        }
    }

    if (button[16] && (button[16] != button_prev_val[16])) //PS :: Panic button
    {
        if (debug) printf("STAT: Panic!\n");
        jack_transport_stop(client);
        jack_transport_locate(client, 0);
        jack_transport_stop(client);
        int h;
        for (h=8; h<20; h++) {
            axis[h] = 0;
            axis_prev_velocity[h] = 0;
        }
    }
    else if (button[1]) //L3 :: Move transport backwards
    {
        jack_transport_query(client, &position);
        int prevJackFrame = position.frame - 100000;
        if (prevJackFrame < 0) prevJackFrame = 0;
        jack_transport_locate(client, prevJackFrame);
        if (button[1] != button_prev_val[1])
          if (debug) printf("STAT: Transport backwards...\n");
    }
    else if (button[1] != button_prev_val[1])
    {
          if (debug) printf("STAT: Transport normal\n");
    }
    else if (button[2]) //R3 :: Move transport forwards
    {
        jack_transport_query(client, &position);
        int nextJackFrame = position.frame + 100000;
        jack_transport_locate(client, nextJackFrame);
        if (button[2] != button_prev_val[2])
          if (debug) printf("STAT: Transport forwards...\n");
    }
    else if (button[2] != button_prev_val[2])
    {
          if (debug) printf("STAT: Transport normal\n");
    }

    button_prev_val[0] = button[0];
    button_prev_val[1] = button[1];
    button_prev_val[2] = button[2];
    button_prev_val[3] = button[3];
    button_prev_val[16] = button[16];

}
Beispiel #11
0
void jackt_start() {
	if (jack_client) {
		jack_transport_start (jack_client);
	}
}
Beispiel #12
0
void
audioStreamer_JACK::timebase_cb(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos ) {

    static double jack_tick;
    static jack_nframes_t last_frame;
    static jack_nframes_t current_frame;
    jack_position_t cur_pos;
    static jack_transport_state_t state_current;
    static jack_transport_state_t state_last;
    static int locating = 0;

#if 0
    if( state != JackTransportRolling )
    {
      jack_transport_locate( client, 0 );
      jack_transport_start( client );
    }
#endif

    if( !njc ) return;

    int posi, len;
    njc->GetPosition(&posi,&len);
    float bpm = njc->GetActualBPM();

    //posi = njc->GetSessionPosition() * m_srate / 1000;
    //len = (int)(njc->GetBPI() * m_srate * 60 / bpm);

    // sync jack_transport_frame to njframe

    //current_frame = jack_get_current_transport_frame( client );
    jack_transport_query(client, &cur_pos);
    current_frame = cur_pos.frame;

    // FIXME: This will not work right, if there are slow-sync clients....

    int diff = abs(current_frame % len) - (posi % len);

    if( diff > nframes ) {
#if 1
	jack_transport_locate( client, (current_frame / len) * len + (posi%len) + 2*nframes );

	//printf( "no:  current= %d diff = %d\n", (current_frame % len) -  (posi % len), diff );
#endif
    }

    // taken from seq24-0.7.0 perform.cpp

    state_current = state;


    //printf( "jack_timebase_callback() [%d] [%d] [%d]", state, new_pos, current_frame);

    pos->valid = JackPositionBBT;
    pos->beats_per_bar = 4;
    pos->beat_type = 4;
    pos->ticks_per_beat = c_ppqn * 10;
    pos->beats_per_minute = bpm;


    /* Compute BBT info from frame number.  This is relatively
     * simple here, but would become complex if we supported tempo
     * or time signature changes at specific locations in the
     * transport timeline. */

    // if we are in a new position
    if (  state_last    ==  JackTransportStarting &&
          state_current ==  JackTransportRolling ){

        //printf ( "Starting [%d] [%d]\n", last_frame, current_frame );

        jack_tick = 0.0;
        last_frame = current_frame;
    }

    if ( current_frame > last_frame ){

        double jack_delta_tick =
            (current_frame - last_frame) *
            pos->ticks_per_beat *
            pos->beats_per_minute / (pos->frame_rate * 60.0);

        jack_tick += jack_delta_tick;

        last_frame = current_frame;
    }

    long ptick = 0, pbeat = 0, pbar = 0;

    pbar  = (long) ((long) jack_tick / (pos->ticks_per_beat *  pos->beats_per_bar ));

    pbeat = (long) ((long) jack_tick % (long) (pos->ticks_per_beat *  pos->beats_per_bar ));
    pbeat = pbeat / (long) pos->ticks_per_beat;

    ptick = (long) jack_tick % (long) pos->ticks_per_beat;

    pos->bar = pbar + 1;
    pos->beat = pbeat + 1;
    pos->tick = ptick;;
    pos->bar_start_tick = pos->bar * pos->beats_per_bar *
        pos->ticks_per_beat;

    //printf( " bbb [%2d:%2d:%4d]\n", pos->bar, pos->beat, pos->tick );

    state_last = state_current;

}
Beispiel #13
0
Datei: Client.C Projekt: 0mk/non
 void
 Client::transport_start ( )
 {
     jack_transport_start( _client );
 }
Beispiel #14
0
void jackStart() {
	if (api == SYS_API_JACK) {
		jack_client_t *client = jackGetHandle();
		jack_transport_start(client);
	}
}
void AUD_JackDevice::startPlayback()
{
	jack_transport_start(m_client);
	m_nextState = JackTransportRolling;
}
Beispiel #16
0
int 
main(int argc, char *argv[])
{
	int		ch;
	char		*file_name, *autoconnect_port_name = NULL;


#ifdef WITH_LASH
	lash_args_t *lash_args;
#endif

	g_thread_init(NULL);

#ifdef WITH_LASH
	lash_args = lash_extract_args(&argc, &argv);
#endif

	g_log_set_default_handler(log_handler, NULL);

	while ((ch = getopt(argc, argv, "a:dnqr:stVx")) != -1) {
		switch (ch) {
			case 'a':
				autoconnect_port_name = strdup(optarg);
				break;

			case 'd':
				debug = 1;
				break;

			case 'n':
				start_stopped = 1;
				break;

			case 'q':
				be_quiet = 1;
				break;

			case 'r':
				rate_limit = strtod(optarg, NULL);
				if (rate_limit <= 0.0) {
					g_critical("Invalid rate limit specified.\n");

					exit(EX_USAGE);
				}

				break;

			case 's':
				just_one_output = 1;
				break;

			case 't':
				use_transport = 0;
				break;

            case 'x':
                    remote_control = 1;
                    break;

			case 'V':
				show_version();
				break;

			case '?':
			default:
				usage();
				break;
		}
	}

	argc -= optind;
	argv += optind;

	if (argv[0] == NULL) {
		g_critical("No file name given.");
		usage();
	}

	file_name = argv[0];

	if (!remote_control) {
	smf_vol = smf = smf_load(file_name);

	if (smf == NULL) {
		g_critical("Loading SMF file failed.");

		exit(-1);
	}

	if (!be_quiet)
		g_message("%s.", smf_decode(smf));

	if (smf->number_of_tracks > MAX_NUMBER_OF_TRACKS) {
		g_warning("Number of tracks (%d) exceeds maximum for per-track output; implying '-s' option.", smf->number_of_tracks);
		just_one_output = 1;
	}
	}

#ifdef WITH_LASH
	init_lash(lash_args);
#endif

	g_timeout_add(1000, emergency_exit_timeout, (gpointer)0);
	signal(SIGINT, ctrl_c_handler);

	init_jack();

	if (autoconnect_port_name) {
		if (connect_to_input_port(autoconnect_port_name)) {
			g_critical("Couldn't connect to '%s', exiting.", autoconnect_port_name);
			exit(EX_UNAVAILABLE);
		}
	}

	if (use_transport && !start_stopped) {
		jack_transport_locate(jack_client, 0);
		jack_transport_start(jack_client);
	}

	if (!use_transport)
		playback_started = jack_frame_time(jack_client);

	if (remote_control)
		remote_control_start(argv[0]);

	g_main_loop_run(g_main_loop_new(NULL, TRUE));

	/* Not reached. */

	return 0;
}
Beispiel #17
0
//------------------------------------------------------------------------
void TJackSynchro::StartSync()
{
    assert(fClient);
    jack_transport_locate(fClient, 0);
    jack_transport_start(fClient);
}
Beispiel #18
0
//------------------------------------------------------------------------
void TJackSynchro::ContSync()
{
    assert(fClient);
    jack_transport_start(fClient);
}
Beispiel #19
0
Datei: jack.c Projekt: rknLA/rove
void rove_transport_start() {
	jack_transport_start(state.client);
}
Beispiel #20
0
void luajack_transport_start(luajack_t *client)
	{
	cud_t *cud = get_cud(client);	
	if(cud)
		jack_transport_start(cud->client);
	}