コード例 #1
0
ファイル: adj_GraphOracle.cpp プロジェクト: ptierney/AutoDJ
void GraphOracle::query_best_connection(SongId id) {

    // THIS IS CROWDTAP SPECIFIC CODE TO BE REPLACED

    SongId other_id = PlayManager::instance().now_playing()->song().id();

    GraphNodeFactory::instance().add_pair_request(PairRequest(id, other_id));

    return;


    // THIS IS DUMMY CODE TO BE REPLACED

    other_id = SongFactory::instance().get_random_song_id();

    while (other_id == id || (GraphNodeFactory::instance().song_map().find(
        other_id) == GraphNodeFactory::instance().song_map().end())) {
        other_id = SongFactory::instance().get_random_song_id();
    }

    GraphNodeFactory::instance().add_pair_request(PairRequest(id, other_id));

    return;
    
    // BEGIN ACTUAL CODE!!!

   SingleGraphOracleQuery query(id);

   prune_threads();

   threads_.push_back(ThreadPtr(new boost::thread(query)));
}
コード例 #2
0
nsresult
BluetoothServiceChildProcess::CreatePairedDeviceInternal(
  const BluetoothAddress& aDeviceAddress, int aTimeout,
  BluetoothReplyRunnable* aRunnable)
{
  SendRequest(aRunnable, PairRequest(aDeviceAddress, aTimeout));
  return NS_OK;
}
コード例 #3
0
nsresult
BluetoothServiceChildProcess::CreatePairedDeviceInternal(
                                              const nsAString& aAdapterPath,
                                              const nsAString& aAddress,
                                              int aTimeout,
                                              BluetoothReplyRunnable* aRunnable)
{
  SendRequest(aRunnable,
              PairRequest(nsString(aAdapterPath), nsString(aAddress), aTimeout));
  return NS_OK;
}