本文整理汇总了C++中GetSetMediaTrackInfo函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSetMediaTrackInfo函数的具体用法?C++ GetSetMediaTrackInfo怎么用?C++ GetSetMediaTrackInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSetMediaTrackInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResolveMissingRecv
// Return TRUE on delete send
bool ResolveMissingRecv(MediaTrack* tr, int iSend, TrackSend* ts, WDL_PtrList<TrackSendFix>* pFix)
{
WDL_FastString str;
char* cName = (char*)GetSetMediaTrackInfo(tr, "P_NAME", NULL);
if (!cName || !cName[0])
cName = (char*)__LOCALIZE("(unnamed)","sws_DLG_114");
str.SetFormatted(200, __LOCALIZE_VERFMT("Send %d on track %d \"%s\" is missing its receive track!","sws_DLG_114"), iSend+1, CSurf_TrackToID(tr, false), cName);
g_cErrorStr = str.Get();
g_ts = ts;
g_send = tr;
g_recv = NULL;
DialogBox(g_hInst, MAKEINTRESOURCE(IDD_RECVMISSING), g_hwndParent, doResolve);
if (g_iResolveRet == 1)
return true;
else if (g_iResolveRet == 2)
{
GUID* newGuid = (GUID*)GetSetMediaTrackInfo(g_recv, "GUID", NULL);
if (pFix)
pFix->Add(new TrackSendFix(ts->GetGuid(), newGuid));
ts->SetGuid(newGuid);
}
return false;
}
示例2: ToggleWriteEnvExists
void ToggleWriteEnvExists(COMMAND_T* _ct)
{
bool updated = false;
// restore write modes
if (g_toolbarAutoModeToggles.GetSize())
{
for (int i=0; i < g_toolbarAutoModeToggles.GetSize(); i++)
{
SNM_TrackInt* tri = g_toolbarAutoModeToggles.Get(i);
GetSetMediaTrackInfo(tri->m_tr, "I_AUTOMODE", &(tri->m_int));
updated = true;
}
g_toolbarAutoModeToggles.Empty(true);
}
// set read mode and store previous write modes
else
{
for (int i=0; i <= GetNumTracks(); i++) // incl. master
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
int autoMode = tr ? *(int*)GetSetMediaTrackInfo(tr, "I_AUTOMODE", NULL) : -1;
if (autoMode >= 2 /* touch */ && autoMode <= 4 /* latch */)
{
GetSetMediaTrackInfo(tr, "I_AUTOMODE", &g_i1); // set read mode
g_toolbarAutoModeToggles.Add(new SNM_TrackInt(tr, autoMode));
updated = true;
}
}
}
if (updated) {
Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(_ct), UNDO_STATE_ALL, -1);
RefreshToolbar(SWSGetCommandID(ToggleWriteEnvExists)); // in case auto-refresh toolbar option is off..
}
}
示例3: SetTracksFolderState
// I_FOLDERDEPTH :
// 0=normal, 1=track is a folder parent,
// -1=track is the last in the innermost folder
// -2=track is the last in the innermost and next-innermost folders, etc
void SetTracksFolderState(COMMAND_T* _ct)
{
bool updated = false;
for (int i=1; i <= GetNumTracks(); i++) // skip master
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (tr && *(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
int newState = (int)_ct->user;
int curState = *(int*)GetSetMediaTrackInfo(tr, "I_FOLDERDEPTH", NULL);
if ((int)_ct->user == -1) // last in folder?
{
if (SNM_GetTrackDepth(tr)>0)
newState = curState<0 ? curState-1 : -1;
else
newState = curState;
}
else if ((int)_ct->user == -2) // very last in folder?
{
int depth = SNM_GetTrackDepth(tr);
if (depth>0)
newState = depth * (-1);
else
newState = curState;
}
if (curState!=newState) {
GetSetMediaTrackInfo(tr, "I_FOLDERDEPTH", &newState);
updated = true;
}
}
}
if (updated)
Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(_ct), UNDO_STATE_ALL, -1);
}
示例4: RestoreTracksFolderStates
void RestoreTracksFolderStates(COMMAND_T* _ct)
{
bool updated = false;
const char* strState = !_ct->user ? "I_FOLDERDEPTH" : "I_FOLDERCOMPACT";
WDL_PtrList_DeleteOnDestroy<SNM_TrackInt>* saveList = !_ct->user ? &g_trackFolderStates : &g_trackFolderCompactStates;
for (int i=1; i <= GetNumTracks(); i++) // skip master
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (tr && *(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
for(int j=0; j < saveList->GetSize(); j++)
{
SNM_TrackInt* savedTF = saveList->Get(j);
int current = *(int*)GetSetMediaTrackInfo(tr, strState, NULL);
if (savedTF->m_tr == tr &&
((!_ct->user && savedTF->m_int != current) ||
(_ct->user && *(int*)GetSetMediaTrackInfo(tr, "I_FOLDERDEPTH", NULL) == 1 && savedTF->m_int != current)))
{
GetSetMediaTrackInfo(tr, strState, &(savedTF->m_int));
updated = true;
break;
}
}
}
}
if (updated)
Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(_ct), UNDO_STATE_ALL, -1);
}
示例5: ColorChildren
void ColorChildren(COMMAND_T* = NULL)
{
int iParentDepth;
COLORREF crParentColor;
bool bSelected = false;
MediaTrack* gfd = NULL;
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
int iType;
int iFolder = GetFolderDepth(tr, &iType, &gfd);
if (bSelected)
GetSetMediaTrackInfo(tr, "I_CUSTOMCOLOR", &crParentColor);
if (iType == 1)
{
if (!bSelected && *(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
iParentDepth = iFolder;
bSelected = true;
}
crParentColor = *(COLORREF*)GetSetMediaTrackInfo(tr, "I_CUSTOMCOLOR", NULL);
}
if (iType + iFolder <= iParentDepth)
bSelected = false;
}
Undo_OnStateChangeEx(__LOCALIZE("Set track(s) children to same color","sws_undo"), UNDO_STATE_TRACKCFG, -1);
}
示例6: RecSrcOut
void RecSrcOut(COMMAND_T* = NULL)
{
// Set the rec source to output
// Set to mono or stereo based on first item
for (int i = 1; i <= GetNumTracks(); i++)
{
int iMode = 1; // 5 = mono, 1 = stereo
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
if (GetTrackNumMediaItems(tr))
{
MediaItem* mi = GetTrackMediaItem(tr, 0);
if (GetMediaItemNumTakes(mi))
{
MediaItem_Take* mit = GetMediaItemTake(mi, 0);
PCM_source* p = (PCM_source*)GetSetMediaItemTakeInfo(mit, "P_SOURCE", NULL);
if (p && p->GetNumChannels() == 1)
iMode = 5;
}
}
GetSetMediaTrackInfo(tr, "I_RECMODE", &iMode);
}
}
}
示例7: RemapMIDIInputChannel
void RemapMIDIInputChannel(COMMAND_T* _ct)
{
bool updated = false;
int ch = (int)_ct->user; // 0: source channel
char pLine[SNM_MAX_CHUNK_LINE_LENGTH] = "";
if (ch && _snprintfStrict(pLine, sizeof(pLine), "MIDI_INPUT_CHANMAP %d\n", ch-1) <= 0)
return;
for (int i=1; i <= GetNumTracks(); i++) // skip master
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (tr && *(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
int in = *(int*)GetSetMediaTrackInfo(tr, "I_RECINPUT", NULL);
if ((in & 0x1000) == 0x1000) // midi in?
{
SNM_ChunkParserPatcher p(tr);
char currentCh[3] = "";
int chunkPos = p.Parse(SNM_GET_CHUNK_CHAR, 1, "TRACK", "MIDI_INPUT_CHANMAP", 0, 1, currentCh, NULL, "TRACKID");
if (chunkPos > 0) {
if (!ch || atoi(currentCh) != (ch-1))
updated |= p.ReplaceLine(--chunkPos, pLine); // pLine can be "", i.e. remove line
}
else
updated |= p.InsertAfterBefore(0, pLine, "TRACK", "TRACKHEIGHT", 1, 0, "TRACKID");
}
}
}
if (updated)
Undo_OnStateChangeEx2(NULL, SWS_CMD_SHORTNAME(_ct), UNDO_STATE_ALL, -1);
}
示例8: CustomColorAll
void CustomColorAll(COMMAND_T*)
{
// Get the first selected track
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
{
Undo_BeginBlock();
Main_OnCommand(40357, 0); // Set track(s) to one custom color
// Assume the user clicked 'OK' in the color picker!
COLORREF cr = *(COLORREF*)GetSetMediaTrackInfo(tr, "I_CUSTOMCOLOR", NULL);
for (int i = 1; i <= GetNumTracks(); i++)
{
tr = CSurf_TrackFromID(i, false);
for (int j = 0; j < GetTrackNumMediaItems(tr); j++)
{
MediaItem* mi = GetTrackMediaItem(tr, j);
if (*(bool*)GetSetMediaItemInfo(mi, "B_UISEL", NULL))
GetSetMediaItemInfo(mi, "I_CUSTOMCOLOR", &cr);
}
}
UpdateTimeline();
Undo_EndBlock(__LOCALIZE("Set selected track(s)/item(s) to custom color","sws_undo"), UNDO_STATE_ALL);
return;
}
}
// No tracks selected so just run the item action
Main_OnCommand(40704, 0); // Set item(s) to one custom color
}
示例9: switch
void SWS_TrackListView::GetItemText(SWS_ListItem* item, int iCol, char* str, int iStrMax)
{
MediaTrack* tr = (MediaTrack*)item;
if (tr)
{
switch (iCol)
{
case COL_NUM: // #
_snprintf(str, iStrMax, "%d", CSurf_TrackToID(tr, false));
break;
case COL_NAME: // Name
lstrcpyn(str, (char*)GetSetMediaTrackInfo(tr, "P_NAME", NULL), iStrMax);
break;
case COL_TCP: // TCP
lstrcpyn(str, GetTrackVis(tr) & 2 ? UTF8_BULLET : UTF8_CIRCLE, iStrMax);
break;
case COL_MCP: // MCP
lstrcpyn(str, GetTrackVis(tr) & 1 ? UTF8_BULLET : UTF8_CIRCLE, iStrMax);
break;
case COL_ARM:
lstrcpyn(str, *(int*)GetSetMediaTrackInfo(tr, "I_RECARM", NULL) ? UTF8_BULLET : UTF8_CIRCLE, iStrMax);
break;
case COL_MUTE:
lstrcpyn(str, *(bool*)GetSetMediaTrackInfo(tr, "B_MUTE", NULL) ? UTF8_BULLET : UTF8_CIRCLE, iStrMax);
break;
case COL_SOLO:
lstrcpyn(str, *(int*)GetSetMediaTrackInfo(tr, "I_SOLO", NULL) ? UTF8_BULLET : UTF8_CIRCLE, iStrMax);
break;
// case COL_INPUT:
// _snprintf(str, iStrMax, "%d", *(int*)GetSetMediaTrackInfo(tr, "I_RECINPUT", NULL) + 1);
// break;
}
}
}
示例10: GetSetMediaTrackInfo
void SWS_TrackListView::OnItemSelChanged(SWS_ListItem* item, int iState)
{
MediaTrack* tr = (MediaTrack*)item;
if (iState & LVIS_FOCUSED)
g_pList->m_trLastTouched = tr;
if ((iState & LVIS_SELECTED ? true : false) != (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL) ? true : false))
GetSetMediaTrackInfo(tr, "I_SELECTED", iState & LVIS_SELECTED ? &g_i1 : &g_i0);
}
示例11: DisableMPSend
void DisableMPSend(COMMAND_T* = NULL)
{
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
GetSetMediaTrackInfo(tr, "B_MAINSEND", &g_bFalse);
}
}
示例12: UnbypassFX
void UnbypassFX(COMMAND_T* = NULL)
{
for (int i = 0; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
GetSetMediaTrackInfo(tr, "I_FXEN", &g_i1);
}
}
示例13: UnsetMonMedia
void UnsetMonMedia(COMMAND_T* = NULL)
{
for (int i = 1; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
GetSetMediaTrackInfo(tr, "I_RECMONITEMS", &g_i0);
}
}
示例14: ColorTrackNext
void ColorTrackNext(COMMAND_T* = NULL)
{
for (int i = 0; i < GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
GetSetMediaTrackInfo(tr, "I_CUSTOMCOLOR", GetSetMediaTrackInfo(CSurf_TrackFromID(i+1, false), "I_CUSTOMCOLOR", NULL));
}
Undo_OnStateChangeEx(__LOCALIZE("Set track(s) to previous track's color","sws_undo"), UNDO_STATE_TRACKCFG, -1);
}
示例15: MinimizeTracks
void MinimizeTracks(COMMAND_T* = NULL)
{
for (int i = 0; i <= GetNumTracks(); i++)
{
MediaTrack* tr = CSurf_TrackFromID(i, false);
if (*(int*)GetSetMediaTrackInfo(tr, "I_SELECTED", NULL))
GetSetMediaTrackInfo(tr, "I_HEIGHTOVERRIDE", &g_i1);
}
TrackList_AdjustWindows(false);
UpdateTimeline();
}