You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
using UnityEngine; |
|
using UnityEngine.UI; |
|
using System.Collections.Generic; |
|
|
|
namespace FFmpeg.Demo |
|
{ |
|
public class AddSoundView : MonoBehaviour |
|
{ |
|
public Dropdown modeDropdown; |
|
|
|
public InputField inputVideoField; |
|
public InputField inputAudioField; |
|
public InputField outputField; |
|
|
|
SoundData config = new SoundData(); |
|
bool fastMode; |
|
|
|
//------------------------------ |
|
|
|
void Awake() |
|
{ |
|
OnFastOrFull(modeDropdown.value); |
|
} |
|
|
|
public void Open() |
|
{ |
|
gameObject.SetActive(true); |
|
} |
|
|
|
//------------------------------ |
|
|
|
public void OnOutputPath(string fullPath) |
|
{ |
|
config.outputPath = fullPath; |
|
} |
|
|
|
public void OnSoundInputPath(string fullPath) |
|
{ |
|
config.soundPath = fullPath; |
|
} |
|
|
|
public void OnVideoInputPath(string fullPath) |
|
{ |
|
config.inputPath = fullPath; |
|
} |
|
|
|
public void OnFastOrFull(int fast) |
|
{ |
|
fastMode = fast > 0; |
|
} |
|
|
|
//------------------------------ |
|
|
|
public void OnAddSound() |
|
{ |
|
if (fastMode) |
|
FFmpegCommands.AddSoundFast(config); |
|
else |
|
FFmpegCommands.AddSoundFull(config); |
|
|
|
gameObject.SetActive(false); |
|
} |
|
|
|
//------------------------------ |
|
} |
|
} |