Compare commits
2 Commits
69c9d80a82
...
socket
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a471041e7 | |||
| ab57d8ef22 |
@ -8,6 +8,18 @@
|
||||
"name": "Clip 20260226_195932",
|
||||
"playbackType": "playOverlap",
|
||||
"volume": 1
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260228_165611.wav",
|
||||
"name": "Clip 20260228_165611",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1.0
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260228_165646.wav",
|
||||
"name": "Clip 20260228_165646",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1.0
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -16,14 +28,14 @@
|
||||
"id": 1,
|
||||
"clips": [
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_183607.wav",
|
||||
"name": "Clip 20260226_183607",
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_183812.wav",
|
||||
"name": "Clip 20260226_183812",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_183812.wav",
|
||||
"name": "Clip 20260226_183812",
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_183607.wav",
|
||||
"name": "Clip 20260226_183607",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1
|
||||
},
|
||||
@ -76,18 +88,12 @@
|
||||
"volume": 1
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_184043.wav",
|
||||
"name": "Clip 20260226_184043",
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260228_092721.wav",
|
||||
"name": "Clip 20260228_092721",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1
|
||||
},
|
||||
{
|
||||
"endTime": 14.772566995768694,
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260226_194441.wav",
|
||||
"name": "Test",
|
||||
"playbackType": "playStop",
|
||||
"startTime": 9.8548571932299,
|
||||
"volume": 0.6
|
||||
"volume": 1,
|
||||
"startTime": 6.438382145377559,
|
||||
"endTime": 14.277258292166426
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -110,6 +116,18 @@
|
||||
"playbackType": "playOverlap",
|
||||
"startTime": 26.14685314685314,
|
||||
"volume": 0.64
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260228_085116.wav",
|
||||
"name": "pp",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1
|
||||
},
|
||||
{
|
||||
"filename": "C:\\Users\\mickl\\Desktop\\cliptrim-ui\\ClipTrimApp\\audio-service\\recordings\\audio_capture_20260228_120955.wav",
|
||||
"name": "nose",
|
||||
"playbackType": "playStop",
|
||||
"volume": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ class AudioIO:
|
||||
}
|
||||
|
||||
meta.add_clip_to_collection("Uncategorized", clip_metadata )
|
||||
|
||||
self.socket.emit('new_clip', clip_metadata)
|
||||
|
||||
return clip_metadata
|
||||
|
||||
|
||||
@ -18,6 +18,8 @@ import { resolveHtmlPath } from './util';
|
||||
import registerFileIpcHandlers from '../ipc/audio/main';
|
||||
import PythonSubprocessManager from './service';
|
||||
|
||||
const pythonManager = new PythonSubprocessManager('src/main.py');
|
||||
|
||||
class AppUpdater {
|
||||
constructor() {
|
||||
log.transports.file.level = 'info';
|
||||
@ -124,6 +126,7 @@ const createWindow = async () => {
|
||||
app.on('window-all-closed', () => {
|
||||
// Respect the OSX convention of having the application in memory even
|
||||
// after all windows have been closed
|
||||
pythonManager.stop();
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
@ -132,8 +135,7 @@ app.on('window-all-closed', () => {
|
||||
app
|
||||
.whenReady()
|
||||
.then(() => {
|
||||
const pythonManager = new PythonSubprocessManager('src/main.py');
|
||||
pythonManager.start();
|
||||
// pythonManager.start();
|
||||
createWindow();
|
||||
app.on('activate', () => {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
|
||||
@ -67,32 +67,11 @@ const metadataSlice = createSlice({
|
||||
targetState.clips.push(clip);
|
||||
}
|
||||
},
|
||||
addNewClips(state, action) {
|
||||
const { collections } = action.payload;
|
||||
Object.keys(collections).forEach((collection) => {
|
||||
const collectionState = state.collections.find(
|
||||
(col) => col.name === collection,
|
||||
);
|
||||
if (!collectionState) {
|
||||
state.collections.push({
|
||||
name: collection,
|
||||
id: Date.now(),
|
||||
clips: [],
|
||||
});
|
||||
}
|
||||
const existingFilenames = new Set(
|
||||
state.collections
|
||||
.find((col) => col.name === collection)
|
||||
?.clips.map((clip) => clip.filename) || [],
|
||||
);
|
||||
const newClips = collections[collection].filter(
|
||||
(clip: ClipMetadata) => !existingFilenames.has(clip.filename),
|
||||
);
|
||||
// const collectionState = state.collections.find(
|
||||
// (col) => col.name === collection,
|
||||
// );
|
||||
if (collectionState) {
|
||||
collectionState.clips.push(...newClips);
|
||||
addNewClip(state, action) {
|
||||
const { clip } = action.payload;
|
||||
state.collections.forEach((collection) => {
|
||||
if (collection.name === 'Uncategorized') {
|
||||
collection.clips.push(clip);
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -113,6 +92,6 @@ export type RootState = ReturnType<AppStore['getState']>;
|
||||
// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
|
||||
export type AppDispatch = AppStore['dispatch'];
|
||||
|
||||
export const { setCollections, addNewClips, addCollection } =
|
||||
export const { setCollections, addNewClip, addCollection } =
|
||||
metadataSlice.actions;
|
||||
export default metadataSlice.reducer;
|
||||
|
||||
@ -7,6 +7,7 @@ import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import io from 'socket.io-client';
|
||||
// import 'tailwindcss/tailwind.css';
|
||||
import './App.css';
|
||||
import ClipList from './components/ClipList';
|
||||
@ -14,7 +15,7 @@ import { useAppDispatch, useAppSelector } from './hooks';
|
||||
import { store } from '../redux/main';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import SettingsPage from './Settings';
|
||||
import apiFetch from './api';
|
||||
import { apiFetch, getBaseUrl } from './api';
|
||||
|
||||
function MainPage() {
|
||||
const dispatch = useAppDispatch();
|
||||
@ -27,20 +28,46 @@ function MainPage() {
|
||||
const [newCollectionOpen, setNewCollectionOpen] = useState(false);
|
||||
const [newCollectionName, setNewCollectionName] = useState<string>('');
|
||||
const navigate = useNavigate();
|
||||
const [socket, setSocket] = useState<any>(null);
|
||||
|
||||
useEffect(() => {}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchMetadata = async () => {
|
||||
try {
|
||||
const response = await apiFetch('meta');
|
||||
const data = await response.json();
|
||||
dispatch({ type: 'metadata/setAllData', payload: data });
|
||||
} catch (error) {
|
||||
console.error('Error fetching metadata:', error);
|
||||
}
|
||||
const initializeSocket = async () => {
|
||||
const baseUrl = await getBaseUrl();
|
||||
const newSocket = io(baseUrl);
|
||||
setSocket(newSocket);
|
||||
newSocket.on('connect', () => {
|
||||
console.log('Connected to WebSocket server');
|
||||
});
|
||||
newSocket.on('full_data', (data: any) => {
|
||||
console.log('Received full_data from server:', data);
|
||||
dispatch({
|
||||
type: 'metadata/setAllData',
|
||||
payload: { collections: data },
|
||||
});
|
||||
});
|
||||
newSocket.on('new_clip', (data: any) => {
|
||||
console.log('Received new_clips from server:', data);
|
||||
dispatch({
|
||||
type: 'metadata/addNewClip',
|
||||
payload: { clip: data },
|
||||
});
|
||||
});
|
||||
};
|
||||
fetchMetadata();
|
||||
const intervalId = setInterval(fetchMetadata, 5000);
|
||||
return () => clearInterval(intervalId);
|
||||
initializeSocket();
|
||||
// const fetchMetadata = async () => {
|
||||
// try {
|
||||
// const response = await apiFetch('meta');
|
||||
// const data = await response.json();
|
||||
// dispatch({ type: 'metadata/setAllData', payload: data });
|
||||
// } catch (error) {
|
||||
// console.error('Error fetching metadata:', error);
|
||||
// }
|
||||
// };
|
||||
// fetchMetadata();
|
||||
// const intervalId = setInterval(fetchMetadata, 5000);
|
||||
// return () => clearInterval(intervalId);
|
||||
}, [dispatch]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -5,7 +5,7 @@ import './App.css';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Select from '@mui/material/Select';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import apiFetch from './api';
|
||||
import { apiFetch } from './api';
|
||||
|
||||
type AudioDevice = {
|
||||
index: number;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const getBaseUrl = async () => {
|
||||
export const getBaseUrl = async () => {
|
||||
const port = await window.audio.getPort();
|
||||
if (port.error || !port.port) {
|
||||
return `http://localhost:5010`;
|
||||
@ -7,7 +7,7 @@ const getBaseUrl = async () => {
|
||||
return `http://localhost:${port.port}`;
|
||||
};
|
||||
|
||||
export default async function apiFetch(endpoint: string, options = {}) {
|
||||
export async function apiFetch(endpoint: string, options = {}) {
|
||||
const url = `${await getBaseUrl()}/${endpoint}`;
|
||||
return fetch(url, options);
|
||||
}
|
||||
|
||||
@ -15,7 +15,7 @@ import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
|
||||
import AudioTrimmer from './AudioTrimer';
|
||||
import { ClipMetadata } from '../../redux/types';
|
||||
import { useAppDispatch, useAppSelector } from '../hooks';
|
||||
import apiFetch from '../api';
|
||||
import { apiFetch } from '../api';
|
||||
|
||||
export interface ClipListProps {
|
||||
collection: string;
|
||||
|
||||
@ -30,20 +30,26 @@ namespace ClipTrimDotNet.Client
|
||||
}
|
||||
|
||||
//private HttpClient httpClient;
|
||||
private SocketIO socket;
|
||||
private SocketIO? socket;
|
||||
|
||||
public int PortNumber { get; set; } = 5010;
|
||||
|
||||
public ClipTrimClient()
|
||||
public string HostName
|
||||
{
|
||||
//httpClient = new HttpClient()
|
||||
//{
|
||||
// BaseAddress = new Uri("http://localhost:5010/"),
|
||||
// Timeout = TimeSpan.FromSeconds(10)
|
||||
//};
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"Starting ClipTrimClient on port {PortNumber}");
|
||||
socket = new SocketIO(new Uri($"http://localhost:5010/"));
|
||||
get
|
||||
{
|
||||
//return $"http://localhost:5010/";
|
||||
return $"http://localhost:{GlobalSettings.Instance.PortNumber}/";
|
||||
}
|
||||
}
|
||||
|
||||
private string? currentHostname = null;
|
||||
|
||||
void CreateSocket()
|
||||
{
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"Starting ClipTrimClient on port {HostName}");
|
||||
socket = new SocketIO(new Uri(HostName));
|
||||
currentHostname = HostName;
|
||||
socket.Options.AutoUpgrade = false;
|
||||
//socket.Options.Path = "/socket.io";
|
||||
socket.Options.ConnectionTimeout = TimeSpan.FromSeconds(10);
|
||||
socket.Options.Reconnection = true;
|
||||
socket.On("full_data", ctx =>
|
||||
@ -53,6 +59,8 @@ namespace ClipTrimDotNet.Client
|
||||
var response = ctx.GetValue<List<CollectionMetaData>>(0);
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"full_data event {JsonConvert.SerializeObject(response)}");
|
||||
Collections = response!;
|
||||
Player.TickAll();
|
||||
PageNavigator.TickAll();
|
||||
//Logger.Instance.LogMessage(TracingLevel.INFO, $"Collections {JsonConvert.SerializeObject(Collections)}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -71,6 +79,8 @@ namespace ClipTrimDotNet.Client
|
||||
if (index != -1)
|
||||
{
|
||||
Collections[index] = response;
|
||||
Player.TickAll();
|
||||
PageNavigator.TickAll();
|
||||
}
|
||||
}
|
||||
catch
|
||||
@ -81,6 +91,11 @@ namespace ClipTrimDotNet.Client
|
||||
return Task.CompletedTask;
|
||||
});
|
||||
|
||||
socket.OnConnected += (sender, e) =>
|
||||
{
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"Socket connected: {e}");
|
||||
};
|
||||
|
||||
socket.OnDisconnected += (sender, e) =>
|
||||
{
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"Socket disconnected: {e}");
|
||||
@ -89,8 +104,19 @@ namespace ClipTrimDotNet.Client
|
||||
Task.Run(async () => await Connect());
|
||||
}
|
||||
|
||||
public ClipTrimClient()
|
||||
{
|
||||
//httpClient = new HttpClient()
|
||||
//{
|
||||
// BaseAddress = new Uri("http://localhost:5010/"),
|
||||
// Timeout = TimeSpan.FromSeconds(10)
|
||||
//};
|
||||
CreateSocket();
|
||||
}
|
||||
|
||||
public async Task Connect()
|
||||
{
|
||||
if (socket is null) return;
|
||||
while (!socket.Connected)
|
||||
{
|
||||
try
|
||||
@ -176,6 +202,12 @@ namespace ClipTrimDotNet.Client
|
||||
return Collections.Where(x => x.Name != "Uncategorized").Select(x => x.Name).ToList();
|
||||
}
|
||||
|
||||
public string GetCurrentCollectionName()
|
||||
{
|
||||
if (SelectedCollection == -1) return "";
|
||||
return Collections[SelectedCollection].Name;
|
||||
}
|
||||
|
||||
public string GetPlayerStringByCoordinateIndex(int index)
|
||||
{
|
||||
if (PageMode)
|
||||
@ -221,9 +253,10 @@ namespace ClipTrimDotNet.Client
|
||||
}
|
||||
else
|
||||
{
|
||||
if (socket is null) return;
|
||||
var metadata = GetClipByPagedIndex(index);
|
||||
if (metadata == null) return;
|
||||
Logger.Instance.LogMessage(TracingLevel.INFO, $"playing clip:");
|
||||
//Logger.Instance.LogMessage(TracingLevel.INFO, $"playing clip:");
|
||||
await socket.EmitAsync("play_clip", new List<object>() { metadata });
|
||||
}
|
||||
|
||||
@ -231,7 +264,24 @@ namespace ClipTrimDotNet.Client
|
||||
|
||||
public async void SaveClip()
|
||||
{
|
||||
if (socket is null) return;
|
||||
await socket.EmitAsync("record_clip", new List<object>() { });
|
||||
}
|
||||
|
||||
public async void CheckPort()
|
||||
{
|
||||
if (socket is null) return;
|
||||
//Logger.Instance.LogMessage(TracingLevel.INFO, $"Checking port {socket}");
|
||||
if (currentHostname != HostName)
|
||||
{
|
||||
//Logger.Instance.LogMessage(TracingLevel.INFO, $"port {socket}");
|
||||
if (socket.Connected)
|
||||
{
|
||||
await socket.DisconnectAsync();
|
||||
}
|
||||
socket.Dispose();
|
||||
CreateSocket();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,20 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\ClipTrimDotNet.sdPlugin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Images\app_icon.png" />
|
||||
<None Remove="Images\back.png" />
|
||||
<None Remove="Images\category_icon.png" />
|
||||
<None Remove="Images\collection.png" />
|
||||
<None Remove="Images\collection_icon.png" />
|
||||
<None Remove="Images\page_nav.png" />
|
||||
<None Remove="Images\page_nav_icon.png" />
|
||||
<None Remove="Images\player.png" />
|
||||
<None Remove="Images\player_icon.png" />
|
||||
<None Remove="Images\record.png" />
|
||||
<None Remove="Images\record_icon.png" />
|
||||
<None Remove="manifest.json" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
|
||||
@ -54,34 +68,43 @@
|
||||
<None Update="DialLayout.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="manifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="!!README!!.txt" />
|
||||
<Content Include="Images\categoryIcon%402x.png">
|
||||
<Content Include="Images\app_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\categoryIcon.png">
|
||||
<Content Include="Images\back.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\icon%402x.png">
|
||||
<Content Include="Images\category_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\icon.png">
|
||||
<Content Include="Images\collection.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\pluginAction%402x.png">
|
||||
<Content Include="Images\collection_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\pluginAction.png">
|
||||
<Content Include="Images\page_nav.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\pluginIcon%402x.png">
|
||||
<Content Include="Images\page_nav_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\pluginIcon.png">
|
||||
<Content Include="Images\player_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\record.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\player.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Images\record_icon.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="manifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="package.json" />
|
||||
|
||||
@ -29,6 +29,7 @@ namespace ClipTrimDotNet
|
||||
{
|
||||
GlobalSettings instance = new GlobalSettings();
|
||||
instance.ProfileName = null;
|
||||
instance.PortNumber = 5010;
|
||||
return instance;
|
||||
}
|
||||
|
||||
@ -36,6 +37,9 @@ namespace ClipTrimDotNet
|
||||
[JsonProperty(PropertyName = "profileName")]
|
||||
public string? ProfileName { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "portNumber")]
|
||||
public int? PortNumber { get; set; }
|
||||
|
||||
|
||||
public void SetCurrentProfile(string profile)
|
||||
{
|
||||
|
||||
BIN
stream_deck_plugin/ClipTrimDotNet/Images/app_icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/app_icon.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/back.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/back.psd
Normal file
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/category_icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/collection.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/collection.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/collection_icon.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/collection_icon.psd
Normal file
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/page_nav.png
Normal file
|
After Width: | Height: | Size: 484 B |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/page_nav.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/page_nav_icon.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/page_nav_icon.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/player.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/player.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/player_icon.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/player_icon.psd
Normal file
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.9 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/record.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/record.psd
Normal file
BIN
stream_deck_plugin/ClipTrimDotNet/Images/record_icon.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
stream_deck_plugin/ClipTrimDotNet/Images/record_icon.psd
Normal file
@ -68,7 +68,7 @@ namespace ClipTrimDotNet.Keys
|
||||
await Connection.SetTitleAsync(ClipTrimClient.Instance.CanPageDown ? "<" : "");
|
||||
break;
|
||||
case 1:
|
||||
await Connection.SetTitleAsync((ClipTrimClient.Instance.PageIndex + 1).ToString());
|
||||
await Connection.SetTitleAsync(ClipTrimClient.Instance.GetCurrentCollectionName() + "\n" + (ClipTrimClient.Instance.PageIndex + 1).ToString());
|
||||
break;
|
||||
case 2:
|
||||
await Connection.SetTitleAsync(ClipTrimClient.Instance.CanPageUp ? ">" : "");
|
||||
|
||||
@ -60,7 +60,7 @@ namespace ClipTrimDotNet.Keys
|
||||
private async void SetTitle()
|
||||
{
|
||||
|
||||
await Connection.SetTitleAsync(settings.ProfileName + " B");
|
||||
await Connection.SetTitleAsync(settings.ProfileName);
|
||||
}
|
||||
|
||||
private async void Connection_OnSendToPlugin(object? sender, SDEventReceivedEventArgs<BarRaider.SdTools.Events.SendToPlugin> e)
|
||||
@ -90,6 +90,8 @@ namespace ClipTrimDotNet.Keys
|
||||
public override async void KeyPressed(KeyPayload payload)
|
||||
{
|
||||
GlobalSettings.Instance.SetCurrentProfile(settings.ProfileName??"");
|
||||
ClipTrimClient.Instance.PageMode = false;
|
||||
PageNavigator.TickAll();
|
||||
|
||||
await Connection.SetGlobalSettingsAsync(JObject.FromObject(GlobalSettings.Instance));
|
||||
await Connection.SwitchProfileAsync("ClipTrim");
|
||||
@ -107,6 +109,7 @@ namespace ClipTrimDotNet.Keys
|
||||
|
||||
public override void ReceivedSettings(ReceivedSettingsPayload payload)
|
||||
{
|
||||
//Logger.Instance.LogMessage(TracingLevel.INFO, $"ProfileSwitcher received settings {JsonConvert.SerializeObject(payload.Settings)}");
|
||||
Tools.AutoPopulateSettings(settings, payload.Settings);
|
||||
SaveSettings();
|
||||
}
|
||||
@ -114,6 +117,7 @@ namespace ClipTrimDotNet.Keys
|
||||
public override void ReceivedGlobalSettings(ReceivedGlobalSettingsPayload payload)
|
||||
{
|
||||
Tools.AutoPopulateSettings(GlobalSettings.Instance, payload.Settings);
|
||||
ClipTrimClient.Instance.CheckPort();
|
||||
//if (payload.Settings == null || payload.Settings.Count == 0)
|
||||
//{
|
||||
// var inst = GlobalSettings.Instance;
|
||||
|
||||
@ -13,7 +13,7 @@ namespace ClipTrimDotNet
|
||||
{
|
||||
// Uncomment this line of code to allow for debugging
|
||||
//while (!System.Diagnostics.Debugger.IsAttached) { System.Threading.Thread.Sleep(100); }
|
||||
Client.ClipTrimClient.Instance.PortNumber = 5010;
|
||||
//Client.ClipTrimClient.Instance.PortNumber = 5010;
|
||||
SDWrapper.Run(args);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,13 @@
|
||||
show-refresh="true"
|
||||
placeholder="Select a ClipTrim page"></sdpi-select>
|
||||
</sdpi-item>
|
||||
<sdpi-item>
|
||||
<sdpi-textfield
|
||||
global="true"
|
||||
setting="portNumber"
|
||||
placeholder="Port Number"
|
||||
pattern="[0-9]+"></sdpi-textfield>
|
||||
</sdpi-item>
|
||||
<!--<sdpi-item label="Base Path">
|
||||
<sdpi-file setting="basePath"
|
||||
global="true"
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
|
||||
"Actions": [
|
||||
{
|
||||
"Icon": "Images/icon",
|
||||
"Icon": "Images/player_icon",
|
||||
"Name": "Player",
|
||||
"States": [
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/player",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": 11
|
||||
}
|
||||
@ -17,26 +17,26 @@
|
||||
"PropertyInspectorPath": "PropertyInspector/file_player.html"
|
||||
},
|
||||
{
|
||||
"Icon": "Images/icon",
|
||||
"Name": "Profile Switcher",
|
||||
"Icon": "Images/collection_icon",
|
||||
"Name": "Collection Selector",
|
||||
"States": [
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/collection",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": 11
|
||||
}
|
||||
],
|
||||
"SupportedInMultiActions": false,
|
||||
"Tooltip": "Selects which sub folder to use and opens effect profile",
|
||||
"Tooltip": "Selects which collection to use",
|
||||
"UUID": "com.michal-courson.cliptrim.profile-switcher",
|
||||
"PropertyInspectorPath": "PropertyInspector/profile_swticher.html"
|
||||
},
|
||||
{
|
||||
"Icon": "Images/icon",
|
||||
"Icon": "Images/page_nav_icon",
|
||||
"Name": "Page Navigator",
|
||||
"States": [
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/page_nav",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": 16
|
||||
}
|
||||
@ -47,11 +47,11 @@
|
||||
"PropertyInspectorPath": "PropertyInspector/file_player.html"
|
||||
},
|
||||
{
|
||||
"Icon": "Images/icon",
|
||||
"Icon": "Images/record_icon",
|
||||
"Name": "Save Clip",
|
||||
"States": [
|
||||
{
|
||||
"Image": "Images/pluginAction",
|
||||
"Image": "Images/record",
|
||||
"TitleAlignment": "middle",
|
||||
"FontSize": 16
|
||||
}
|
||||
@ -65,11 +65,11 @@
|
||||
"Author": "Michal Courson",
|
||||
"Name": "ClipTrimDotNet",
|
||||
"Description": "Pairs with cliptrim for easy voice recording and trimming",
|
||||
"Icon": "Images/pluginIcon",
|
||||
"Icon": "Images/app_icon",
|
||||
"Version": "0.1.0.0",
|
||||
"CodePath": "ClipTrimDotNet.exe",
|
||||
"Category": "ClipTrimDotNet",
|
||||
"CategoryIcon": "Images/categoryIcon",
|
||||
"Category": "ClipTrim",
|
||||
"CategoryIcon": "Images/category_icon",
|
||||
"UUID": "com.michal-courson.cliptrim",
|
||||
"OS": [
|
||||
{
|
||||
|
||||