Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) STK

 

 

The STK (abbreviation for 'Systhesis ToolKit') is a free C++ audio library.

 

 

 

 

 

LubuntuUbuntu Installing the STK

 

Under Ubuntu and Lubuntu, the STK can be installed from Ubuntu's Software Center:

 

sudo apt-get install libstk0-dev

 

 

 

 

 

Qt Creator Adding STK to the project file

 

In Qt Creator, to be able to use the STK, add the following lines to your project file:

 

INCLUDEPATH += /usr/include/stk
LIBS += -L/usr/lib -lstk -lrtaudio

 

Thanks to Michael Jenkinson for his '-lrtaudio' suggestion in the project file.

 

 

 

 

 

Qt Creator STK examples

 

 

 

 

 

 

Critique on STK

 

The STK is the only audio library I got to produce beeps from source code.

 

It hurts me that I have much critique on the coding style of the STK:

  1. The STK is not const correct. One should use const whenever possible/feasible [1][2][3][4][5][6]. One should be const correct [7][8][9][10].
  2. The STK uses the keyword register. In this case, one should not use register [11].
  3. The STK uses C-style casts. One should use C++ style casts [12][13].

 

 

 

 

 

External links

 

 

 

 

 

 

References

 

  1. Bjarne Stroustrup. The C++ Programming Language (3rd edition). ISBN: 0-201-88954-4 7.9.3: 'Use const extensively and consistently'.
  2. Scott Meyers. Effective C++ (3rd edition).ISBN: 0-321-33487-6. Item 3: 'Use const whenever possible'.
  3. Jarrod Hollingworth, Bob Swart, Mark Cashman, Paul Gustavson. Sams C++ Builder 6 Developer's Guide. ISBN: 0-672-32480-6. Chapter 3: 'Understand and use const in your code'.
  4. Jesse Liberty. Sams teach yourself C++ in 24 hours. ISBN: 0-672-32224-2. Hour 8, chapter 'Const member functions': 'Use const whenever possible.'.
  5. Scott Meyers. Effective C++ (3rd edition). ISBN: 0-321-33487-6. Item 2: 'Prefer consts, enums and inlines to #defines'.
  6. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 15: 'Use const proactively'.
  7. Herb Sutter. Exceptional C++ style. 2005. ISBN: 0-201-76042-8. Item 1 guideline: 'Be const correct'.
  8. Marshall Cline, Greg Lomow and Mike Girou. C++ FAQs. ISBN: 0-201-3098301. FAQ 14.05: 'Is const correctness tedious?' (Answer: no).
  9. The C++ FAQ Lite. Item 18.1: What is 'const correctness' (Answer: 'A good thing')?
  10. Bruce Eckel. Thinking in C++, second edition, volume 1. 2000. ISBN: 0-13-979809-9. Item 8: 'Constants', paragraph 'Summary': 'const-correctness can be a lifesaver for projects'.
  11. Herb Sutter. Exceptional C++ style. 2005. ISBN: 0-201-76042-8. Item 28 guideline: 'Never write register [...]'.
  12. Bjarne Stroustrup. The C++ Programming Language (3rd edition). ISBN: 0-201-88954-4 6.5.5: 'When explicit type conversion is necessary, prefer the more specific cast operators to the C-style cast'.
  13. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 95: 'Don't use C-style casts'.

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict