Пример #1
0
    private void Swap(int index, int otherIndex)
    {
        int       tempId           = ids[index];
        string    tempGroup        = groups[index];
        byte      tempStatus       = statuses[index];
        string    tempSpeakerNames = speakerNames[index];
        string    tempSpeechTexts  = speechTexts[index];
        string    tempFileNames    = fileNames[index];
        AudioClip tempClips        = clips[index];
        LineIssue tempIssues       = issues[index];

        ids[index]          = ids[otherIndex];
        groups[index]       = groups[otherIndex];
        statuses[index]     = statuses[otherIndex];
        speakerNames[index] = speakerNames[otherIndex];
        speechTexts[index]  = speechTexts[otherIndex];
        fileNames[index]    = fileNames[otherIndex];
        clips[index]        = clips[otherIndex];
        issues[index]       = issues[otherIndex];

        ids[otherIndex]          = tempId;
        groups[otherIndex]       = tempGroup;
        statuses[otherIndex]     = tempStatus;
        speakerNames[otherIndex] = tempSpeakerNames;
        speechTexts[otherIndex]  = tempSpeechTexts;
        fileNames[otherIndex]    = tempFileNames;
        clips[otherIndex]        = tempClips;
        issues[otherIndex]       = tempIssues;
    }
Пример #2
0
 public static bool IssuePreventsFileMaking(LineIssue issues)
 {
     return
         ((issues & LineIssue.emptyLine) == LineIssue.emptyLine ||
          (issues & LineIssue.badFileName) == LineIssue.badFileName ||
          (issues & LineIssue.invalidSpeaker) == LineIssue.invalidSpeaker);
 }
Пример #3
0
 public bool HasIssue(int index, LineIssue saughtIssues)
 {
     if (index < 0 || index >= clips.Count)
     {
         return(false);
     }
     return((issues[index] & saughtIssues) == saughtIssues);
 }
Пример #4
0
 public void SetIssues(int index, LineIssue newIssues)
 {
     if (index < 0 || index >= clips.Count)
     {
         return;
     }
     issues[index] = newIssues;
 }
Пример #5
0
 public void SetIssue(int index, LineIssue chosenIssue, bool newValue)
 {
     if (index < 0 || index >= clips.Count)
     {
         return;
     }
     if (newValue)
     {
         issues[index] |= chosenIssue;
     }
     else
     {
         issues[index] &= ~chosenIssue;
     }
 }
Пример #6
0
 public static bool IssuePreventsFileMaking(LineIssue issues)
 {
     return 
         (issues & LineIssue.emptyLine) == LineIssue.emptyLine ||
         (issues & LineIssue.badFileName) == LineIssue.badFileName ||
         (issues & LineIssue.invalidSpeaker) == LineIssue.invalidSpeaker;
 }
Пример #7
0
 public int AddNewLine(int givenId, string givenGroup, byte givenStatus, string givenName, string givenText, string givenFileName, LineIssue givenIssues)
 {
     issues.Add(0); // first, since other will try to fill this
     ids.Add(-1);
     groups.Add("");
     statuses.Add(1);
     speakerNames.Add("");
     speechTexts.Add("");
     fileNames.Add("");
     SetGroup(givenId, givenGroup);
     SetSpeakerName(speakerNames.Count - 1, givenName);
     SetSpeechText(speechTexts.Count - 1, givenText);
     if (givenFileName == EasyVoiceSettings.defaultFileNameString)
     {
         SetDefaultFileName(fileNames.Count - 1); // after speaker name
     }
     else
     {
         SetFileName(fileNames.Count - 1, givenFileName, true); // after speaker name
     }
     clips.Add(null);
     SetIssues(issues.Count - 1, givenIssues);
     SetId(ids.Count - 1, givenId);
     MakeSureDefaultFileNameIsUnique(fileNames.Count - 1); // after file names, since those changed
     SetStatus(statuses.Count - 1, givenStatus);           // last, so no update trigger
     return(fileNames.Count - 1);
 }
Пример #8
0
 public int AddNewLine(int givenId, string givenGroup, byte givenStatus, string givenName, string givenText, string givenFileName, LineIssue givenIssues)
 {
     issues.Add(0); // first, since other will try to fill this
     ids.Add(-1);
     groups.Add("");
     statuses.Add(1);
     speakerNames.Add("");
     speechTexts.Add("");
     fileNames.Add("");
     SetGroup(givenId, givenGroup);
     SetSpeakerName(speakerNames.Count - 1, givenName);
     SetSpeechText(speechTexts.Count - 1, givenText);
     if (givenFileName == EasyVoiceSettings.defaultFileNameString)
         SetDefaultFileName(fileNames.Count - 1); // after speaker name
     else
         SetFileName(fileNames.Count - 1, givenFileName, true); // after speaker name
     clips.Add(null);
     SetIssues(issues.Count - 1, givenIssues);
     SetId(ids.Count - 1, givenId);
     MakeSureDefaultFileNameIsUnique(fileNames.Count - 1); // after file names, since those changed
     SetStatus(statuses.Count - 1, givenStatus); // last, so no update trigger
     return fileNames.Count - 1;
 }
Пример #9
0
 public bool HasIssue(int index, LineIssue saughtIssues)
 {
     if (index < 0 || index >= clips.Count) return false;
     return (issues[index] & saughtIssues) == saughtIssues;
 }
Пример #10
0
 public void SetIssue(int index, LineIssue chosenIssue, bool newValue)
 {
     if (index < 0 || index >= clips.Count) return;
     if (newValue)
         issues[index] |= chosenIssue;
     else
         issues[index] &= ~chosenIssue;
 }
Пример #11
0
 public void SetIssues(int index, LineIssue newIssues)
 {
     if (index < 0 || index >= clips.Count) return;
     issues[index] = newIssues;
 }