/* ----------------------------------------------------------- rtgetsamps --- */ void RTcmix::rtgetsamps(AudioDevice *inputDevice) { float *in; int i,j; int bsamps, nchans; assert(Option::record() == true); // BGG mm // maxmsp_inbuf is a pointer to a max/msp buffer, passed in via // maxmsp_rtsetparams bsamps = bufsamps(); nchans = chans(); in = maxmsp_inbuf; for(i = 0; i < bsamps; i++) for (j = 0; j < nchans; j++) audioin_buffer[j][i] = *in++ * IN_GAIN_FACTOR; return; // BGG mm -- this isn't used in max/msp if (inputDevice->getFrames(audioin_buffer, RTBUFSAMPS) < 0) { fprintf(stderr, "rtgetsamps error: %s\n", inputDevice->getLastError()); } }
/* ----------------------------------------------------------- rtgetsamps --- */ void RTcmix::rtgetsamps(AudioDevice *inputDevice) { assert(Option::record() == true); #ifndef MAXMSP if (inputDevice->getFrames(audioin_buffer, RTBUFSAMPS) < 0) { rtcmix_warn("rtgetsamps", "%s\n", inputDevice->getLastError()); } #else // MAXMSP // BGG mm // maxmsp_inbuf is a pointer to a max/msp buffer, passed via maxmsp_rtsetparams #ifdef IOS short *in = maxmsp_inbuf; #else float *in = maxmsp_inbuf; #endif for(int i = 0; i < RTBUFSAMPS; i++) for (int j = 0; j < chans(); j++) #ifdef IOS audioin_buffer[j][i] = *in++; #else audioin_buffer[j][i] = *in++ * IN_GAIN_FACTOR; #endif return; #endif // MAXMSP }
void round_two() { std::cout << "Opening existing file test.hdf5r\n"; // Open the HDF5 file hdf5r::HDF5R f("test.hdf5r", hdf5r::RDONLY); std::cout << "File tags:\n"; std::map<std::string, hdf5r::TagType> tags(f.get_tags()); std::for_each(tags.begin(), tags.end(), print_tag_fun(f)); // Show the number of channels std::cout << "Number of channels in the file: " << f.channels().size() << '\n'; // Print out some interesting file information std::vector<hdf5r::ChannelID> chans(f.channels()); std::for_each(chans.begin(), chans.end(), print_chan_fun(f)); // Print out the data, one channel at a time std::for_each(chans.begin(), chans.end(), print_chan_data_fun(f)); // Print out the data in time order // Print out the index std::cout << "Index:\n"; hdf5r::Index index = f.index(); std::for_each(index.begin(), index.end(), print_index_fun()); }
void MainWindow::checkTextSettings() { QFont consfont; if (consfont.fromString(settings.consolefont)) { if (consfont!=consolebrowser->font()) consolebrowser->setFont(consfont); } QFont textfont; if (textfont.fromString(settings.chatfont)) { QHashIterator<QString, IrcTextBrowser *> chans(channelsJoined); while (chans.hasNext()) { chans.next(); IrcTextBrowser * brwsr = chans.value(); brwsr->setFont(textfont); } QHashIterator<QString, MessageDialog *> chats(usersChatting); while (chats.hasNext()) { chats.next(); MessageDialog *msgdlg = chats.value(); msgdlg->setFont(textfont); } } }
void MainWindow::disconnectFromServer() { irc->disconnectFromServer(); ui->treeWidget->clearAllChannels(); QHashIterator<QString, IrcTextBrowser *> chans(channelsJoined); while (chans.hasNext()) { chans.next(); IrcTextBrowser *browser = chans.value(); int idx = ui->tabWidget->indexOf(browser); ui->tabWidget->removeTab(idx); delete browser; } channelsJoined.clear(); QHashIterator<QString, MessageDialog *> chats(usersChatting); while(chats.hasNext()) { chats.next(); MessageDialog *dlg = chats.value(); dlg->close(); delete dlg; } usersChatting.clear(); }
static void JoinChannels(LocalUser* u, const std::string& chanlist) { irc::commasepstream chans(chanlist); std::string chan; while (chans.GetToken(chan)) { if (ServerInstance->IsChannel(chan)) Channel::JoinUser(u, chan); } }