Difference between revisions of "Developer Guide"

From Audacity Wiki
Jump to: navigation, search
(Link to current Manual given this is a developers' page?)
(Intro: 44100)
 
(38 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
{{intro|1=Links and brief explanations for developers}}
 +
 +
 +
'''See Also:'''
 +
* [[For_Developers]]
 +
 +
''Yep, we've two or more similar pages doing much the same thing in different ways - and pointing to each other.  Our code does much the same thing too :-)''
 +
 +
 +
==Intro==
 +
 +
Audacity aims to be a '''simple to use''' but '''powerful audio editor'''.
 +
 +
About 3/4 of Audacity source code is concerned with user interface, and less than 1/4 with audio processing.  The code is tangled, reflecting its history.  Many people with widely varying skill levels have contributed. 
 +
 +
: The '''audio code''' is multi-threaded.  This is because audio is real time, it must be delivered at a certain rate (typically 44100 audio samples per second).  Different threads work on data at different rates, e.g. large but less frequent bursts of data from Disk IO, with buffering of various kinds between the threads to accommodate the mismatches in rates.  The code is more complex because it must both play and record at the same time.
 +
 +
: The '''GUI code''' is mostly written using wxWidgets library, which handles dialogs and common GUI controls.  HOWEVER, the waveforms (in the TrackPanel) is not a standard widget, and Audacity code draws the TrackPanel itself, placing the lines and text and clickable icons.
 +
 +
==Building Audacity==
 +
 +
Getting Audacity building on Linux is usually trouble-free because the right tools are there in the environment, or can be found and installed easily. On Windows and Mac it takes longer to set up the environment. Unless you are very experienced, you need to stay with the version of Visual Studio (Windows) and version of Xcode and OS X SDK (MacOS) indicated in the links below.
 +
 +
* [[Building On Windows]]
 +
* [[Building On Linux]]
 +
* [[Building On Mac]]
 +
 
==Quick Links==
 
==Quick Links==
* Overview of compilation on [[Developing On Windows|Windows]], [[Developing On Linux|Linux]] and  [[Developing On Mac|Mac]].
 
* [[CompilingAudacityForBeginners|Mac/Linux/Unix]] step by step guides for compiling Audacity
 
* [[Notes for Packagers]] - people building Audacity for Linux distributions and the like.
 
 
* [[ArchitecturalDesign|Designing Audacity]] - read and write about what goes into Audacity and how it works     
 
* [[ArchitecturalDesign|Designing Audacity]] - read and write about what goes into Audacity and how it works     
 
* [[Quality|Ensuring Quality]] - coding standards, commenting code, submitting patches...  
 
* [[Quality|Ensuring Quality]] - coding standards, commenting code, submitting patches...  
* [[Mezzo]] - A library re-write of some of the internals of Audacity (formerly known as "libaudacity")
+
* [[Notes for Packagers]] - people building Audacity for Linux distributions and the like.
* Please subscribe to our {{external|[http://lists.sourceforge.net/lists/listinfo/audacity-devel audacity-devel]}} mailing list to exchange your ideas with our developers or to seek help
+
* Please subscribe to our [http://lists.sourceforge.net/lists/listinfo/audacity-devel audacity-devel] mailing list to exchange your ideas with our developers or to seek help.
  
 
==Tips for New Developers==
 
==Tips for New Developers==
  
* Ask lots of questions and don't be afraid to look a divvy! It's a learning process and like I tell my students, 'if you don't understand (after a reasonable amount of effort), ask somebody who can help!'.
+
* Ask lots of questions and do not be afraid to look a fool. It is a learning process and like I tell my students, ''"if you don't understand (after a reasonable amount of effort), ask somebody who can help"''.
* Note our [[CodingStandards|Coding Standards]] for Audacity (these don't apply to subordinate libraries). Most importantly, '''don't use tabs''' at all, and always use '''three spaces for indentation''' (otherwise things don't line up on different editors). We mostly use standard camel-case capitalization. Some use Hungarian notation, but not everybody.
+
* Note our [[CodingStandards|Coding Standards]] for Audacity (these do not apply to subordinate libraries). Most importantly, '''do not use tabs''' at all, and always use '''three spaces for indentation''' (otherwise things will not line up on different editors). We mostly use standard camel-case capitalization. Some use Hungarian notation, but not everybody.
* Note the challenge of maintaining [[Quality]] in open source software. We have had many short-term contributors over some ten years. This can result in "organic" interdependencies that aren't obvious, so '''any''' code change has the potential to break something. Read all the comments in the code, write your own comments when you add code, and don't remove any code you don't understand.  
+
* Note the challenge of maintaining [[Quality]] in open source software. We have had many short-term contributors over the many years since 2009. This can result in "organic" interdependencies that aren't obvious, so '''any''' code change has the potential to break something. Write your own comments when you add new code.  Summarize key points, do not just say the code in words.  Choose names logically.
 
* Use the same tools other people are using.
 
* Use the same tools other people are using.
* Post error messages when asking for help, but try and select relevant bits.
 
 
 
==Platform Specific Guides==
 
 
Getting Audacity building on Linux is usually trouble-free because the right tools are there in the environment, or can be found and installed easily.  The same isn't really true for Windows and the win/compile.txt file provided with the Audacity source code assumes you know quite a lot about how stuff works under the bonnet, and about Visual Studio.
 
 
* [[Developing On Windows]]
 
* [[Developing On Linux]] and [[CompilingAudacityForBeginners|Compiling Audacity Step by Step Guide]]
 
* [[Developing On Mac]]
 
  
 +
==Design Topics==
  
==Design Topics==
+
Some [[Design Topics]] are worth reading when modifying and extending Audacity.
  
 
* [[ArchitecturalDesign]]
 
* [[ArchitecturalDesign]]
 
* [[AudacityLibraries]]
 
* [[AudacityLibraries]]
 
* [[HowAudacityWorks]]
 
* [[HowAudacityWorks]]
* [[Creating your own Plug-in]]
+
* [[Creating your own Plugin]]
 +
 
 +
==Feature Planning==
 +
 
 +
* [[The Feature Requests Pipeline]]
 +
** [[Roadmap]]
 +
** [[Feature Requests]]
 +
** [[:Category:Proposal|Proposals]]
  
 +
* [[:Category:Feature Planning|Feature Planning]]
  
 
==Improving and Adding Features==
 
==Improving and Adding Features==
  
Adding new features is one of the more exciting aspects of the job, but needs care so as not to destabilise what is already there. New approaches using a plug-in type of architecture can help this. Even so, there are some things that cannot always be done in an open source program due to licensing restrictions. Have a look at our [[Feature Requests]] page to see what our users most wish to see in Audacity, add your own requests, and let us know if you are interested in helping us implement the best of these.
+
Adding new features is one of the more exciting aspects of the job, but needs care so as not to destabilize what is already there. New approaches using a plug-in type of architecture can help this. Even so, there are some things that cannot always be done in an open source application due to licensing restrictions. Have a look at our [[Feature Requests]] page to see what our users most wish to see in Audacity, add your own requests, and let us know if you are interested in helping us implement the best of these.
  
 
We also have a [[Roadmap]] of planned steps in Audacity development.
 
We also have a [[Roadmap]] of planned steps in Audacity development.
  
 +
== Bug Fixing ==
  
== Bug Fixing ==
+
Although Audacity is extensively tested, especially when new features and versions are introduced, we depend heavily on users to [[Reporting Bugs|report bugs]] to us. If you are looking for bugs to fix, see [[Bug Lists]].
  
Although Audacity is extensively tested, especially when new features and versions are introduced, we depend heavily on users to [[Reporting Bugs|report bugs]] to us. If you are looking for bugs to fix, our de facto bug list is [[Release Checklist]]. 
+
== Tell us about your changes ==
  
 +
When you have crafted your improvement or bug fix, please tell us about it on audacity-devel. At some stage you would typically commit the changes to your own clone of Audacity on [[GitHub]] and then submit a [[GitHub Pull Requests|GitHub Pull Request]]. We may need time to respond and get the commit ready to merge, if we like your ideas. Always discuss it on audacity-devel if it is more than a couple of lines of code.
  
 
==More about Digital Audio==
 
==More about Digital Audio==
  
There are a few articles in our [[:Category:Digital Audio Technology|Digital Audio Technology]] category on this Wiki, and there is a short explanation of digital audio basics on [http://manual.audacityteam.org/index.php?title=Digital_Audio this page] of our [http://manual.audacityteam.org/ Audacity Manual].  
+
There are a few articles in our [[:Category:Digital Audio Technology|Digital Audio Technology]] category on this Wiki, and there is a short explanation of digital audio basics on [https://manual.audacityteam.org/man/digital_audio.html this page] of our [https://manual.audacityteam.org/ Audacity Manual].  
  
 
There are also articles on the internet ranging from beginners' guides on how sound is represented in a computer, to research papers on digital signal processing (DSP) algorithms. For some recommended sources, see [[Digital Audio Recommended Articles]].
 
There are also articles on the internet ranging from beginners' guides on how sound is represented in a computer, to research papers on digital signal processing (DSP) algorithms. For some recommended sources, see [[Digital Audio Recommended Articles]].

Latest revision as of 07:48, 8 June 2022

Links and brief explanations for developers


See Also:

Yep, we've two or more similar pages doing much the same thing in different ways - and pointing to each other. Our code does much the same thing too :-)


Intro

Audacity aims to be a simple to use but powerful audio editor.

About 3/4 of Audacity source code is concerned with user interface, and less than 1/4 with audio processing. The code is tangled, reflecting its history. Many people with widely varying skill levels have contributed.

The audio code is multi-threaded. This is because audio is real time, it must be delivered at a certain rate (typically 44100 audio samples per second). Different threads work on data at different rates, e.g. large but less frequent bursts of data from Disk IO, with buffering of various kinds between the threads to accommodate the mismatches in rates. The code is more complex because it must both play and record at the same time.
The GUI code is mostly written using wxWidgets library, which handles dialogs and common GUI controls. HOWEVER, the waveforms (in the TrackPanel) is not a standard widget, and Audacity code draws the TrackPanel itself, placing the lines and text and clickable icons.

Building Audacity

Getting Audacity building on Linux is usually trouble-free because the right tools are there in the environment, or can be found and installed easily. On Windows and Mac it takes longer to set up the environment. Unless you are very experienced, you need to stay with the version of Visual Studio (Windows) and version of Xcode and OS X SDK (MacOS) indicated in the links below.

Quick Links

  • Designing Audacity - read and write about what goes into Audacity and how it works
  • Ensuring Quality - coding standards, commenting code, submitting patches...
  • Notes for Packagers - people building Audacity for Linux distributions and the like.
  • Please subscribe to our audacity-devel mailing list to exchange your ideas with our developers or to seek help.

Tips for New Developers

  • Ask lots of questions and do not be afraid to look a fool. It is a learning process and like I tell my students, "if you don't understand (after a reasonable amount of effort), ask somebody who can help".
  • Note our Coding Standards for Audacity (these do not apply to subordinate libraries). Most importantly, do not use tabs at all, and always use three spaces for indentation (otherwise things will not line up on different editors). We mostly use standard camel-case capitalization. Some use Hungarian notation, but not everybody.
  • Note the challenge of maintaining Quality in open source software. We have had many short-term contributors over the many years since 2009. This can result in "organic" interdependencies that aren't obvious, so any code change has the potential to break something. Write your own comments when you add new code. Summarize key points, do not just say the code in words. Choose names logically.
  • Use the same tools other people are using.

Design Topics

Some Design Topics are worth reading when modifying and extending Audacity.

Feature Planning

Improving and Adding Features

Adding new features is one of the more exciting aspects of the job, but needs care so as not to destabilize what is already there. New approaches using a plug-in type of architecture can help this. Even so, there are some things that cannot always be done in an open source application due to licensing restrictions. Have a look at our Feature Requests page to see what our users most wish to see in Audacity, add your own requests, and let us know if you are interested in helping us implement the best of these.

We also have a Roadmap of planned steps in Audacity development.

Bug Fixing

Although Audacity is extensively tested, especially when new features and versions are introduced, we depend heavily on users to report bugs to us. If you are looking for bugs to fix, see Bug Lists.

Tell us about your changes

When you have crafted your improvement or bug fix, please tell us about it on audacity-devel. At some stage you would typically commit the changes to your own clone of Audacity on GitHub and then submit a GitHub Pull Request. We may need time to respond and get the commit ready to merge, if we like your ideas. Always discuss it on audacity-devel if it is more than a couple of lines of code.

More about Digital Audio

There are a few articles in our Digital Audio Technology category on this Wiki, and there is a short explanation of digital audio basics on this page of our Audacity Manual.

There are also articles on the internet ranging from beginners' guides on how sound is represented in a computer, to research papers on digital signal processing (DSP) algorithms. For some recommended sources, see Digital Audio Recommended Articles.