本文整理汇总了C++中Track::GetMute方法的典型用法代码示例。如果您正苦于以下问题:C++ Track::GetMute方法的具体用法?C++ Track::GetMute怎么用?C++ Track::GetMute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::GetMute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CountTracksAndLabels
void ExportMultiple::CountTracksAndLabels()
{
mLabels = NULL;
mNumLabels = 0;
mNumWaveTracks = 0;
Track* pTrack;
for (pTrack = mIterator->First(mTracks); pTrack != NULL; pTrack = mIterator->Next())
{
switch (pTrack->GetKind())
{
// Count WaveTracks, and for linked pairs, count only the second of the pair.
case Track::Wave:
{
if (!pTrack->GetMute() && !pTrack->GetLinked()) // Don't count muted tracks.
mNumWaveTracks++;
break;
}
// Only support one label track???
case Track::Label:
{
// Supports only one LabelTrack.
if (mLabels == NULL) {
mLabels = (LabelTrack*)pTrack;
mNumLabels = mLabels->GetNumLabels();
}
break;
}
}
}
}
示例2: GetNumExportChannels
int TrackList::GetNumExportChannels(bool selectionOnly)
{
/* counters for tracks panned different places */
int numLeft = 0;
int numRight = 0;
int numMono = 0;
/* track iteration kit */
Track *tr;
TrackListIterator iter;
for (tr = iter.First(this); tr != NULL; tr = iter.Next()) {
// Want only unmuted wave tracks.
if ((tr->GetKind() != Track::Wave) || tr->GetMute())
continue;
// do we only want selected ones?
if (selectionOnly && !(tr->GetSelected())) {
//want selected but this one is not
continue;
}
// Found a left channel
if (tr->GetChannel() == Track::LeftChannel) {
numLeft++;
}
// Found a right channel
else if (tr->GetChannel() == Track::RightChannel) {
numRight++;
}
// Found a mono channel, but it may be panned
else if (tr->GetChannel() == Track::MonoChannel) {
float pan = ((WaveTrack*)tr)->GetPan();
// Figure out what kind of channel it should be
if (pan == -1.0) { // panned hard left
numLeft++;
}
else if (pan == 1.0) { // panned hard right
numRight++;
}
else if (pan == 0) { // panned dead center
numMono++;
}
else { // panned somewhere else
numLeft++;
numRight++;
}
}
}
// if there is stereo content, report 2, else report 1
if (numRight > 0 || numLeft > 0) {
return 2;
}
return 1;
}
示例3: GetName
// Gets the name of the specified object.
wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
{
#if defined(__WXMSW__)
if( childId == wxACC_SELF )
{
*name = _( "TrackView" );
}
else
{
Track *t = FindTrack( childId );
if( t == NULL )
{
return wxACC_FAIL;
}
else
{
*name = t->GetName();
if( *name == t->GetDefaultName() )
{
/* i18n-hint: The %d is replaced by th enumber of the track.*/
name->Printf(_("Track %d"), TrackNum( t ) );
}
// LLL: Remove these during "refactor"
if( t->GetMute() )
{
/* i18n-hint: This is for screen reader software and indicates that
on this track mute is on.*/
*name->Append( _( " Mute On" ) );
}
if( t->GetSolo() )
{
/* i18n-hint: This is for screen reader software and indicates that
on this track solo is on.*/
*name->Append( _( " Solo On" ) );
}
if( t->GetSelected() )
{
/* i18n-hint: This is for screen reader software and indicates that
this track is selected.*/
*name->Append( _( " Select On" ) );
}
}
}
return wxACC_OK;
#endif
#if defined(__WXMAC__)
return wxACC_NOT_IMPLEMENTED;
#endif
}
示例4: GetValue
wxAccStatus TrackPanelAx::GetValue( int WXUNUSED(childId), wxString* WXUNUSED(strValue) )
#endif
{
#if defined(__WXMSW__)
return wxACC_NOT_IMPLEMENTED;
#endif
#if defined(__WXMAC__)
if( childId == wxACC_SELF )
{
*strValue = _( "TrackView" );
}
else
{
Track *t = FindTrack( childId );
if( t == NULL )
{
return wxACC_FAIL;
}
else
{
*strValue = t->GetName();
if( *strValue == t->GetDefaultName() )
{
strValue->Printf(_("Track %d"), TrackNum( t ) );
}
// LLL: Remove these during "refactor"
if( t->GetMute() )
{
strValue->Append( _( " Mute On" ) );
}
if( t->GetSolo() )
{
strValue->Append( _( " Solo On" ) );
}
if( t->GetSelected() )
{
strValue->Append( _( " Select On" ) );
}
}
}
return wxACC_OK;
#endif
}
示例5: GetName
// Gets the name of the specified object.
wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
{
if( childId == wxACC_SELF )
{
*name = _( "TrackView" );
}
else
{
Track *t = FindTrack( childId );
if( t == NULL )
{
*name = _( "Track Accessible out of sync" );
return wxACC_FAIL;
}
else
{
*name = t->GetName();
if( *name == t->GetDefaultName() )
{
name->Printf(_("Track %d"), TrackNum( t ) );
}
// LLL: Remove these during "refactor"
if( t->GetMute() )
{
*name->Append( _( " Mute On" ) );
}
if( t->GetSolo() )
{
*name->Append( _( " Solo On" ) );
}
if( t->GetSelected() )
{
*name->Append( _( " Select On" ) );
}
}
}
return wxACC_OK;
}
示例6: GetName
// Gets the name of the specified object.
wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
{
#if defined(__WXMSW__)
if( childId == wxACC_SELF )
{
*name = _( "TrackView" );
}
else
{
Track *t = FindTrack( childId );
if( t == NULL )
{
return wxACC_FAIL;
}
else
{
*name = t->GetName();
if( *name == t->GetDefaultName() )
{
/* i18n-hint: The %d is replaced by th enumber of the track.*/
name->Printf(_("Track %d"), TrackNum( t ) );
}
if (t->GetKind() == Track::Label)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Label track.*/
name->Append( wxT(" ") + wxString(_("Label Track")));
}
else if (t->GetKind() == Track::Time)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Time track.*/
name->Append( wxT(" ") + wxString(_("Time Track")));
}
else if (t->GetKind() == Track::Note)
{
/* i18n-hint: This is for screen reader software and indicates that
this is a Note track.*/
name->Append( wxT(" ") + wxString(_("Note Track")));
}
// LLL: Remove these during "refactor"
if( t->GetMute() )
{
// The following comment also applies to the solo, selected,
// and synclockselected states.
// Many of translations of the strings with a leading space omitted
// the leading space. Therefore a space has been added using wxT(" ").
// Because screen readers won't be affected by multiple spaces, the
// leading spaces have not been removed, so that no new translations are needed.
/* i18n-hint: This is for screen reader software and indicates that
on this track mute is on.*/
name->Append( wxT(" ") + wxString(_( " Mute On" )) );
}
if( t->GetSolo() )
{
/* i18n-hint: This is for screen reader software and indicates that
on this track solo is on.*/
name->Append( wxT(" ") + wxString(_( " Solo On" )) );
}
if( t->GetSelected() )
{
/* i18n-hint: This is for screen reader software and indicates that
this track is selected.*/
name->Append( wxT(" ") + wxString(_( " Select On" )) );
}
if( t->IsSyncLockSelected() )
{
/* i18n-hint: This is for screen reader software and indicates that
this track is shown with a sync-locked icon.*/
// The absence of a dash between Sync and Locked is deliberate -
// if present, Jaws reads it as "dash".
name->Append( wxT(" ") + wxString(_( " Sync Lock Selected" )) );
}
}
}
return wxACC_OK;
#endif
#if defined(__WXMAC__)
return wxACC_NOT_IMPLEMENTED;
#endif
}
示例7: Apply
bool GetTrackInfoCommand::Apply(CommandExecutionContext context)
{
wxString mode = GetString(wxT("Type"));
long trackIndex = GetLong(wxT("TrackIndex"));
// Get the track indicated by the TrackIndex parameter
// (Note: this ought to be somewhere else)
long i = 0;
TrackListIterator iter(context.proj->GetTracks());
Track *t = iter.First();
while (t && i != trackIndex)
{
t = iter.Next();
++i;
}
if (i != trackIndex || !t)
{
Error(wxT("TrackIndex was invalid."));
return false;
}
// Now get the particular desired item about the track of interest
if (mode.IsSameAs(wxT("Name")))
{
Status(t->GetName());
}
else if (mode.IsSameAs(wxT("StartTime")))
{
Status(wxString::Format(wxT("%f"), t->GetStartTime()));
}
else if (mode.IsSameAs(wxT("EndTime")))
{
Status(wxString::Format(wxT("%f"), t->GetEndTime()));
}
else if (mode.IsSameAs(wxT("Pan")))
{
if(t->GetKind() == Track::Wave)
Status(wxString::Format(wxT("%f"), static_cast<WaveTrack*>(t)->GetPan()));
}
else if (mode.IsSameAs(wxT("Gain")))
{
if(t->GetKind() == Track::Wave)
Status(wxString::Format(wxT("%f"), static_cast<WaveTrack*>(t)->GetGain()));
}
else if (mode.IsSameAs(wxT("Focused")))
{
TrackPanel *panel = context.proj->GetTrackPanel();
SendBooleanStatus(panel->GetFocusedTrack() == t);
}
else if (mode.IsSameAs(wxT("Selected")))
{
SendBooleanStatus(t->GetSelected());
}
else if (mode.IsSameAs(wxT("Linked")))
{
SendBooleanStatus(t->GetLinked());
}
else if (mode.IsSameAs(wxT("Solo")))
{
if (t->GetKind() == Track::Wave)
SendBooleanStatus(t->GetSolo());
else
SendBooleanStatus(false);
}
else if (mode.IsSameAs(wxT("Mute")))
{
if (t->GetKind() == Track::Wave)
SendBooleanStatus(t->GetMute());
else
SendBooleanStatus(false);
}
else
{
Error(wxT("Invalid info type!"));
return false;
}
return true;
}
示例8: FillBuffers
void AudioIO::FillBuffers()
{
unsigned int numEmpty = 0;
unsigned int i;
// Playback buffers
for(i=0; i<mNumOutBuffers; i++) {
if (mOutBuffer[i].ID == 0)
numEmpty++;
}
if (numEmpty > (mNumOutBuffers/2)) {
sampleCount block = numEmpty * mBufferSize;
double deltat = block / mRate;
if (mT + deltat > mT1) {
deltat = mT1 - mT;
if(deltat < 0.0) return;
block = (sampleCount)(deltat * mRate + 0.5);
}
Mixer *mixer = new Mixer(mNumOutChannels, block, true,
mRate, mFormat);
mixer->UseVolumeSlider(mProject->GetControlToolBar());
mixer->Clear();
TrackListIterator iter2(mTracks);
int numSolo = 0;
Track *vt = iter2.First();
while (vt) {
if (vt->GetKind() == Track::Wave && vt->GetSolo())
numSolo++;
vt = iter2.Next();
}
TrackListIterator iter(mTracks);
vt = iter.First();
while (vt) {
if (vt->GetKind() == Track::Wave) {
Track *mt = vt;
// We want to extract mute and solo information from
// the top of the two tracks if they're linked
// (i.e. a stereo pair only has one set of mute/solo buttons)
Track *partner = mTracks->GetLink(vt);
if (partner && !vt->GetLinked())
mt = partner;
else
mt = vt;
// Cut if somebody else is soloing
if (numSolo>0 && !mt->GetSolo()) {
vt = iter.Next();
continue;
}
// Cut if we're muted (unless we're soloing)
if (mt->GetMute() && !mt->GetSolo()) {
vt = iter.Next();
continue;
}
WaveTrack *t = (WaveTrack *) vt;
switch (t->GetChannel()) {
case Track::LeftChannel:
mixer->MixLeft(t, mT, mT + deltat);
break;
case Track::RightChannel:
mixer->MixRight(t, mT, mT + deltat);
break;
case Track::MonoChannel:
mixer->MixMono(t, mT, mT + deltat);
break;
}
}
vt = iter.Next();
}
// Copy the mixed samples into the buffers
samplePtr outbytes = mixer->GetBuffer();
for(i=0; i<mNumOutBuffers && block>0; i++)
if (mOutBuffer[i].ID == 0) {
sampleCount count;
if (block > mBufferSize)
count = mBufferSize;
else
count = block;
memcpy(mOutBuffer[i].data, outbytes,
count*mNumOutChannels*SAMPLE_SIZE(mFormat));
block -= count;
outbytes += (count*mNumOutChannels*SAMPLE_SIZE(mFormat));
mOutBuffer[i].len = count;
mOutBuffer[i].ID = mOutID;
//.........这里部分代码省略.........