خطوة ممتازة يا صديقي؛ التخطيط المسبق وتجهيز الأدوات والملفات هو نصف نجاح أي
مشروع برمجى، وسيوفر عليك الكثير من الوقت والجهد لاحقاً.
إليك الدليل الكامل لتجهيز جهازك، يليه ملف البرومتات المنظم والمكتوب بدقة بلغة
برمجية واضحة ليقوم الذكاء الاصطناعي بترجمتها فوراً إلى كود نظيف وخالٍ من
التعقيد.
أولاً: قائمة التجهيزات المطلوبة على جهازك (Checklist)
قبل أن تبدأ، تأكد من تثبيت وتجهيز البرامج التالية على جهازك (كلها مجانية
بالكامل):
بيئة التطوير الرئيسية:
حمل وثبّت برنامج Visual Studio 2022 Community Edition [3].
أثناء التثبيت: سيظهر لك معالج يطلب منك تحديد حزم العمل (Workloads). تأكد
من وضع علامة صح بجانب .NET Desktop Development (تطوير تطبيقات سطح المكتب
باستخدام .NET) [3]. هذا الخيار هو ما يقوم بتثبيت لغة C# ومحرك واجهات WPF
[3].
محرر الأكواد الذكي:
حمل وثبّت Cursor Editor (النسخة المجانية). سيسهل عليك توجيه الذكاء
الاصطناعي مباشرة داخل ملفات المشروع.
إضافة الذكاء الاصطناعي المجاني:
ثبت إضافة Codeium داخل Visual Studio لتساعدك في الإكمال التلقائي الذكي
أثناء العمل مجاناً.
ثانياً: البرومتات النهائية (تنسخ وتحفظ في ملف نصي)
قم بنسخ النصوص الموجودة داخل المربعات البرمجية أدناه واحفظها في ملف نصي على
جهازك باسم Tx_Prompts.txt. عندما تفتح بيئة العمل وتصبح جاهزاً، استخدمها بالترتيب
التالي:
برومت المرحلة الأولى: تأسيس الواجهة الرسومية (UI & Waveform)
الهدف: بناء نافذة البرنامج وتصميم التايم لاين والموجة الصوتية التفاعلية.
Act as an elite Desktop App Developer specialized in C# and WPF (.NET 8.0). We are building a minimalist audio editor named "Tx Audio Edit".
Our goal for Phase 1 is to create the main Window and the visual interface.
Requirements for Phase 1:
UI Design:
Modern Premium Dark Theme (Deep gray/black backgrounds, subtle glowing green/blue accents).
Top Menu: File, Edit, Effects, Settings.
Main Area: A large Waveform display canvas. It should allow mouse click-and-drag to select a specific audio region (highlighted in semi-transparent color).
Bottom Bar: Minimalist transport controls (Record, Stop, Play, Export) and a volume slider.
Code Structure:
Use standard WPF (XAML) for the visual layout.
Separate the UI design (MainWindow.xaml) from the logic (MainWindow.xaml.cs).
Keep the code clean, modular, and well-commented.
Write the complete MainWindow.xaml and MainWindow.xaml.cs files to establish this UI layout, and show me how to structure the project files.
برومت المرحلة الثانية: محرك الصوت والاختصارات الذكية (Audio Engine & Shortcuts)
Assistant
الهدف: دمج مكتبة NAudio لتسجيل الصوت بصيغة Append، وتفعيل اختصارات الكيبورد (E
للسرعة، و S للمسح) [5].
Act as a C# Audio Engineer. We are now in Phase 2 of building "Tx Audio Edit". We need to integrate the "NAudio" library for recording and implement key editing features and keyboard shortcuts [5].
Requirements for Phase 2:
NAudio Integration:
Set up recording using NAudio (WASAPI/DirectSound) with high-quality default settings (48kHz, 24-bit, Mono) [5].
Non-Destructive Append: When the user presses "Record", the new recorded audio must automatically be appended to the end of the existing audio buffer. No overwriting.
Dynamic Waveform Drawing:
Read the audio buffer (samples) and draw the waveform dynamically on our WPF Canvas during playback and recording.
Smart Shortcuts:
Key [S] (Ripple Delete): When pressed, if a region is selected on the waveform, delete those samples from the audio buffer, shift the remaining audio to close the gap, and redraw the waveform.
Key [E] (Speed listening): While held down, play the audio at 2x speed without altering pitch drastically (or by skipping frames smoothly). Upon release, return to 1x speed.
Provide the complete updated C# code for these integrations.
برومت المرحلة الثالثة: المؤثرات المبسطة والتصدير (DSP Effects & Export)
Act as a DSP (Digital Signal Processing) expert in C#. We are in Phase 3 of "Tx Audio Edit". We need to implement three simple one-click effects and the export feature.
Requirements for Phase 3:
One-Click Effects (to be applied on the audio buffer):
Normalize (Leveler): Find the peak amplitude in the audio buffer and scale the entire buffer so the peak reaches 0 dB without clipping.
Remove Silence: Scan the audio buffer, detect regions where the volume is below -45dB for more than 1 second, and delete those silent gaps.
Basic Noise Reduction: Implement a simple spectral subtraction or noise gate filter to suppress low-amplitude background hiss.
High-Quality Export:
Implement the "Export" button.
Allow saving as WAV (48kHz, 24-bit) or MP3 (320kbps using LAME encoder/wrapper) based on user's choice with no complex settings screens.
Please write the C# code for these DSP helper classes and connect them to the UI buttons.
برومت إضافي: برنامج الفيديو (Tx Video Edit - MVP Setup)
الهدف: هذا البرومت ستحتفظ به للمستقبل عندما تنتهي تماماً من برنامج الصوت وتبدأ
في برنامج الفيديو بنفس البيئة.
Act as a Video Software Architect. We want to initialize our second project: "Tx Video Edit" using C#, WPF, and the "LibOpenShot" (or FFmpeg.AutoGen wrapper) for a simple video editor [2].
Our goal is a Minimum Viable Product (MVP) with these core requirements:
UI Layout:
A video preview player window (WPF Canvas or MediaElement).
A single-track Timeline at the bottom.
Core Features:
Import video/image files.
Cut and Slice clips on the timeline.
Basic Positioning & Scale (Picture-in-Picture motion using simple keyframes).
Apply a basic transition (Fade In / Fade Out) between two overlapping clips [2].
Explain the project architecture, required NuGet packages, and write the initial layout files to get started.
فهمت قصدك تماماً الآن. أنت تريد برومتات لتأسيس الفكرة ومفهوم التصميم (Conceptual
& Design Prompts)؛ وهي برومتات "شرح وتخطيط" غرضها شرح الرؤية الإبداعية، والذوق
البصري، وطريقة عمل البرامج للذكاء الاصطناعي ليفهم فلسفة مشروعك "Tx" بالكامل قبل
أن يكتب كوداً واحداً.
تقسيم الفكرة إلى برومتات منفصلة هو أسلوب احترافي جداً في هندسة البرمجيات وتصميم
المنتجات (Product Management).
إليك 3 برومتات منفصلة مصممة لتشرح للذكاء الاصطناعي فلسفة التصميم، ثم برنامج
المونتاج، ثم برنامج الصوت:
البرومت الأول: فلسفة علامة "Tx" التجارية والذوق البصري والـ UX
الهدف من هذا البرومت: تشرح للذكاء الاصطناعي هوية البراند البصرية (Aesthetics)
وتجربة المستخدم (User Experience) المشتركة للبرنامجين، لكي يفهم "الذوق العام"
الذي تريده في التصميم.
Act as an elite Creative Director and Lead UI/UX Designer. I want you to understand and establish the brand identity and visual philosophy of "Tx Suite", a minimalist suite of creative software consisting of "Tx Audio Edit" and "Tx Video Edit".
Brand Philosophy:
Target Audience: Content creators, podcasters, and casual editors who want fast, professional results without the overwhelming complexity of traditional software.
The Core UX Principle: "Hidden Complexity, Exposed Simplicity". The software should do all the heavy technical calculations under the hood (dynamic thresholds, smart-scaling, clean rendering) and only expose simple, beautiful buttons and sliders to the user.
Visual Identity & Aesthetics (The Tx Look):
Color Palette (Obsidian Neon):
Backgrounds: Ultra-dark matte charcoal/obsidian (#121212) to minimize eye strain.
Text & Secondary UI: Minimalist soft white and muted gray (#A0A0A0) for low contrast.
Accent Colors: Sleek neon accents (such as neon blue or glowing mint green) used strictly for interactive elements (Record button, selected regions, playback indicators).
Layout:
Flat, modern, borderless design with plenty of negative space.
Curved edges (rounded corners) for buttons, timelines, and panels to give a friendly, modern tech-startup feel.
Flat iconography rather than cluttered text menus where possible.
Understand this visual philosophy. Write a conceptual summary of how both Tx Audio Edit and Tx Video Edit should feel and behave under this brand identity. Do not write any code yet.
البرومت الثاني: فلسفة وطريقة عمل برنامج الصوت (Tx Audio Edit)
الهدف من هذا البرومت: تشرح للذكاء الاصطناعي فكرة برنامج الصوت بالتفصيل، كيف
سيعمل التايم لاين، منطق التسجيل المستمر، واختصارات لوحة المفاتيح والافكتات
المبسطة.
Act as a Lead Audio Product Manager. I want you to analyze and outline the conceptual workflow and functional specifications of "Tx Audio Edit", a minimalist, single-track audio editor.
Core Workflow & Functional Specifications:
The Timeline (Single Waveform Philosophy):
The main workspace is a single, continuous high-performance waveform.
Left-click and drag on the waveform allows the user to highlight a specific selection (for cutting or applying effects).
Non-Destructive Auto-Append Recording:
Traditional editors overwrite audio if the user records in the middle of a track. In "Tx Audio Edit", pressing "Record" ALWAYS appends the new recording to the very end of the current session. This ensures the user never accidentally overwrites previous work.
Speed-Editing Shortcuts:
[S] Key (Ripple Delete): A critical key. When pressed, the highlighted waveform selection is instantly sliced out, and the surrounding audio snaps together to fill the gap.
[E] Key (Speed Listening): Holding [E] speeds up playback to 2x (using smart time-stretching to keep the voice pitch comprehensible). Releasing it drops it back to 1x normal speed.
One-Click DSP Effects:
Noise Reduction: A single button that automatically detects and subtracts ambient noise.
Silence Removal: A button that automatically scans the timeline and deletes silent gaps below a certain threshold.
Normalize: An auto-leveler that maximizes the peak volume to 0dB without causing distortion.
Analyze this conceptual workflow. Outline the logic of how the audio buffer should manage these operations (such as cutting and appending) behind the scenes, without writing code.
البرومت الثالث: فلسفة وطريقة عمل برنامج المونتاج (Tx Video Edit)
الهدف من هذا البرومت: تشرح للذكاء الاصطناعي فكرة برنامج الفيديو بالتفصيل، كيف
سيتعامل مع التايم لاين المبسط، تحريك الصور (Keyframing)، والقص والانتقالات
التلقائية.
Act as a Lead Video Product Manager. I want you to analyze and outline the conceptual workflow and functional specifications of "Tx Video Edit", a simplified, lightweight desktop video editor focused on speed and simplicity.
Core Workflow & Functional Specifications:
The Simplified Timeline (Track System):
Instead of dozens of confusing tracks like Premiere, "Tx Video Edit" uses a simplified two-layer timeline: One main video track, and one overlay track (for overlaying pictures, B-rolls, or titles).
The user can drag, drop, cut, and rearrange clips directly on the timeline.
Direct-Canvas Motion Control:
Instead of opening complex effect control panels, the user can click on any video/image on the preview player canvas and directly resize (scale) or move (position) it using on-screen bounding boxes.
Keyframe-less Animation: Provide simple preset motions (e.g., "Smooth Slide In", "Zoom to Center") rather than complex manual keyframing.
Smart Automatic Transitions:
When two video clips are overlapped slightly on the timeline, the editor should automatically apply a smooth, high-quality transition (like Cross Dissolve or Wipe) without requiring the user to drag a transition effect from a separate menu.
Hassle-Free Export:
The export process should have only two buttons: "Export MP3 (Audio Only)" and "Export High-Quality Video (MP4)". All compression and bitrate settings (1080p, H.264, high-bitrate) are set automatically under the hood to guarantee the best quality.
Analyze this conceptual workflow. Outline how a video engine should manage these transitions and visual scales behind the scenes, without writing code.
كيف تستخدم هذه البرومتات؟
احفظ البرومتات الثلاثة في ملفك النصي.
عندما تكون جاهزاً ومثبتاً لجميع البرامج على جهازك، تفتح دردشة جديدة مع
الذكاء الاصطناعي وتمرر له البرومت الأول (البراند والذوق البصري) ليفهم الهوية
العامة للبرامج.
بعدها مباشرة تمرر له البرومت الثاني (فكرة برنامج الصوت) أو الثالث (فكرة
برنامج الفيديو) بحسب البرنامج الذي ستبدأ به.
بمجرد أن يؤكد لك الذكاء الاصطناعي أنه فهم الفكرة وبدأ بشرح تفاصيلها لك، تطلب
منه حينها الانتقال لكتابة الكود خطوة بخطوة بناءً على هذه الرؤية.
حسنلي فكرة البرنامج والبرومتات
هذا العمل الذي قمت به هو أعلى بكثير من مستوى المبتدئين؛ أنت تتبع نهج مهندسي البرمجيات المحترفين (Software Architect) في تخطيط المنتجات، وهذا هو السر الحقيقي وراء بناء برامج ناجحة.
لتحسين خطتك لتكون أكثر "واقعية" من الناحية التقنية، وأكثر "دقة" في توجيه الذكاء الاصطناعي، سأقدم لك بعض التحسينات الجوهرية (Refinements) على مستوى الفلسفة التقنية وعلى مستوى صياغة البرومتات.
أولاً: تحسينات جوهرية على الفلسفة والتقنية
إضافة "الأداء" كركيزة أساسية:
في برامج المونتاج والصوت، التصميم الجميل لا يكفي. إذا تجمدت الواجهة (UI Freeze) أثناء معالجة الصوت أو الفيديو، سيفشل البرنامج فوراً.
الإضافة: أضف في فلسفة التصميم (Prompts) شرطاً صريحاً: "استخدام التعددية في المهام (Multi-threading/Async/Await)" لضمان بقاء الواجهة الرسومية سلسة (60 FPS) مهما كانت عملية المعالجة خلف الكواليس ثقيلة.
استبدال أدوات الرسم التقليدية:
رسم الموجة الصوتية (Waveform) باستخدام عناصر WPF التقليدية (Shapes) سيجعله بطيئاً جداً مع ملفات الصوت الطويلة.
الإضافة: في البرومتات، اطلب من الذكاء الاصطناعي استخدام SkiaSharp (مكتبة رسومية قوية وعالية الأداء للـ .NET) لرسم الموجة الصوتية. هذا سيغير اللعبة تماماً في الأداء.
إدارة الذاكرة والـ MVP:
أنت محق في استراتيجية الـ MVP. أضف شرطاً بأن كل ميزة تُبنى يجب أن تكون "قابلة للفصل" (Modular)، بحيث إذا أردنا تطوير "محرك تصدير" أقوى مستقبلاً، لا نضطر لإعادة كتابة الواجهة.
ثانياً: تحسينات على البرومتات (إضافة قيود تقنية)
لتحصل على كود أفضل، يجب أن تفرض قيوداً على الذكاء الاصطناعي ليقوم بهيكلة الكود بطريقة احترافية. سأدمج التحسينات في برومتاتك الحالية:
1. تحسين برومت "فلسفة الـ UX" (أضف هذا الجزء في نهايته):
"إضافة إلى ذلك، يجب أن يلتزم الكود بهيكلية MVVM (Model-View-ViewModel) بشكل صارم. افصل منطق العمل (Logic) تماماً عن الواجهة (XAML) لضمان قابلية التوسع والصيانة. تأكد من أن أي عملية تتطلب أكثر من 100ms يتم تشغيلها في Background Thread."
2. تحسين برومت "برنامج الصوت" (أضف هذا الجزء في نهايته):
"ملاحظة تقنية: لرسم الموجة الصوتية، لا تستخدم WPF Canvas العادي، بل استخدم SkiaSharp لضمان أداء عالٍ. بالنسبة للتعامل مع الذاكرة، استخدم Ring Buffer لإدارة الصوت المسجل لضمان سرعة الإضافة وعدم وجود تأخير (Latency). تأكد من كتابة 'Interface' لكل مؤثر صوتي (DSP Effect) ليكون النظام قابلاً للإضافة (Plug-and-Play) في المستقبل."
3. تحسين برومت "برنامج الفيديو" (أضف هذا الجزء في نهايته):
"ملاحظة تقنية: بخصوص التعامل مع الفيديو، لا تحاول كتابة محرك تصيير (Rendering Engine) من الصفر. اعتمد في الكود على FFmpeg.AutoGen للتعامل مع ملفات الفيديو، وقم بعمل Wrapper مبسط له ليكون التعامل معه سهلاً. ركز على أن يكون الـ 'Preview Player' منفصلاً عن الـ 'Timeline' لكي نتمكن من ترقية المحرك لاحقاً دون التأثير على التصميم."
ثالثاً: إضافات لقائمة التجهيزات (Checklist)
الآن بعد أن أضفت هذه المتطلبات التقنية، يجب أن تضيف هذه المكتبات إلى قائمة تعلمك وتجهيزك:
SkiaSharp: (ضرورية للرسم السريع للموجات والرسوميات).
CommunityToolkit.Mvvm: (مكتبة رسمية من مايكروسوفت لتسهيل تطبيق نمط MVVM في WPF).
FFmpeg (عن طريق NuGet): (تأكد من تعلم أساسياتها، فهي العمود الفقري لأي برنامج مونتاج).
نصيحة ذهبية لخطوات العمل القادمة:
عندما تبدأ باستخدام البرومتات مع الذكاء الاصطناعي:
لا تطلب منه الكود كاملاً في المرة الأولى.
ابدأ بطلب "هيكلية المشروع" (Architecture/Project Structure). اطلب منه أن يرسم لك شجرة المجلدات والملفات (Folder Tree) ويوضح دور كل ملف.
بمجرد أن توافق على الهيكلية، ابدأ بطلب "القلب" (Core) أولاً (مثلاً: كلاس إدارة الـ Audio Buffer)، ثم ابدأ ببناء الواجهة (UI) حوله.
بهذه التحسينات، أنت لا تبحث فقط عن "كود يعمل"، بل تبحث عن "برنامج قابل للنمو والاحتراف". بالتوفيق في مشروع Tx!