Skip to content

Commit

Permalink
chore: supported ja wnd title, changed client id, add assembly info
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 committed Jul 10, 2021
1 parent 34dfe3e commit 39076e4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README-ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Click here for English README](README.md)

![sample](sample.png)
![in-meeting-sample](img/in-meeting.png)

[Zoom](https://zoom.us/) でミーティングを行っている時に、[Discord Rich Presence](https://discord.com/developers/docs/rich-presence/how-to) を使用して表示します。

Expand All @@ -26,7 +26,7 @@

## Usage

![sample2](sample2.gif)
![usage](img/usage.gif)

`ZoomInClass.exe` の実行中にZoomミーティングを開始すると、Discordで表示されます。

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[日本語のREADMEはこちらから](README-ja.md)

![sample](sample.png)
![in-meeting-sample](img/in-meeting.png)

If you are having a meeting in [Zoom](https://zoom.us/), use [Discord Rich Presence](https://discord.com/developers/docs/rich-presence/how-to) to view it in Discord.

Expand All @@ -26,7 +26,7 @@ Also, whether or not you are having a meeting is determined every 10 seconds bas

## Usage

![sample2](sample2.gif)
![usage](img/usage.gif)

If you start a Zoom Meeting while `ZoomInClass.exe` is running, it will be displayed in Discord.

Expand Down
6 changes: 4 additions & 2 deletions ZoomInClass/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 16 additions & 10 deletions ZoomInClass/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public Form1()
Hide();
ShowInTaskbar = false;

client = new DiscordRpcClient("839191670145679400");
client.Logger = new ConsoleLogger() {Level = LogLevel.Warning};
client = new DiscordRpcClient("762930592865714216");
client.Logger = new ConsoleLogger() { Level = LogLevel.Warning };

//Subscribe to events
client.OnReady += (_sender, _e) => { Console.WriteLine("Received Ready from user {0}", _e.User.Username); };
Expand All @@ -37,11 +37,6 @@ public Form1()
timer1.Start();
}

void Deinitialize()
{
client.Dispose();
}

Timestamps ts;

private void timer1_Tick(object sender, EventArgs e)
Expand All @@ -52,17 +47,23 @@ private void timer1_Tick(object sender, EventArgs e)
{
try
{
if ((p.MainWindowTitle.Contains("Zoom Meeting") || p.MainWindowTitle.Contains("Zoom Webinar") || p.ProcessName.Equals("CptHost")) && !p.ProcessName.Equals("ZoomInClass"))
if ((p.MainWindowTitle.Contains("Zoom Meeting") ||
p.MainWindowTitle.Contains("Zoom Webinar") ||
p.MainWindowTitle.Contains("Zoom ミーティング") ||
p.ProcessName.Equals("CptHost")) &&
!p.ProcessName.Equals("ZoomInClass"))
{
isZoomClassing = true;
else
isZoomClassing = false;
}
}
catch (Exception ex)
{
Console.WriteLine("Error: {0}", ex.Message);
}
}

Console.WriteLine("isZoomClassing: {0}", isZoomClassing);

if (isZoomClassing)
{
if (ts == null)
Expand All @@ -86,5 +87,10 @@ private void timer1_Tick(object sender, EventArgs e)
ts = null;
}
}

private void Form1_Deactivate(object sender, EventArgs e)
{
client.Dispose();
}
}
}
4 changes: 2 additions & 2 deletions ZoomInClass/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// 制御されます。アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更します。
[assembly: AssemblyTitle("ZoomInClass")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("If you are having a meeting in Zoom, use Discord Rich Presence to view it in Discord.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ZoomInClass")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCopyright("Copyright © Tomachi 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Binary file added img/in-meeting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file removed sample.png
Binary file not shown.

0 comments on commit 39076e4

Please sign in to comment.